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 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


# 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)



[Package sapfluxnetr version 0.1.4 Index]