amf_read_base {amerifluxr}R Documentation

Read AmeriFlux BASE data product

Description

This function read in the BASE data file downloaded from AmeriFlux. See AmeriFlux web page https://ameriflux.lbl.gov/data/data-processing-pipelines/base-publish/ for details about BASE data product. Use amf_variables to get a list of standard variable names and units.

Usage

amf_read_base(file, unzip = TRUE, parse_timestamp = FALSE)

Arguments

file

A BASE data file, either in a zipped file or a comma-separate value (csv) file

unzip

Logical, whether to unzip. The default is TRUE. Set FALSE if reading from a previously unzipped csv file.

parse_timestamp

Logical, whether to parse the time stamp. Set TRUE to parse and add timekeeping columns.

Value

A data frame containing data. See AmeriFlux website https://ameriflux.lbl.gov/data/aboutdata/data-variables/ for details about file format, variable definition, units, and convention. If parse_timestamp = TRUE, the following six time-keeping columns are added in the returned data frame:

See Also

amf_parse_basename, amf_filter_base

Examples

# read the BASE from a zip file, using the example data file
base <- amf_read_base(file = system.file("extdata",
                                         "AMF_US-CRT_BASE-BADM_2-5.zip",
                                          package = "amerifluxr"),
                      unzip = TRUE,
                      parse_timestamp = TRUE)

# read the BASE from a csv file
base <- amf_read_base(file = system.file("extdata",
                                         "AMF_US-CRT_BASE_HH_2-5.csv",
                                          package = "amerifluxr"),
                      unzip = FALSE,
                      parse_timestamp = FALSE)

[Package amerifluxr version 1.0.0 Index]