metrics_tidyfier: Build a tidy data frame from the metrics results nested list

Description Usage Arguments Value Examples

Description

Transform the nested list of metrics in a tidy tibble where each observation has its own row

Usage

1
2
3
4
5
metrics_tidyfier(
  metrics_res,
  metadata,
  interval = c("general", "predawn", "midday", "night", "daylight")
)

Arguments

metrics_res

Nested list containing the metrics results as obtained from metrics

metadata

List containing the metadata nested list, as obtained from read_sfn_metadata

interval

Interval to return, it depends on the metrics_res and can be "gen" for the general metrics, "md" for midday metrics, "pd" for predawn metrics, "night" for night metrics or "day" for diurnal metrics.

Value

a tibble with the following columns:

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
# 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)

sapfluxnetr documentation built on Aug. 28, 2020, 1:13 a.m.