Package 'iadf'

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

Help Index


adjusted false ring proportion

Description

Calculate the adjusted false ring proportion, as suggested by Osborn et. al. (1997), of a set of binary false ring assignments.

Usage

afrp(iadf)

Arguments

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.

Value

a data frame

References

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.

See Also

frp


campelo_chapman

Description

Chapman model fitting to size classes for the calculation of size corrected IADF frequencies according to Campelo et al. (2015).

Usage

campelo_chapman(
  campelo_freq_object,
  min.n = 15,
  start = NULL,
  make.plot = TRUE,
  max.iter = 500,
  ...
)

Arguments

campelo_freq_object

a campelo frequency object, output of campelo_freq

min.n

minimum number of samples within each group to be included in model estimation

start

set custom start values - default to list(a = 0.8, b = 0.03, c = 12.5)

make.plot

logical

max.iter

maximum iterations for internally used nls

...

additional plotting arguments

Value

a model object of class "nls"

References

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

See Also

campelo_freq, campelo_index

Examples

data('example_iadf')
data('example_rwl')
model <- campelo_chapman(campelo_freq(example_iadf, example_rwl))
campelo_index(example_iadf, example_rwl, model)

campelo_chapman_find_start

Description

Find good start values manually in case campelo_chapman returns an error caused by insufficient default starting values.

Usage

campelo_chapman_find_start(
  campelo_freq_object,
  min.n = 15,
  max_a = 3,
  max_b = 1,
  max_c = 17
)

Arguments

campelo_freq_object

a campelo frequency object, output of campelo_freq

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

Value

a list which can be used as input argument 'start' in campelo_chapman


iadf frequency per ring width class

Description

Calculate the frequency per ring width class as suggested by Campelo (2015).

Usage

campelo_freq(iadf, rwl, n = 20)

Arguments

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

Value

a data frame

References

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

See Also

campelo_chapman, campelo_index

Examples

data('example_iadf')
data('example_rwl')
model <- campelo_chapman(campelo_freq(example_iadf, example_rwl))
campelo_index(example_iadf, example_rwl, model)

campelo_index

Description

Calculation of size corrected IADF frequencies according to Campelo et al. (2015)

Usage

campelo_index(iadf, rwl, model)

Arguments

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 campelo_chapman

Value

a data frame

References

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

See Also

campelo_freq, campelo_chapman

Examples

data('example_iadf')
data('example_rwl')
model <- campelo_chapman(campelo_freq(example_iadf, example_rwl))
campelo_index(example_iadf, example_rwl, model)

example_iadf

Description

An rwl object to be used in documented examples

Usage

example_iadf

Format

A data.frame with 135 years and 30 series.


example_rwl

Description

An rwl object to be used in documented examples

Usage

example_rwl

Format

A data.frame with 135 years and 30 series.


false ring proportion

Description

Calculate the false ring proportion of a set of binary false ring assignments.

Usage

frp(iadf)

Arguments

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.

Value

a data frame

See Also

afrp


iadf

Description

calculate false ring proportions from data frames of intra annual density fluctuations


iadf frequency per cambial age

Description

Calculate the frequency per cambial age as suggested by Novak et al. (2013).

Usage

novak_freq(iadf, po = NULL)

Arguments

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

Value

a data frame

References

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

See Also

novak_weibull, novak_index

Examples

data('example_iadf')
model <- novak_weibull(novak_freq(example_iadf), 15)
novak_index(example_iadf, model)

novak_index

Description

Calculation of age corrected IADF frequencies according to Novak et al. (2013).

Usage

novak_index(iadf, model, po = NULL, method = "difference")

Arguments

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 novak_weibull

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'

Value

a data frame

References

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

See Also

novak_freq, novak_weibull

Examples

data('example_iadf')
model <- novak_weibull(novak_freq(example_iadf), 15)
novak_index(example_iadf, model)

novak_weibull

Description

Fit a Weibull function for the calculation of age corrected IADF frequencies according to Novak et al. (2013).

Usage

novak_weibull(
  novak_freq_object,
  min.n = 15,
  start = NULL,
  max.iter = 500,
  make.plot = TRUE,
  ...
)

Arguments

novak_freq_object

A novak_freq_object as obtained from novak_freq

min.n

minimum number of samples within each cambial age to be included in model estimation

start

set custom start values - default to list(a = 4, b = 0.33, c = 15.5)

max.iter

maximum iterations for internally used nls

make.plot

logical

...

additional plotting arguments

Value

a model object of class "nls"

References

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

See Also

novak_freq, novak_index

Examples

data('example_iadf')
model <- novak_weibull(novak_freq(example_iadf), 15)
novak_index(example_iadf, model)

novak_weibull_find_start

Description

Find good start values manually in case novak_weibull returns an error caused by insufficient default starting values.

Usage

novak_weibull_find_start(
  novak_freq_object,
  min.n = 15,
  max_a = 10,
  max_b = 3,
  max_c = 30
)

Arguments

novak_freq_object

A novak_freq_object as obtained from novak_freq

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

Value

a list which can be used as input argument 'start' in novak_weibull


series length

Description

returns the series length of the series within a data.frame/rwl object.

Usage

series_length(x)

Arguments

x

a data.frame/rwl object

Value

a numeric vector


sort_by_index

Description

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.

Usage

sort_by_index(x)

Arguments

x

a numeric vector, representing an individual rwl series, potentially containing NA values.

Value

a numeric vector with the same length as x.

Examples

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

tidy and untidy ring width data

Description

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

Usage

tidy_crn(crn)

untidy_crn(tidy_crn)

tidy_rwl(rwl, value_col = "rwl")

untidy_rwl(tidy_rwl, value_col = "rwl")

Arguments

crn

a chronology as obtained from chron

tidy_crn

a tidy chronology as obtained from tidy_crn

rwl

ring width data as obtained from read.rwl

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 tidy_rwl

Value

data frames or tibbles


to_cambial_age

Description

This function aligns tree ring series to match their cambial ages, taking pith offset into account if provided.

Usage

to_cambial_age(rwl, po = NULL)

Arguments

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.

Value

A data.frame with aligned series

Examples

library("dplR")
data("gp.rwl")
data("gp.po")
gp.po$series <- as.character(gp.po$series)
iadf:::to_cambial_age(gp.rwl, gp.po)