# NOT RUN {
# Create test data (= ideal case)
# Set boundary conditions
Td <- seq(1, 12 * 365, 1) # Create timeline of 12 years in days
Ty <- Td / 365 # Convert to years
MAT <- 20 # Set mean annual temperature
Amp <- 10 # Set seasonal amplitude
Sext <- 2 * Amp # Calculate extent of seasonal variability
TSD <- 1.5 # Set the degree of random non<U+00E2><U+20AC><U+201C>seasonal noise on the SST curve
# ("weather")
SST <- rnorm(length(Ty), MAT + Amp * sin(2 * pi * Ty), TSD) # Create virtual
# daily SST data
GR <- rep(10 / 365, length(Ty)) # Set growth rate to 10 mm/yr and create daily
# GR vector
SR <- 0.75 # Set sampling resolution to 0.75 mm
# Create vector for all samples along entire shell length by applying constant
# sampling resolution
D <- seq(SR, sum(GR), SR)
D_cum <- cumsum(GR) # Create cumulative depth vector for all values
new_data <- subsample(SST, D_cum, D, AV = TRUE, plot = FALSE) # Interpolate
# SST values at the positions of D while calculating sample averages
# }
Run the code above in your browser using DataLab