Title: | Analysis of Intra Annual Density Fluctuations |
---|---|
Description: | Calculate false ring proportions from data frames of intra annual density fluctuations. |
Authors: | Konrad Mayer [aut, cre], Filipe Campelo [aut] |
Maintainer: | Konrad Mayer <[email protected]> |
License: | GPL-3 |
Version: | 0.1.3 |
Built: | 2025-03-02 06:05:45 UTC |
Source: | https://github.com/konradmayer/iadf |
Calculate the adjusted false ring proportion, as suggested by Osborn et. al. (1997), of a set of binary false ring assignments.
afrp(iadf)
afrp(iadf)
iadf |
A data frame with numeric columns representing individual series and years as rownames where years with IADF are marked with 1, those without with 0, years not covered by the series are set to NA. |
a data frame
Osborn TJ, Briffa KR and Jones PD (1997) Adjusting variance for sample-size in tree-ring chronologies and other regional mean time-series. Dendrochronologia 15, 89-99.
Chapman model fitting to size classes for the calculation of size corrected IADF frequencies according to Campelo et al. (2015).
campelo_chapman( campelo_freq_object, min.n = 15, start = NULL, make.plot = TRUE, max.iter = 500, ... )
campelo_chapman( campelo_freq_object, min.n = 15, start = NULL, make.plot = TRUE, max.iter = 500, ... )
campelo_freq_object |
a campelo frequency object,
output of |
min.n |
minimum number of samples within each group to be included in model estimation |
start |
set custom start values - default to
|
make.plot |
logical |
max.iter |
maximum iterations for internally used
|
... |
additional plotting arguments |
a model object of class "nls"
Campelo, F., Vieira, J., Battipaglia, G. et al. Which matters most for the formation of intra-annual density fluctuations in Pinus pinaster: age or size? Trees (2015) 29: 237. doi:10.1007/s00468-014-1108-9
data('example_iadf') data('example_rwl') model <- campelo_chapman(campelo_freq(example_iadf, example_rwl)) campelo_index(example_iadf, example_rwl, model)
data('example_iadf') data('example_rwl') model <- campelo_chapman(campelo_freq(example_iadf, example_rwl)) campelo_index(example_iadf, example_rwl, model)
Find good start values manually in case
campelo_chapman
returns an error caused by insufficient default starting values.
campelo_chapman_find_start( campelo_freq_object, min.n = 15, max_a = 3, max_b = 1, max_c = 17 )
campelo_chapman_find_start( campelo_freq_object, min.n = 15, max_a = 3, max_b = 1, max_c = 17 )
campelo_freq_object |
a campelo frequency object,
output of |
min.n |
minimum number of samples within each group to be included in model estimation |
max_a |
maximum value of manipulate slider for parameter a |
max_b |
maximum value of manipulate slider for parameter b |
max_c |
maximum value of manipulate slider for parameter c |
a list which can be used as input argument 'start' in
campelo_chapman
Calculate the frequency per ring width class as suggested by Campelo (2015).
campelo_freq(iadf, rwl, n = 20)
campelo_freq(iadf, rwl, n = 20)
iadf |
A data frame with numeric columns representing individual series and years as rownames where years with IADF are marked binary with 1, those without with 0, years not covered by the series are set to NA. |
rwl |
data frame containing ring widths with years in rows and series in columns |
n |
number of ring width classes |
a data frame
Campelo, F., Vieira, J., Battipaglia, G. et al. Which matters most for the formation of intra-annual density fluctuations in Pinus pinaster: age or size? Trees (2015) 29: 237. doi:10.1007/s00468-014-1108-9
campelo_chapman
, campelo_index
data('example_iadf') data('example_rwl') model <- campelo_chapman(campelo_freq(example_iadf, example_rwl)) campelo_index(example_iadf, example_rwl, model)
data('example_iadf') data('example_rwl') model <- campelo_chapman(campelo_freq(example_iadf, example_rwl)) campelo_index(example_iadf, example_rwl, model)
Calculation of size corrected IADF frequencies according to Campelo et al. (2015)
campelo_index(iadf, rwl, model)
campelo_index(iadf, rwl, model)
iadf |
A data frame with numeric columns representing individual series and years as rownames where years with IADF are marked binary with 1, those without with 0, years not covered by the series are set to NA. |
rwl |
a rwl/data.frame object |
model |
a chapman model, output of |
a data frame
Campelo, F., Vieira, J., Battipaglia, G. et al. Which matters most for the formation of intra-annual density fluctuations in Pinus pinaster: age or size? Trees (2015) 29: 237. doi:10.1007/s00468-014-1108-9
data('example_iadf') data('example_rwl') model <- campelo_chapman(campelo_freq(example_iadf, example_rwl)) campelo_index(example_iadf, example_rwl, model)
data('example_iadf') data('example_rwl') model <- campelo_chapman(campelo_freq(example_iadf, example_rwl)) campelo_index(example_iadf, example_rwl, model)
An rwl object to be used in documented examples
example_iadf
example_iadf
A data.frame with 135 years and 30 series.
An rwl object to be used in documented examples
example_rwl
example_rwl
A data.frame with 135 years and 30 series.
Calculate the false ring proportion of a set of binary false ring assignments.
frp(iadf)
frp(iadf)
iadf |
A data frame with numeric columns representing individual series and years as rownames where years with IADF are marked binary with 1, those without with 0, years not covered by the series are set to NA. |
a data frame
calculate false ring proportions from data frames of intra annual density fluctuations
Calculate the frequency per cambial age as suggested by Novak et al. (2013).
novak_freq(iadf, po = NULL)
novak_freq(iadf, po = NULL)
iadf |
A data frame with numeric columns representing individual series and years as rownames where years with IADF are marked binary with 1, those without with 0, years not covered by the series are set to NA. |
po |
a data frame with pith offsets with series names in the first and pith offset as number of rings in the second column |
a data frame
Novak, Klemen and Sánchez, Miguel Angel Saz and Čufar, Katarina and Raventós, Josep and de Luis, Martin. Age, climate and intra-annual density fluctuations in in Spain, IAWA Journal, 34, 459-474 (2013), doi:10.1163/22941932-00000037
data('example_iadf') model <- novak_weibull(novak_freq(example_iadf), 15) novak_index(example_iadf, model)
data('example_iadf') model <- novak_weibull(novak_freq(example_iadf), 15) novak_index(example_iadf, model)
Calculation of age corrected IADF frequencies according to Novak et al. (2013).
novak_index(iadf, model, po = NULL, method = "difference")
novak_index(iadf, model, po = NULL, method = "difference")
iadf |
A data frame with numeric columns representing individual series and years as rownames where years with IADF are marked binary with 1, those without with 0, years not covered by the series are set to NA. |
model |
a model, output of either |
po |
an optional data frame of pith offsets with series names in the first and pith offsets in the second column |
method |
method for the RCS detrending, 'quotient' or 'difference' |
a data frame
Novak, Klemen and Sánchez, Miguel Angel Saz and Čufar, Katarina and Raventós, Josep and de Luis, Martin. Age, climate and intra-annual density fluctuations in in Spain, IAWA Journal, 34, 459-474 (2013), doi:10.1163/22941932-00000037
data('example_iadf') model <- novak_weibull(novak_freq(example_iadf), 15) novak_index(example_iadf, model)
data('example_iadf') model <- novak_weibull(novak_freq(example_iadf), 15) novak_index(example_iadf, model)
Fit a Weibull function for the calculation of age corrected IADF frequencies according to Novak et al. (2013).
novak_weibull( novak_freq_object, min.n = 15, start = NULL, max.iter = 500, make.plot = TRUE, ... )
novak_weibull( novak_freq_object, min.n = 15, start = NULL, max.iter = 500, make.plot = TRUE, ... )
novak_freq_object |
A novak_freq_object as obtained from
|
min.n |
minimum number of samples within each cambial age to be included in model estimation |
start |
set custom start values - default to
|
max.iter |
maximum iterations for internally used
|
make.plot |
logical |
... |
additional plotting arguments |
a model object of class "nls"
Novak, Klemen and Sánchez, Miguel Angel Saz and Čufar, Katarina and Raventós, Josep and de Luis, Martin. Age, climate and intra-annual density fluctuations in in Spain, IAWA Journal, 34, 459-474 (2013), doi:10.1163/22941932-00000037
data('example_iadf') model <- novak_weibull(novak_freq(example_iadf), 15) novak_index(example_iadf, model)
data('example_iadf') model <- novak_weibull(novak_freq(example_iadf), 15) novak_index(example_iadf, model)
Find good start values manually in case
novak_weibull
returns an error caused by insufficient default starting values.
novak_weibull_find_start( novak_freq_object, min.n = 15, max_a = 10, max_b = 3, max_c = 30 )
novak_weibull_find_start( novak_freq_object, min.n = 15, max_a = 10, max_b = 3, max_c = 30 )
novak_freq_object |
A novak_freq_object as obtained from
|
min.n |
minimum number of samples within each cambial age to be included in model estimation |
max_a |
maximum value of manipulate slider for parameter a |
max_b |
maximum value of manipulate slider for parameter b |
max_c |
maximum value of manipulate slider for parameter c |
a list which can be used as input argument 'start' in
novak_weibull
returns the series length of the series within a data.frame/rwl object.
series_length(x)
series_length(x)
x |
a data.frame/rwl object |
a numeric vector
internal function such as sortByIndex as in package dplR, shifts series to start with index 1, maintaining the same vector length by adding NA values to the end.
sort_by_index(x)
sort_by_index(x)
x |
a numeric vector, representing an individual rwl series, potentially containing NA values. |
a numeric vector with the same length as x.
x <- c(NA,NA,NA,1,2,3,4,5, NA, NA) iadf:::sort_by_index(x) #[1] 1 2 3 4 5 NA NA NA NA NA
x <- c(NA,NA,NA,1,2,3,4,5, NA, NA) iadf:::sort_by_index(x) #[1] 1 2 3 4 5 NA NA NA NA NA
little helper functions to convert dataframes from the data format used in multiple dendro-related R packages such as dplR to tidy data used in the tidyverse and vice versa
tidy_crn(crn) untidy_crn(tidy_crn) tidy_rwl(rwl, value_col = "rwl") untidy_rwl(tidy_rwl, value_col = "rwl")
tidy_crn(crn) untidy_crn(tidy_crn) tidy_rwl(rwl, value_col = "rwl") untidy_rwl(tidy_rwl, value_col = "rwl")
crn |
a chronology as obtained from |
tidy_crn |
a tidy chronology as obtained from |
rwl |
ring width data as obtained from |
value_col |
column name of the value column in the tidy tibble of the input resp output object |
tidy_rwl |
tidy ring width data as obtained from |
data frames or tibbles
This function aligns tree ring series to match their cambial ages, taking pith offset into account if provided.
to_cambial_age(rwl, po = NULL)
to_cambial_age(rwl, po = NULL)
rwl |
a data frame/rwl object. |
po |
optional, a data frame containing series names in the first and po data as nr. of years in the second column. |
A data.frame with aligned series
library("dplR") data("gp.rwl") data("gp.po") gp.po$series <- as.character(gp.po$series) iadf:::to_cambial_age(gp.rwl, gp.po)
library("dplR") data("gp.rwl") data("gp.po") gp.po$series <- as.character(gp.po$series) iadf:::to_cambial_age(gp.rwl, gp.po)