Skip to content
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

Changing resolution causes error #31

Closed
MartinHinz opened this issue Sep 14, 2020 · 1 comment
Closed

Changing resolution causes error #31

MartinHinz opened this issue Sep 14, 2020 · 1 comment

Comments

@MartinHinz
Copy link
Member

From a user:

I am trying to use oxcAAR, which seems to be a nice tool for R user when
calibrating 14C dates. I have a problem when changing the Resolution
option to 1 year instead of the default (5 years). The simple following
script works perfectly:

res=executeOxcalScript("R_Date("test", 1120, 30);")
OxCal v4.4.2 (c) Bronk Ramsey (2020)
res2 <- readOxcalOutput(res)
res3 <- parseOxcalOutput(res2)

and produce an adequate output (.js) file.

But, changing the resolution gives an error:

res=executeOxcalScript("Options(){Resolution=1;}; R_Date("test",
1120, 30);")
OxCal v4.4.2 (c) Bronk Ramsey (2020)
res2 <- readOxcalOutput(res)
res3 <- parseOxcalOutput(res2)
Error in seq.default(from = calcurve_start, by = calcurve_resolution, :
'from' must be of length 1

The output .js file is built (I attach it to this mail), but
"parseOxcalOutput" fails to read its content.

Do you have any idea where does this error come from?

@MartinHinz
Copy link
Member Author

Reason: When Resolution is changed, Oxcal just add another entry for the calibration ("calib[0]") with the settings from the Option command.
Monkey patch solution: in extractCalCurveFromOxcalResult() only the last entry of name, start and resolution is considered now, using

calcurve_resolution <- calcurve_resolution[length(calcurve_resolution)]

More sustainable solution:
#29

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant