age_corr | R Documentation |
Some occurrences in the model results can lead the CumDY function to detect extra year transitions, resulting in sudden jumps in the shell chronology or a start of the chronology at an age beyond 1 year. This function removes these sharp transitions and late onset by adding or subtracting whole years to the age result.
age_corr(resultarray, T_per = 365, plot = TRUE, agecorrection = TRUE)
resultarray |
Array containing the full results of the optimized growth model |
T_per |
The period length of one year (in days) |
plot |
Should the results be plotted? (/codeTRUE/FALSE) |
agecorrection |
Correct for jumps in age (/codeTRUE) or only for starting time (/codeFALSE) |
An updated and corrected version of resultarray
package dependencies: ggplot2 3.2.1
testarray <- array(NA, dim = c(20, 16, 9)) # Create empty array # with correct third dimension windowfill <- seq(10, 100, 10) # Create dummy simulation data # (ages) to copy through the array for(i in 6:length(testarray[1, , 1])){ testarray[, i, 3] <- c(windowfill, rep(NA, length(testarray[, 1, 3]) - length(windowfill))) windowfill <- c(NA, windowfill + 31) } testarray2 <- age_corr(testarray, 365, FALSE, FALSE) # Apply function on array
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.