| dm_standardize | R Documentation |
Standardizes one or more dendrometer series within seasonal years so that multiple trees can be brought to a comparable scale while preserving their within-season temporal pattern.
Seasonal years are defined as:
"NH": Northern Hemisphere year, from 01 Jan to 31 Dec
"SH": Southern Hemisphere year, from 01 Jul to 30 Jun of the next year
"CS": Custom season defined by CS_doys = c(doy1, doy2)
For season_type = "CS":
if CS_doys[1] <= CS_doys[2], the season stays within one calendar year
if CS_doys[1] > CS_doys[2], the season wraps across years
Standardization is applied separately for each dendrometer series and each seasonal year.
dm_standardize(
df,
season_type = c("NH", "SH", "CS"),
CS_doys = NULL,
method = c("center", "amplitude", "robust_amplitude", "minmax", "zscore",
"robust_zscore", "percentile"),
ref_type = c("first_value", "first_n_days", "ref_window"),
ref_n_days = 7,
ref_doys = NULL,
q_low = 0.05,
q_high = 0.95
)
df |
A data frame whose first column contains date-time
( |
season_type |
One of |
CS_doys |
Optional numeric vector of length 2 defining the start and end
DOY for |
method |
Standardization method. One of:
|
ref_type |
Reference-value definition for methods that need a reference
(
|
ref_n_days |
Number of initial days used when |
ref_doys |
Optional numeric vector of length 2 defining a DOY reference
window when |
q_low |
Lower quantile used by |
q_high |
Upper quantile used by |
A list of class "dm_standardized" containing:
data: wide data frame with columns
TIME, season_year, in_season, and standardized dendrometer series
parameters: tibble with one row per tree and seasonal year,
summarizing the reference value and scaling denominator used
metadata: method and seasonal-year settings
For season_type = "CS", observations outside the custom season are
retained in data, but their standardized values are set to NA
and in_season = FALSE.
data(gf_nepa17)
# Northern Hemisphere seasonal-year standardization
out_nh <- dm_standardize(
df = gf_nepa17,
season_type = "NH",
method = "robust_amplitude"
)
# Southern Hemisphere seasonal-year standardization
out_sh <- dm_standardize(
df = gf_nepa17,
season_type = "SH",
method = "center"
)
# Custom season within one year
out_cs1 <- dm_standardize(
df = gf_nepa17,
season_type = "CS",
CS_doys = c(100, 280),
method = "robust_amplitude"
)
# Custom season wrapping across years
out_cs2 <- dm_standardize(
df = gf_nepa17,
season_type = "CS",
CS_doys = c(250, 120),
method = "percentile"
)
head(out_nh$data)
head(out_nh$parameters)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.