-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Age_OSLC14() ... Compilation error on line 72 #14
Comments
In the example above there is an inconsistency between: 'samplenature = matrix( which means C14, OSL, OSL and Age <- where the name order corresponds to OSL, C14, OSL. In other words can you reproduce the error by replacing the last line by SampleNames = c(Names, "GDB5", "GDB3")? |
Unfortunately, this has no effect. Though, I tested it and corrected the example above to avoid this misunderstanding. Lines 363 to 373 in 6db4dc7
I will have another look into the code. Update The function requires at least two changes. In other words, the example will also fail in the case when the C-14 sample is at the end. However, if the sample is in the middle, we have two changes and it will still work. |
I had a thorough look at it. The function expects at least two index changes for the sample nature. Example:
Oddly enough, After giving it some thought, I found it easier and safer to opt for a proper error message instead of a fix, because the index counting extends into the BUGS model. In other words, more code would need attention. I found that too risky because I do not overlook all consequences and it is just an edge case. The new error message should help the user to understand the underlying problem. If ok for you, I would close the issue. |
Observed behaviour
Running mini example
The following example sets is a copy & paste example from the manual. However, here the example exchanges the
samplenature
. Now the first sample is the C-14 sample, not the OSL sample (as it is in the original sample).Solution?
Lines 364 onwards in
Age_OSLC14()
contains probably the root of the problem. It calculates the variableind_change
, which is preset to1
and expresses the index change in the sample nature matrix. If like in the example above, C-14 comes first, later the function jumps into the wrongif
expression and sets the objectq
to0
. If that happens, a loop in the BUGS model fails, and the variablek
gets never set. Unfortunately, it appears that this is a bug that is not straightforward to fix. Luckily it seems to disappear when the number of samples is increased to at least four. Nevertheless, given the odd code, the function may cause other unwanted effects, and a fix is strongly recommended.The text was updated successfully, but these errors were encountered: