amf_read_base: Read AmeriFlux BASE data product

Description Usage Arguments Value See Also Examples

View source: R/amf_read_base.R

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

1
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

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
# 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)

amerifluxr documentation built on Feb. 8, 2022, 5:16 p.m.