load_measured_data {growR} | R Documentation |
Load experimental data
Description
Load all datasets stored in the supplied files.
Upon loading, the cumulative biomass growth cBM is automatically calculated from the given daily biomass growth dBM values.
Usage
load_measured_data(filenames, sep = ",")
load_data_for_sites(sites)
load_matching_data(filenames)
Arguments
filenames |
Vector of strings representing simulation output filenames for which matching data files are searched and loaded. |
sep |
String Field separator used in the datafiles. |
sites |
Vector of site names for which data to load. |
Details
load_matching_data()
internally uses get_site_name()
and makes the same
assumptions about the output filename formats. It further assumes measured
data to be located in "data/" and adhere to the filename format x.csv
with x
being the site name.
Value
measured_data list of data.frame each corresponding to one of the sites detected in filenames. Each data.frame contains the keys
-
dBM
: average daily biomass growth since last observation in kg/ha. -
cBM
: cumulative biomass growth up to this DOY in kg/ha. -
year
: year of observation. -
DOY
: day of year of observation.
Functions
-
load_data_for_sites()
: Data filenames are generated on the convention 'SITE.csv' and are searched for in the subdirectory 'getOption("growR.data_dir")', which defaults to 'data/'. -
load_matching_data()
: Accepts a vector of output filenames as generated by ModvegeSite$write_output()
out of which the site names are inferred.
Data file format
The input data files are expected to consist of four columns containing the following fileds, in order:
- date
Date of measurement in yyyy-mm-dd format.
- year
Year of measurement. Identical to yyyy in date field.
- DOY
Day of year of the measurement. Jan 1st corresponds to 1, Dec 31st corresponds to 365 (except in gap years).
- dBM
Observed average daily biomass growth since last cut in kg/ha.
The first row is expected to be a header row containing the exact field names as in the description above. Columns may be separated by an arbitrary character, specified by the sep argument. The example data uses a comma (",").