ISAAKiel / oxcAAR

R Package - Interaction with Oxcal
GNU General Public License v2.0
21 stars 4 forks source link

set last prob to 0 if range ends at 1950.5 #28

Closed dirkseidensticker closed 5 years ago

dirkseidensticker commented 5 years ago

The base plots of calibrated dates are disturbed as soon as the calibrated range hit's 1950 and the probability is not 0 at this time; e.g.

cal <- oxcalCalibrate(200, 35, "LAB")
plot(cal)

results in: Rplot

I suggest to set the last value of the raw_probabilities to 0 if a calibrated date 'hit's' 1950.5. With that fix (?) output looks like: Rplot01

Alternatively one might think of adding a value at year 1951(?) and set its probability to 0.

@MartinHinz What do you think?

MartinHinz commented 5 years ago

Unfortunately, your very elegant solution resulted in an build error in travis. If you accept (or modify and correct) my solution, I am more than happy to merge!

dirkseidensticker commented 5 years ago

Your solution works perfectly 🎱 Sorry, it took me so long for testing. And many thanks. I learned quite something going through your code, adapting my quick-and-dirty hack.