Title: Age Band Decomposition Method for Tree Ring Standardization
Version: 2.0.0
Description: Implements the Age Band Decomposition (ABD) method for standardizing tree ring width data while preserving both low and high frequency variability. Unlike traditional detrending approaches that can distort long term growth trends, ABD decomposes ring width series into multiple age classes, detrends each class separately, and then recombines them to create standardized chronologies. This approach improves the detection of growth signals linked to past climatic and environmental factors, making it particularly valuable for dendroecological and dendroclimatological studies. The package provides functions to perform ABD-based standardization, compare results with other common methods (e.g., BAI, C method, RCS), and facilitate the interpretation of growth patterns under current and future climate variability.
URL: https://gitlab.com/Puletti/agebanddecomposition_rpackage
Language: en-US
License: GPL (≥ 3)
Encoding: UTF-8
RoxygenNote: 7.3.2
LazyData: true
Imports: dplyr, tidyr, tibble, readxl, ggplot2, dplR, patchwork
Suggests: testthat (≥ 3.0.0)
Config/testthat/edition: 3
Depends: R (≥ 4.1.0)
NeedsCompilation: no
Packaged: 2026-02-04 14:38:41 UTC; nicolapuletti
Author: Nicola Puletti ORCID iD [aut, cre], Gianluigi Mazza ORCID iD [aut], Dimitrios Sarris ORCID iD [ctb]
Maintainer: Nicola Puletti <nicola.puletti@crea.gov.it>
Repository: CRAN
Date/Publication: 2026-02-04 15:20:08 UTC

ABD - Age Band Decomposition

Description

ABD - Age Band Decomposition. This function calculates standardized tree-ring width chronologies by decomposing tree-ring width (stdTRW) data into age bands, detrending each age band separately, and then recombining them to produce the mean standardized chronology. Specifically, ABD standardizes each series within its age band (e.g., each ring width is divided by the corresponding age-specific expected value from the stdTRW). Then, standardized values from all age bands are merged and averaged to produce a composite chronology, preserving both inter-annual and low-frequency climate signals.

Usage

ABD(inTRW, min_nTrees_year = 3, pct_stdTRW_th = 0.5, pct_Trees_th = 0.3)

Arguments

inTRW

tibble. A tibble. The input dataset obtained from the import_rwl() function.

min_nTrees_year

Numeric. Sets the minimum number of trees per year required within each age class to be included in the analysis. The default is 3. Using less than three trees may result in poor representation of within-class variability and is not recommended unless data availability is limited.

pct_stdTRW_th

Numeric. Sets the threshold for the minimum proportion of standardized tree-ring width values required within a given age class. The default is set to 0.5, meaning that at least 50% of the possible values must be present (e.g., 6 out of 10 values for 10-year age bands, or 11 out of 20 for 20-year bands). For instance, the final age band of a 94-year-old tree (i.e., the 91–100-year band) includes only 4 years of growth. Since this number of years below the threshold, we recommend excluding that tree from the corresponding age band group.

pct_Trees_th

Numeric. Sets the minimum number of samples (i.e., trees) required to compute the mean standardized tree-ring widths within each age band. The default value is 0.3. However, when working with small sample sizes (approximately 20 trees or fewer), increasing the threshold to 0.5 is recommended to ensure that more trees are included in the analysis.

Details

The function performs age-band decomposition on stdTRW data by filtering out age classes with insufficient observations (min_nTrees_year) or excessive within-class variation.

The stdTRW_th value is particularly important in small datasets: too strict a threshold may exclude valid data. If working with approximately 20 trees or fewer, a threshold of 0.5 is suggested.

Please, see the Examples section below for a demonstration using a typical input tibble obtained with import_rwl().

Value

A tibble with the following columns: year, N_ageBands, ABD, and ABDsd.

See Also

import_rwl, stdTRW, plotABD

Other ABD functions: import_rwl(), stdTRW()

Examples

ABD(inTRW)

TRW_readExcel (Deprecated)

Description

This function is deprecated and will be removed in a future version. Please use import_rwl instead after converting your data to RWL format.

Usage

TRW_readExcel(path, sheet, ageBands, limitFirst20y = FALSE, verbose = TRUE)

Arguments

path

Path to the xls/xlsx file.

sheet

Sheet to read.

ageBands

character. Age band window setting.

limitFirst20y

logical. Remove first 20 years from each tree.

verbose

logical. Print additional information.

Value

A list of two objects (see original documentation).

See Also

import_rwl


import_rwl

Description

This function imports tree-ring width data from RWL (Tucson format) files and pith offset information, then arranges the dataset for ABD analysis.

Usage

import_rwl(
  rwl_path,
  po_path,
  ageBands,
  first_age_class = NULL,
  zero_as_na = TRUE,
  verbose = TRUE
)

Arguments

rwl_path

Path to the RWL file (Tucson format).

po_path

Path to the pith offset file (tab-delimited text file with columns 'tree_code' and 'pith.offset').

ageBands

