EcologyR / BlueCarbon

Estimation of organic carbon stocks and sequestration rates from soil/sediment cores from blue carbon ecosystems
https://ecologyr.github.io/BlueCarbon/
Other
2 stars 0 forks source link

chek resolution of the core to estimate flux #35

Closed NPJuncal closed 10 months ago

NPJuncal commented 1 year ago

If the resolution of the core is to low and the fist sample is already older than the time frame provided it will break the function

add a check to skip the core if resolution is too low, similar to the core max age check

if max age is lower than the time frame by a 25% of the time frame do not estimate

if ((max(df$age_r) + (max(df$age_r) * 0.25)) < timeframe) { message (paste("Core", core, "is younger than the time frame provided")) flux <- NA }

if number of samples is equal to one >> first sample already older than time frame, skip this core

if (nrow(df) == 1) { message (paste("Core", core, "age resolution is to low to estimate the flux with by the time frame provided")) flux <- NA }

NPJuncal commented 10 months ago

issue added in the funtion especific issue