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.

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

Examples

# 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)
#>  [1] "GRP_ACKNOWLEDGEMENT"     "GRP_CLIM_AVG"           
#>  [3] "GRP_COUNTRY"             "GRP_DOI"                
#>  [5] "GRP_DOI_CONTRIBUTOR"     "GRP_DOI_ORGANIZATION"   
#>  [7] "GRP_DOM_DIST_MGMT"       "GRP_FLUX_MEASUREMENTS"  
#>  [9] "GRP_HEADER"              "GRP_HEIGHTC"            
#> [11] "GRP_IGBP"                "GRP_LAND_OWNERSHIP"     
#> [13] "GRP_LOCATION"            "GRP_NETWORK"            
#> [15] "GRP_REFERENCE_PAPER"     "GRP_SHIPPING_ADDRESS"   
#> [17] "GRP_SITE_CHAR"           "GRP_SITE_DESC"          
#> [19] "GRP_SITE_FUNDING"        "GRP_STATE"              
#> [21] "GRP_TEAM_MEMBER"         "GRP_TOWER_POWER"        
#> [23] "GRP_TOWER_TYPE"          "GRP_URL"                
#> [25] "GRP_URL_AMERIFLUX"       "GRP_UTC_OFFSET"         
#> [27] "GRP_AG_BIOMASS_OTHER"    "GRP_LAI"                
#> [29] "GRP_NEP"                 "GRP_RESEARCH_TOPIC"     
#> [31] "GRP_SA"                  "GRP_SOIL_CHEM"          
#> [33] "GRP_SOIL_CLASSIFICATION" "GRP_SPP_O"              

# extract the selected VARIALBE_GROUP
amf_extract_badm(bif_data = bif, select_group = "GRP_FLUX_MEASUREMENTS")
#>    GROUP_ID SITE_ID FLUX_MEASUREMENTS_METHOD FLUX_MEASUREMENTS_VARIABLE
#> 5     12767  US-CRT          Eddy Covariance                        CO2
#> 6     12782  US-CRT          Eddy Covariance                        H2O
#> 7     12786  US-CRT          Eddy Covariance                          H
#> 8     12787  US-CRT          Eddy Covariance                        CH4
#> 9     12791  US-Oho          Eddy Covariance                        CO2
#> 10    12806  US-Oho          Eddy Covariance                        H2O
#> 11    12812  US-Oho          Eddy Covariance                          H
#> 1     12741  US-WPT          Eddy Covariance                        CO2
#> 2     12756  US-WPT          Eddy Covariance                        H2O
#> 3     12761  US-WPT          Eddy Covariance                          H
#> 4     12762  US-WPT          Eddy Covariance                        CH4
#>    FLUX_MEASUREMENTS_DATE_START FLUX_MEASUREMENTS_DATE_END
#> 5                      20110101                   20131231
#> 6                      20110101                   20131231
#> 7                      20110101                   20131231
#> 8                      20110511                   20120520
#> 9                          2004                       2013
#> 10                         2004                       2013
#> 11                         2004                       2013
#> 1                      20110101                   20131231
#> 2                      20110101                   20131231
#> 3                      20110101                   20131231
#> 4                      20110311                   20131231
#>    FLUX_MEASUREMENTS_OPERATIONS
#> 5          Continuous operation
#> 6          Continuous operation
#> 7          Continuous operation
#> 8          Continuous operation
#> 9          Continuous operation
#> 10         Continuous operation
#> 11         Continuous operation
#> 1          Continuous operation
#> 2          Continuous operation
#> 3          Continuous operation
#> 4          Continuous operation
amf_extract_badm(bif_data = bif, select_group = "GRP_IGBP")
#>   GROUP_ID SITE_ID IGBP
#> 2    12768  US-CRT  CRO
#> 3    12792  US-Oho  DBF
#> 1    12742  US-WPT  WET