Open Danapit opened 1 year ago
Hi Dana,
Thank you for your message. In the original function, we wanted to visualise the line to help the user identify the Cesium peak, even when Cesium would have not been measured at every interval (which could make sense if someone is trying to limit the cost of the analyses). We had implement the option that any line between two non-consecutive points of measurements would have a smaller width (lwd = 0.5 instead of default of lwd = 1), but I realise it may be too subtle. Therefore, I added on top of that a different line type (dotted line) to make it more obvious that values are missing and that it is an interpolation between 2 points. That would answer the question if you have NAs in your dataset.
I also added 3 more arguments regarding the detection limit. DL_Pb
, DL_Cs
and DL_Am
, respectively for the detection limits of Pbex, Cs and Am. Any values below these DL for Cs and Am be changed as NA in the first part of the code. For Pb, the values below the detection limit are added to the "ignore" vector (they will be plotted in grey).
I cannot do better than that at the moment - it would require a bit of work to implement a more flexible solution!
Finally, I also added a new argument in the function to prevent from plotting the Cs line to answer the second part of your comment.
Detach the package and reinstall it to be able to use the new argument: plot_Cs_line
. The default is TRUE, but if you turn it to FALSE, you will not get the line.
# Re-install serac
detach("package:serac", unload = TRUE)
devtools::install_github("rosalieb/serac", build_vignettes = TRUE)
library(serac)
# Run your code using the argument plot_Cs_lines
serac(..., plot_Cs_line = FALSE, DL_Cs = 20)
To summarise:
Thanks a lot for the rapid answer! Will test this :)
I actually did a few tests with the Am and Cs values totally removed, and it was misleading.. So I changed the code again.
Now, in the same way than it did for Pb, if a value of Cs is < DL_Cs
, and a value of Am is < DL_Am
, it will be shown on the graph, but in light grey.
The values are still accounted for in the Cesium inventory though...
Here is the result for the test data, with different detection limits (see home page of the package to get the data):
model_ALO09P12 <-
serac(name="serac_example_ALO09P12", coring_yr=2009, model=c("CFCS"),
plotphoto=FALSE, minphoto=c(0), maxphoto=c(210),
plot_Pb=T, plot_Am=T, plot_Cs=T, Cher=c(30,40), Hemisphere=c("NH"), NWT=c(51,61),
sedchange=c(75.5),
plot_Pb_inst_deposit=T, inst_deposit=c(20,28,100,107,135,142,158,186),
suppdescriptor=TRUE, descriptor_lab=c("Ca/Fe"),
historic_d=c(20,28,100,107,135,142,158,186),
historic_a=c(1994,1920,1886,1868),
historic_n=c("sept 1994 flood","1920 flood","1886 flood","1868 flood ?"),
min_yr=c(1750),
dmax=c(180),
plotpdf=T, preview=T,
save_code=FALSE,
DL_Pb = 25, DL_Cs = 25, DL_Am = 3)
Hey :) Sorry it took me a while to test this.
plot_Cs_lines = FALSE
attribute (after reinstalling the package). With this code. serac(name="BY",coring_yr=2007, mass_depth = TRUE, plot_Cs=T, plot_Cs_lines = FALSE, DL_Cs = 1, Hemisphere = "NH", NWT = c(75), sedchange = 80)
I got an error Error in serac(name = "BY", coring_yr = 2007, mass_depth = TRUE, plot_Cs = T, : unused argument (plot_Cs_lines = FALSE)
and as you can see below (I know, not a pretty profile), the line for 137Cs is still there. Any idea what went wrong?Thanks!
Hi!
Thanks for taking the time to test this. No worries at all about the delay: I still have had no time to check your other issue, and I may have to have you wait for a while, as I have lots of work these days. If you need an answer quicker, feel free to reach out about that other question to my co-author, Pierre Sabatier, as this is more of a "philosophical" question about what to do and not do, and he is the expert on age-depth models (I was the user of chronologies/developer).
To answer your questions:
plot_Cs_line
(no 's'). My bad, I did a typo up there in my previous answer. Re-run the same code with the typo corrected, and you should get what you want.Let me know if this worked for you, and thank you again for helping improve serac
.
PS: I am adding a little check-list for myself:
Hi! No worries, and you are right, the other issue is a kind of "deeper" question and it's not at all urgent, I no longer work in this field of science and I'm just generally interested, because I find this R package a really cool tool. Plus non-linear fitting is certainly less convenient. There must be a good reason why most of the dating people use the linearized version of fitting.
plot_Cs_line
works for me, great!
Thank you!Thank you so much for you positive feedback! I'll come back to work on this when I can.
Hey Rosalie, Is there a way of disabling the points in Cs-137 plot being connected by a line? It's a bit misleading in case some values are missing (not measured or below detection limit). Instead, some way of adding values of level of determination (< = less than) would be great. But already not having the line plot would be a great improvement. Cheers! Dana