metrics_tidyfier {sapfluxnetr} | R Documentation |
Build a tidy data frame from the metrics results nested list
Description
Transform the nested list of metrics in a tidy tibble where each observation has its own row
Usage
metrics_tidyfier(
metrics_res,
metadata,
interval = c("general", "predawn", "midday", "night", "daylight")
)
Arguments
metrics_res |
Nested list containing the metrics results as obtained
from |
metadata |
List containing the metadata nested list, as obtained from
|
interval |
Interval to return, it depends on the |
Value
a tibble with the following columns:
TIMESTAMP: POSIXct vector with the date-time of the observation
si_code: Character vector with the site codes
pl_code: Character vector with the plant codes
sapflow_*: Variables containing the different metrics for the sapflow measurements (i.e. sapflow_mean, sapflow_q_95)
ta_*; rh_*; vpd_*; ...: Variables containing the different metrics for environmental variables (i.e. ta_mean, ta_q_95)
pl_*: plant metadata variables (i.e. pl_sapw_area, pl_sens_meth)
si_*: site metadata variables (i.e. si_biome, si_contact_firstname)
st_*: stand metadata variables (i.e. st_aspect, st_lai)
sp_*: species metadata variables (i.e. sp_basal_area_perc)
env_*: environmental metadata variables (i.e. env_timezone)
Examples
# data
multi_sfn <- sfn_data_multi(ARG_TRE, ARG_MAZ, AUS_CAN_ST2_MIX)
data('sfn_metadata_ex', package = 'sapfluxnetr')
# metrics
multi_metrics <- daily_metrics(multi_sfn)
# tidyfing
multi_tidy <- metrics_tidyfier(
multi_metrics, sfn_metadata_ex, interval = 'general'
)
multi_tidy
# A really easier way of doing the same
multi_tidy_easy <- daily_metrics(multi_sfn, tidy = TRUE, metadata = sfn_metadata_ex)