character. Setting the age band window. It must be set to '1010' if all the age classes have the same size (10 years). It must be '1020' if the age classes have different sizes: 10 years till 100 and then 20 years size.

first_age_class

numeric. is numeric and specifies the first age band from which the analysis begins. If NULL (default), no filtering is applied. For example, first_age_class = 3 excludes the first 20 years of growth (age classes 1 and 2 in '1010' mode).

zero_as_na

logical. If TRUE (default), zero values in TRW are converted to NA. If FALSE, zero values are kept as is.

verbose

logical. If TRUE, prints additional information during import.

Details

The RWL file must be in Tucson format (readable by dplR::read.rwl). The pith offset file must be a tab-delimited text file with header containing columns 'tree_code' and 'pith.offset', where pith.offset indicates the number of missing rings between the pith and the first measured ring. are available on the package's GitLab page. https://gitlab.com/Puletti/agebanddecomposition_rpackage and can be used to test the package's functions.

Value

A list of two objects. The first object is a tibble representing the imported dataset in long format. In this tibble the last two columns are an identification number (id_by_years) and two grouping variables (age_class and ageBands). The second object in the list is a lookup table (tibble), useful for further steps.

See Also

stdTRW, ABD

Other ABD functions: ABD(), stdTRW()

Examples

# Download example files from the package's GitLab page
package_gitlab_site <- 'https://gitlab.com/Puletti/agebanddecomposition_rpackage'
rwl_url <- "/-/raw/main/studio/dati/TRW_example.rwl"
po_url <- "/-/raw/main/studio/dati/pith.offset.txt"

# Create temporary files
tmpfile_rwl <- tempfile(fileext = ".rwl")
tmpfile_po <- tempfile(fileext = ".txt")

# Download the files
download.file(paste0(package_gitlab_site, rwl_url),
              tmpfile_rwl,
              mode = "wb")

download.file(paste0(package_gitlab_site, po_url),
              tmpfile_po,
              mode = "wb")

# Import the data
inData <- import_rwl(rwl_path = tmpfile_rwl, 
                             po_path = tmpfile_po, 
                             ageBands = '1010', 
                             first_age_class = 3,
                             zero_as_na = TRUE,
                             verbose = TRUE)

# View the result
inData

AgeBandDecomposition test data

Description

A tiny test dataset including example, the basic reference for AgeBandDecomposition package.

A list of two test datasets derived from TRW_readExcel function. The first list-object is a tibble that can be used as the argument of stdTRW function.

Usage

inTRW

inTRW

Format

A tibble with 85 rows and 16 variables, as derived from the Excel file.

A list of two tibbles


plotABD

Description

Function for plotting ABD values from inTRW object using the two tibble objects produced by the function import_rwl.

Usage

plotABD(
  inTRW,
  min_nTrees_year = 3,
  pct_stdTRW_th = 0.5,
  pct_Trees_th = 0.3,
  linewidth_TRW = 0.7,
  linewidth_Ntrees = 1,
  byYears = 20,
  xlim = NULL,
  ylimABD = NULL,
  ...
)

Arguments

inTRW

tibble. A tibble. The input dataset obtained from the import_rwl() function.

min_nTrees_year

Numeric. The minimum number of trees per year required within each age class to be included in the analysis. The default is 3. Using less than three trees may result in poor representation of within-class variability and is not recommended unless data availability is limited.

pct_stdTRW_th

Numeric. It defines the threshold for the minimum proportion of standardized tree-ring width values required within a given age class. The default is set to 0.5, meaning that at least 50% of the possible values must be present (e.g., 6 out of 10 values for 10-year age bands, or 11 out of 20 for 20-year bands). For instance, the final age band of a 94-year-old tree (i.e., the 91–100-year band) includes only 4 years of growth. Since this number of years below the threshold, we recommend excluding that tree from the corresponding age band group.

pct_Trees_th

Numeric. It defines the threshold used to calculate the mean standardized tree-ring widths within each age band. The default value is 0.3. However, when working with small sample sizes (approximately 20 trees or fewer), it is advisable to increase the threshold to 0.5. This adjustment helps retain more trees in the analysis while still accounting for natural growth variability.

linewidth_TRW

numeric. line size for TRW.

linewidth_Ntrees

numeric. line size for Ntrees.

byYears

numeric. Spacing (in years) between tick marks on the x-axis of time-related plots.

xlim

Optional numeric vector of length 2 specifying the limits of the x-axis. If NULL the limits are automatically determined.

ylimABD

Optional numeric vector of length 2 specifying the limits of the y-axis for the ABD panel. If NULL the limits are automatically determined.

...

Other arguments passed on to methods. Not currently used.

Details

This function produces a multi-panel plot with three graphs: the first displays standardized values by age band; the second shows the final mean chronology (ABD), adjusted for age-related effects; and the third depicts the corresponding number of trees.

Value

None. A multipanel plot.

See Also

plotBAI, plotTRW, ABD

Other tree ring plotting: plotBAI(), plotTRW()

