Title: | Detection and Analysis of Insect Defoliation Signals in Tree Rings |
---|---|
Description: | Tools to identify, quantify, analyze, and visualize growth suppression events in tree rings that are often produced by insect defoliation. Described in Guiterman et al. (2020) <doi:10.1016/j.dendro.2020.125750>. |
Authors: | Chris Guiterman [aut, cre] , Ann Lynch [aut] , Jodi Axelson [aut] |
Maintainer: | Chris Guiterman <[email protected]> |
License: | GPL (>= 3) |
Version: | 0.3.0 |
Built: | 2024-11-01 03:40:01 UTC |
Source: | https://github.com/chguiterman/dfoliatr |
defol
objectCast data frame to list-like defol
object
as_defol(x)
as_defol(x)
x |
A data frame or list-like object to cast. Must have named elements for "year", "series", "gsi", "ngsi", and "defol_status". |
x
cast to a defol
object
data(dmj_defol) example_data <- as.data.frame(dmj_defol) is.defol(example_data) back_to_defol <- as_defol(example_data) is.defol(back_to_defol)
data(dmj_defol) example_data <- as.data.frame(dmj_defol) is.defol(example_data) back_to_defol <- as_defol(example_data) is.defol(back_to_defol)
obr
objectCast data frame to list-like obr
object
as_obr(x)
as_obr(x)
x |
A data frame or list-like object to cast. Must have named elements for "year", "samp_depth", "num_defol", "perc_defol", "num_max_defol", "perc_max_defol", "mean_gsi", "mean_ngsi", "outbreak_status". |
x
cast to an obr
object
data(dmj_obr) example_data <- as.data.frame(dmj_obr) is.obr(example_data) back_to_obr <- as_obr(example_data) is.obr(back_to_obr)
data(dmj_obr) example_data <- as.data.frame(dmj_obr) is.obr(example_data) back_to_obr <- as_obr(example_data) is.obr(back_to_obr)
as_defol()
Alias to as_defol()
as.defol(x)
as.defol(x)
x |
A data frame or list-like object to cast. Must have named elements for "year", "series", "gsi", "ngsi", and "defol_status". |
x
cast to a defol
object
data(dmj_defol) example_data <- as.data.frame(dmj_defol) is.defol(example_data) back_to_defol <- as_defol(example_data) is.defol(back_to_defol)
data(dmj_defol) example_data <- as.data.frame(dmj_defol) is.defol(example_data) back_to_defol <- as_defol(example_data) is.defol(back_to_defol)
as_obr()
Alias to as_obr()
as.obr(x)
as.obr(x)
x |
A data frame or list-like object to cast. Must have named elements for "year", "samp_depth", "num_defol", "perc_defol", "num_max_defol", "perc_max_defol", "mean_gsi", "mean_ngsi", "outbreak_status". |
x
cast to an obr
object
data(dmj_obr) example_data <- as.data.frame(dmj_obr) is.obr(example_data) back_to_obr <- as_obr(example_data) is.obr(back_to_obr)
data(dmj_obr) example_data <- as.data.frame(dmj_obr) is.obr(example_data) back_to_obr <- as_obr(example_data) is.obr(back_to_obr)
Constructor for S3 defol class
defol(year, series, gsi, ngsi, defol_status)
defol(year, series, gsi, ngsi, defol_status)
year |
An n-length integer vector of observation years |
series |
An n-length factor or character vector of series names |
gsi |
An n-length numeric vector of growth suppression index, such as
calculated by |
ngsi |
An n-length numeric vector of normalized gsi, such as calculated
by |
defol_status |
An n-length factor or character vector denoting the
defoliation event status of each year. This uses a controlled vocabulary,
see |
a tree-level defol
object
Descriptive statistics for defoliation trees
defol_stats(x)
defol_stats(x)
x |
A defol object after running |
A data frame containing tree/series-level statistics.
If series-end-events are present, they are omitted from calculations of total event years and mean duration.
data("dmj_defol") defol_stats(dmj_defol)
data("dmj_defol") defol_stats(dmj_defol)
defoliate_trees()
is the starting point for most analyses of insect
defoliation signals preserved in the growth patterns of trees. It requires
individual-tree standardized measurements from potential host trees and a
tree-ring chronology from a nearby non-host species. First,
defoliate_trees()
combines these tree-ring indices by calling gsi()
to
perform a "correction" of the host-tree indices to remove the climatic
influences on tree growth as represented by the non-host chronology. This
should isolate a disturbance-related signal. Second, defoliate_trees()
, runs
id_defoliation()
, which completes a runs analyses to evaluate sequences of
negative departures in the host tree growth series (ngsi
) for potential
defoliation events.
defoliate_trees( host_tree, nonhost_chron = NULL, duration_years = 8, max_reduction = -1.28, bridge_events = FALSE, series_end_event = FALSE, list_output = FALSE )
defoliate_trees( host_tree, nonhost_chron = NULL, duration_years = 8, max_reduction = -1.28, bridge_events = FALSE, series_end_event = FALSE, list_output = FALSE )
host_tree |
A |
nonhost_chron |
A |
duration_years |
The minimum length of time in which the tree is considered to be in defoliation. |
max_reduction |
The minimum value of |
bridge_events |
Binary, defaults to |
series_end_event |
Binary, defaults to |
list_output |
Defaults to |
By default this returns a long-form data frame of tree-level growth
suppression indices and identified defoliation events. If list_output = TRUE
, it returns a list object with each element containing a data.frame
rwl object of the host and non-host series, plus the outputs from gsi()
.
The list object is useful for assessing the effects of running gsi()
on
the host and nonhost data.
Other functions in dfoliatR
, like outbreak()
and plot_defol()
,
require a long-form data frame identifiable as a defol()
object. Selecting
list_output = TRUE
will trigger errors in running other functions.
# Load host and non-host data data("dmj_h") # Host trees data("dmj_nh") # Non-host chronology dmj_defol <- defoliate_trees(dmj_h, dmj_nh)
# Load host and non-host data data("dmj_h") # Host trees data("dmj_nh") # Non-host chronology dmj_defol <- defoliate_trees(dmj_h, dmj_nh)
Produced by running defoliate_trees(dmj_h, dmj_nh, series_end_events=TRUE)
dmj_defol
dmj_defol
A defol
object with 4267 rows and 5 columns
Western spruce budworm host series
dmj_h
dmj_h
An rwl
object with 17 tree-level series, standardized in ARSTAN.
Dates range from 1620-1997.
Non-host pair to Demi John Douglas-fir dmj_h
dmj_nh
dmj_nh
An rwl
object with 1 series, 1675-1997.
Produced by running outbreak(dmj_defol)
dmj_obr
dmj_obr
An object of class obr
(inherits from data.frame
) with 323 rows and 9 columns.
@format An outbreak
object with 323 rows and 9 columns
Produced by running defoliate_trees(efk_h, efk_nh, series_end_event = TRUE)
efk_defol
efk_defol
A defol
object with 5142 rows and 5 columns
Western spruce budworm host series
efk_h
efk_h
An rwl
object with 37 tree-level series, standardized in ARSTAN.
Dates range from 1776-1987.
Swetnam, T.W., Lynch, A.M., 1993. Multicentury, Regional-Scale Patterns of Western Spruce Budworm Outbreaks. Ecological Monographs 63, 399–424. https://doi.org/10.2307/2937153
Non-host pair chronology for East Fork Douglas-fir efk_h
efk_nh
efk_nh
An rwl
chronology object with 1 series, 1612-1987. Standardized in
ARSTAN.
https://www.ncei.noaa.gov/access/paleo-search/study/5068
Swetnam, T.W., Lynch, A.M., 1993. Multicentury, Regional-Scale Patterns of Western Spruce Budworm Outbreaks. Ecological Monographs 63, 399–424. https://doi.org/10.2307/2937153
Produced by running outbreak(efk_defol)
efk_obr
efk_obr
An outbreak
object with 221 rows and 9 columns
Defoliation event list
get_defol_events(x)
get_defol_events(x)
x |
a |
This function removes the nonhost growth signal from a host tree-ring series.
gsi(input_series)
gsi(input_series)
input_series |
A |
The growth suppression index (GSI) is referred to as the "corrected" series in OUTBREAK. It is calculated as:
where H and NH are the host and nonhost tree-ring series as standardized
index values; i is the year, and the functions mean()
and sd()
are
applied to the common period.
gsi()
will rarely be run directly by a user. It is called from
defoliate_trees()
.
A data frame with the two input columns (host and nonhost series) and 3 added columns:
The mean/sd adjusted non-host chronology,
The growth suppression index ("gsi") of the host series after subtraction of the adjusted nonhost chronology,
The normalized growth suppression
index ("ngsi") generated by applying scale()
to the gsi.
After calculating the growth suppression index in gsi()
, id_defoliation()
performs a runs analysis on the normalized growth suppression index, or
ngsi
, in which sequences of negative departures are assessed as possible
defoliation events. id_defoliation()
is the workhorse for
defoliate_trees()
, performing much of the necessary criteria evaluation
used in OUTBREAK. The defaults for most parameters originate from OUTBREAK.
Two new features distinguish the dfoliatR
version: bridging events that
occur in close sequence and allowing for the recent end of a series to be
evaluated for defoliation regardless of the event duration. See parameter
specifics for details.
id_defoliation( input_series, duration_years = 8, max_reduction = -1.28, bridge_events = FALSE, series_end_event = FALSE )
id_defoliation( input_series, duration_years = 8, max_reduction = -1.28, bridge_events = FALSE, series_end_event = FALSE )
input_series |
A data frame with 5 columns, as generated by |
duration_years |
The minimum length of time in which the tree is considered to be in defoliation. |
max_reduction |
The minimum value of |
bridge_events |
Binary, defaults to |
series_end_event |
Binary, defaults to |
After performing runs analyses, the function adds a column to the input data frame that distinguishes years of defoliation and the maximum defoliation year (ie. the year the greatest negative growth departure within the event).
id_defoliation()
is called by defoliate_trees()
. It might only be
used by the user for troubleshooting.
defol
Check if object is tree-level defoliation object: defol
is.defol(x)
is.defol(x)
x |
Any R object. |
Boolean indicating whether x
is a defol object.
Check if object is outbreak, meaning site-level outbreak object
is.obr(x)
is.obr(x)
x |
Any R object. |
Boolean indicating whether x
is an outbreak object.
obr
object.Constructor for an obr
object.
obr( year, samp_depth, num_defol, perc_defol, num_max_defol, perc_max_defol, mean_gsi, mean_ngsi, outbreak_status )
obr( year, samp_depth, num_defol, perc_defol, num_max_defol, perc_max_defol, mean_gsi, mean_ngsi, outbreak_status )
year |
An n-length numeric vector of observed years. |
samp_depth |
An n-length numeric vector of the number of trees. |
num_defol |
An n-length numeric vector of the number of trees experiencing defoliation. |
perc_defol |
An n-length numeric vector of the percent of trees experiencing defoliation. |
num_max_defol |
An n-length numeric vector of the number of trees experiencing their maximum level of defoliation (i.e., their most extreme negative growth departure). |
perc_max_defol |
An n-length numeric vector of the percent of trees experiencing their maximum level of defoliation (i.e., their most extreme negative growth departure). |
mean_gsi |
An n-length numeric vector of the average growth suppression index across all observed trees. |
mean_ngsi |
An n-length numeric vector of the average normalized (scaled) growth suppression index. |
outbreak_status |
An n-length factor or character vector that identified
whether that year surpasses the designated thresholds for an "outbreak
event". Threshold criteria are provided in |
An obr
object with columns matching the input variables.
outbreak()
takes a defol
object from
defoliate_trees()
and composites it into a site-level object.
Function parameters allow the user to filter the tree-level series in various
ways to optimize thresholds of what constitutes an "outbreak" level event
recorded by the host trees.
outbreak(x, filter_perc = 25, filter_min_series = 3, filter_min_defol = 1)
outbreak(x, filter_perc = 25, filter_min_series = 3, filter_min_defol = 1)
x |
a defol object |
filter_perc |
the minimum percentage of defoliated trees to be considered an outbreak. Default is 25 percent. |
filter_min_series |
The minimum number of trees required for an outbreak event. Default is 3 trees. |
filter_min_defol |
The minimum number of trees recording a defoliation event. Default is 1 tree. |
A data.frame obr
object for the site that includes all trees in the
host defol
object. Columns in the obr
include:
year
for every year in the set of host trees,
num_defol
the number of trees recording a defoliation event,
percent_defol
the percent of trees recording a defoliation,
num_max_defol
the number of trees recording a maximum growth suppression
(or peak of that event on that tree),
perc_max_defol
the percent of
trees at maximum defoliation,
mean_gsi
the average of all trees
growth suppression index (gsi
),
mean_ngsi
the average of all
trees normalized growth suppression index (ngsi
),
outbreak_status
whether that year constitutes an outbreak based on the filters applied to
the function.
data("dmj_defol") head(outbreak(dmj_defol))
data("dmj_defol") head(outbreak(dmj_defol))
Summary statistics for inferred outbreaks
outbreak_stats(x)
outbreak_stats(x)
x |
An obr object after running |
A data frame with descriptive statistics for each outbreak event
determined by outbreak()
, including:
"start" – first year of outbreak
"end" – last year of outbreak
"duration" – length of outbreak (in years)
"n_df_start" – number of trees defoliated at the start
"perc_df_start" – percent of trees defoliated at the start
"max_df_obr" – maximum number of trees in the outbreak during a single year
"yr_max_df" – year with the maximum number of trees defoliated
"yr_min_ngsi" – year with the lowest mean normalized growth suppression index (NGSI)
"min_gsi" – minimum growth suppression index
"min_ngsi" – minimum normalized gsi
Certain statistics will be set to NA
for the final
outbreak event if there was an ongoing defoliation event (in which
series_end_event = TRUE
in defoliate_trees()
). This is because the end
of the outbreak remains unknown, so statistics such as duration cannot be
calculated. Statistics pertaining to the start of the event are provided.
data("dmj_obr") outbreak_stats(dmj_obr)
data("dmj_obr") outbreak_stats(dmj_obr)
Produce a Gantt plot of individual tree-ring series to show defoliation events in time
plot_defol(x, breaks)
plot_defol(x, breaks)
x |
a |
breaks |
a vector length two providing threshold (negative) |
data("dmj_defol") plot_defol(dmj_defol) ## Change the values severity classes plot_defol(dmj_defol, breaks = c(-1.0, -0.5))
data("dmj_defol") plot_defol(dmj_defol) ## Change the values severity classes plot_defol(dmj_defol, breaks = c(-1.0, -0.5))
Produce a stacked plot to present composited, site-level insect outbreak chronologies
plot_outbreak(x, disp_index = c("GSI", "NGSI"), label_defol = "% defoliated")
plot_outbreak(x, disp_index = c("GSI", "NGSI"), label_defol = "% defoliated")
x |
an 'obr' object produced by |
disp_index |
Identify the timeseries index to plot. Defaults to |
label_defol |
Allows users to change the bottom tile of the printed ouput to read what they'd like. Defaults to "% defoliated" |
data(dmj_obr) plot_outbreak(dmj_obr) # Change middle panel display from the default "NGSI" to "GSI" plot_outbreak(dmj_obr, disp_index = "GSI")
data(dmj_obr) plot_outbreak(dmj_obr) # Change middle panel display from the default "NGSI" to "GSI" plot_outbreak(dmj_obr, disp_index = "GSI")
defol
objectPlot a defol
object
## S3 method for class 'defol' plot(...)
## S3 method for class 'defol' plot(...)
... |
arguments passed to |
Calculate the sample depth of a defol object
sample_depth(x)
sample_depth(x)
x |
A |
A data.frame containing the years and number of trees
data("dmj_defol") head(sample_depth(dmj_defol))
data("dmj_defol") head(sample_depth(dmj_defol))
Extract series names from a defol object
series_names(x)
series_names(x)
x |
a defol object |
Stack a defoliation list
stack_defoliation(x)
stack_defoliation(x)
x |
a list object created by |
a defol object (long-format data frame)