This function visualizes the BASE data summary for selected AmeriFlux sites and variables. This is a wrapper around amf_summarize_data. However, it is strongly advised to subset either sites or variables for faster processing and better visualization.

amf_plot_datasummary(
  data_sum = NULL,
  site_set = NULL,
  var_set = NULL,
  nonfilled_only = TRUE,
  show_cluster = FALSE,
  scale = FALSE
)

Arguments

data_sum

A data frame with following columns:

  • Site_ID - Six character site identifier (CC-Sss)

  • VARIABLE - Variable name of the data included in the BASE file

  • BASENAME - Variable base name of the data included in the BASE file.

  • GAP_FILLED - Whether a variable is a gap-filled variable (TRUE/FALSE)

  • Any statistics, e.g., P01, P05... output from amf_summarize_data

If not specified, use amf_summarize_data by default.

site_set

A scalar or vector of character specifying the target AmeriFlux Site ID (CC-Sss). If not specified, it returns all sites.

var_set

A scalar or vector of character specifying the target variables as in basename. See AmeriFlux pagehttps://ameriflux.lbl.gov/data/aboutdata/data-variables/#base for a list of variable names. If not specified, it returns all variables.

nonfilled_only

Logical, whether only showing non-filled variables, or both non- and gap-filled variables. The default is TRUE.

show_cluster

Logical, whether showing clustering (dendrogram) of site-variables. The default is FALSE.

scale

Logical, whether the values should be centered and scaled among site-variables. The default is FALSE.

Value

An object of class 'plotly' from heatmaply

Examples

if (FALSE) {
# plot data summary for selected variables at two sites
amf_plot_datasummary(site_set = c("US-CRT", "US-WPT"),
                     var_set = c("H", "LE", "NETRAD"))

# plot data summary for FCH4 at all sites, and show
#  clustering among sites
amf_plot_datasummary(var_set = "FCH4",
                     show_cluster = TRUE)

# plot data summary for TA at all grassland sites,
#  and show clustering among sites
sites <- amf_site_info()
sites <- subset(sites, IGBP == "CRO")
amf_plot_datasummary(site_set = sites$SITE_ID,
                     var_set = "TA",
                     show_cluster = TRUE)

# normalize TA among sites
amf_plot_datasummary(site_set = sites$SITE_ID,
                     var_set = "TA",
                     show_cluster = TRUE,
                     scale = TRUE)
}