Learn R Programming

amerifluxr (version 1.0.0)

amf_extract_badm: Extract BADM data of a specific BADM group

Description

This function extracts BADM data of a specific BADM group from the imported BADM (BIF) file. Use function amf_read_bif to import BADM (BIF) file.

Usage

amf_extract_badm(bif_data, select_group)

Arguments

bif_data

A data frame consists of 5 columns: SITE_ID, GROUP_ID, VARIABLE_GROUP, VARIABLE, DATAVALUE, imported from function amf_read_bif.

select_group

A string (character), selected from VARIABLE_GROUP in the bif_data

Value

A data frame of re-structured BADM data with the following columns:

  • GROUP_ID - A unique identifier for data belonging to the same instance of a reported variable group

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

  • VALUE - Values for all available VARIABLES in the selected group

  • ...

See Also

amf_read_bif

Examples

Run this code
# NOT RUN {
# read the BADM BIF file, using an example data file
bif <- amf_read_bif(file = system.file("extdata",
                                       "AMF_AA-Flx_BIF_CCBY4_20201218.xlsx",
                                        package = "amerifluxr"))

# get a list of valid VARIALBE_GROUP
unique(bif$VARIABLE_GROUP)

# extract the selected VARIALBE_GROUP
amf_extract_badm(bif_data = bif, select_group = "GRP_FLUX_MEASUREMENTS")
amf_extract_badm(bif_data = bif, select_group = "GRP_IGBP")
# }

Run the code above in your browser using DataLab