Quantcast
Channel: Active questions tagged r - Stack Overflow
Viewing all articles
Browse latest Browse all 210554

How to plot age-depth model using Bchron in R when dates are far apart?

$
0
0

I'm trying to construct an age-depth model for a sediment core. The first 10 dates were determined using Pb210, the last date is from C14 dating.

Data:

dates <- tribble(  ~sample_id, ~depth, ~age_BP, ~age_error,"0", 0, -71, 0,"0.25", 0.25, -70.54, 0.06,"2.25", 2.25, -66.58, 0.43,"4.25", 4.25, -62.17,  0.66,"6.25", 6.25, -57.10, 0.90,"8.25", 8.25, -50.77, 1.20,"10.25", 10.25, -41.86, 1.66,"14.24", 14.25, -14.09, 3.40,"18.25", 18.25, 21.96, 8.54,"22.25", 22.25, 58.31, 12.25, "33.25", 33.25, 435.00, 11.00 )

I'm using the Bchron package to connect the dates.

library("Bchron") results<-Bchronology(  ages=dates$age_BP,  ageSds=dates$age_error,  positions=dates$depth,   positionThickness=c(0.5,0.5,0.5,0.5,0.5,0.5,0.5,0.5,0.5,0.5,0.5),  calCurves=c("normal","normal","normal","normal","normal","normal", "normal","normal","normal","normal","intcal20"),  predictPositions=seq(0,34, by=0.5),   maxExtrap = 1000,   allowOutside = FALSE,  extractDate = 1950-as.numeric(format(Sys.time(), "%Y")))

error:

"Unable to find suitable chronologies for top of core - truncated to date of extraction"

date_plot<-plot(results) + ylab("Depth (cm)") + xlab("Years BP"))date_plot

error:

"1: In regularize.values(x, y, ties, missing(ties), na.rm = na.rm) :collapsing to unique 'x' values2: In regularize.values(x, y, ties, missing(ties), na.rm = na.rm) :collapsing to unique 'x' values"

I get a plot but the model isn't including the last date. I have other similar data that I can run and not get any errors and end up with a nice plot. Does anyone know how I could modify the code to get it to include the last date? Is this an issue with the model and I'll have to try a different package or is there a way to do this with Bchron?


Viewing all articles
Browse latest Browse all 210554

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>