Examples


plotABD(inTRW, 
   min_nTrees_year = 3, 
   pct_stdTRW_th = .5,
   pct_Trees_th = .3,
   byYears = 50)

plotBAI

Description

Function for plotting basal area increment (BAI) values derived from inTRW object using the first tibble produced by the function import_rwl.

Usage

plotBAI(
  inTRW,
  linewidth_BAI = 1,
  linewidth_Ntrees = 1,
  byYears = 20,
  xlim = NULL,
  ylim = NULL,
  ...
)

Arguments

inTRW

tibble. The first object resulting from the import_rwl function.

linewidth_BAI

numeric. line size for BAI.

linewidth_Ntrees

numeric. line size for Ntrees.

byYears

numeric. Spacing (in years) between tick marks on the x-axis of time-related plots.

xlim

Optional numeric vector of length 2 specifying the limits of the x-axis. If NULL the limits are automatically determined.

ylim

Optional numeric vector of length 2 specifying the limits of the y-axis for the ABD panel. If NULL the limits are automatically determined.

...

Other arguments passed on to methods. Not currently used.

Details

This function generates a basic plot displaying the mean chronology +/- standard error of raw basal area increments (in squared cm) alongside the corresponding number of trees.

Value

None. A plot is produced.

See Also

plotTRW, plotABD

Other tree ring plotting: plotABD(), plotTRW()

Examples

plotBAI(inTRW
    , linewidth_BAI = .5
    , linewidth_Ntrees = 1
    )

plotTRW

Description

Function for plotting TRW values from inTRW object using the first tibble produced by the function import_rwl.

Usage

plotTRW(
  inTRW,
  linewidth_TRW = 1,
  linewidth_Ntrees = 1,
  byYears = 20,
  xlim = NULL,
  ylim = NULL,
  ...
)

Arguments

inTRW

tibble. The first object resulting from the import_rwl function.

linewidth_TRW

numeric. line size for TRW.

linewidth_Ntrees

numeric. line size for Ntrees.

byYears

numeric. Spacing (in years) between tick marks on the x-axis of time-related plots.

xlim

Optional numeric vector of length 2 specifying the limits of the x-axis. If NULL the limits are automatically determined.

ylim

Optional numeric vector of length 2 specifying the limits of the y-axis for the ABD panel. If NULL the limits are automatically determined.

...

Other arguments passed on to methods. Not currently used.

Details

This function generates a basic plot displaying the mean chronology +/- standard error of raw tree-ring widths (in mm) alongside the corresponding number of trees.

Value

None. A plot is produced.

See Also

plotBAI, plotABD

Other tree ring plotting: plotABD(), plotBAI()

Examples


plotTRW(inTRW)


stdTRW

Description

To remove the influences of local site characteristics on tree growth, this function standardizes the tree-ring width series by dividing each tree-ring width of a particular series by the mean width of that series. In dendroclimatic studies, it is advisable to exclude the initial years or decades of growth (the first “age bands”, i.e., 1-10 and 11-20) as they are less likely to contain climatic signals rather than the influence of strong early-year growth competition within the tree stand (Mazza and Sarris, 2021; Sarris et al., 2007).

Usage

stdTRW(inTRW)

Arguments

inTRW

tibble. The first object resulting from the import_rwl function.

Details

To export a tibble like the one below to an .xlsx file, you can use the writexl package:

mytibble <- stdTRW_df |>
  dplyr::group_by(year) |>
  dplyr::summarise(
    N_trees = dplyr::n(),
    mean_stdTRW = mean(stdTRW, na.rm = TRUE)
  )

writexl::write_xlsx(mytibble, path = "my_stdTRW_df.xlsx")

This will create an Excel file named my_stdTRW_df.xlsx in your current working directory. Please, check also the Examples section below for how to obtain stdTRW_df object.

Value

A tibble with the following columns: year, tree_code, TRW, meanTRW, and stdTRW. Together with additional columns of grouping variables based on age class.

References

Mazza, G., Sarris, D., 2021. Identifying the full spectrum of climatic signals controlling a tree species' growth and adaptation to climate change. Ecol. Indic. 130, 108109. https://doi.org/10.1016/j.ecolind.2021.108109.

Sarris, D., Christodoulakis, D., Körner, C., 2007. Recent decline in precipitation and tree growth in the eastern Mediterranean. Glob. Chang. Biol. 13 (6), 1187–1200. https://doi.org/10.1111/j.1365-2486.2007.01348.x.

See Also

import_rwl, ABD

Other ABD functions: ABD(), import_rwl()

Examples

inTRW_1 <- inTRW[[1]]

stdTRW_df <- stdTRW(inTRW_1)

stdTRW_df |>
dplyr::group_by(year) |>
dplyr::summarise(N_trees = dplyr::n(),
       mean_stdTRW = mean(stdTRW, na.rm = TRUE)) |>
       ggplot2::ggplot(ggplot2::aes(year, N_trees)) +
       ggplot2::geom_line()