This function builds a dendrochronological dplR rwl object (a data
frame with years as row names and series IDs as column names) from
annually resolved QWA data, ready for scaling (see scale_for_tucson())
and writing to .rwl with dplR::write.tucson(). Depending on the selected
parameter, the function either uses ring-level measurements (e.g. mean
ring width, mrw) or profile-level measurements at a given sector
(aggregated cell parameters such as the 90th percentile lumen area,
la_q90).
Duplicate rings (exclude_dupl) and rings flagged for exclusion
(exclude_issues) are filtered out before constructing the final time
series; NA flags count as FALSE. These flag columns are read from df_rings, making it a required
parameter, while prf_data (with the selected sector) is only required
to extract a param from the profile data. With tissue = "affected",
rings with exclude_issues and affected_tissue "ew" or "lw" are
kept, using the values of the unaffected tissue from prf_data.
Series are grouped by woodpiece (each core/sample yields one series);
thus the woodpiece_labels become the column names.
Usage
extract_rwl(
df_rings,
param,
prf_data = NULL,
sector = NULL,
tissue = c("all", "affected")
)Arguments
- df_rings
A data frame containing ROXAS ring-level measurements and logical flag columns (the
$ringscomponent of aQWAdataobject, after callingcomplete_QWAdata()to instantiate the flag columns).- param
Character string specifying the parameter to export: either a measurement column in
df_rings, or an aggregated cell measurement inprf_data(e.g."la_mean","la_q90").- prf_data
A data frame containing ROXAS profile-level measurements (aggregated cell parameters via
calculate_sector_profiles()). Only required whenparamis not adf_ringscolumn.- sector
Integer specifying which sector to use when exporting a
prf_dataparameter. Required in that case, otherwise ignored.- tissue
"all"(default) removes all rings withexclude_issues;"affected"keeps those withaffected_tissue"ew"or"lw". Only forprf_dataparameters, and requiresprf_datacomputed withapply_exclusions = TRUE, tissue = "affected"(seecalculate_sector_profiles()); otherwise the affected tissue is included.