data_preparation: ForestGEO-like data preparation.

Description Usage Arguments Value Examples

Description

Main routine to format, detect major obvious errors, and gap-fill those errors in ForestGEO-like data.

Usage

1
2
3
4
5
data_preparation(path, stem, site, dbh_units = "mm", WD = NULL,
  taper_correction = TRUE, fill_missing = TRUE,
  use_palm_allometry = TRUE, flag_stranglers = TRUE,
  dbh_stranglers = 500, maxrel = 0.2, write_errors_to = NULL,
  graph_problems_to = NULL, exclude_interval = NULL)

Arguments

path

String giving a path to a parent directory containing species and census datasets.

stem

TRUE(default) or FALSE reflect that your censuses are ForestGEO stem or tree (aka full) tables, respectively.

site

String giving the name of your site – one of one of site.info$site (e.g., 'barro colorado island'.

dbh_units

set the unit ("mm" or "cm") of DBH values, by default dbh_units=="mm".

WD

Optional, provide an external data.frame of wood densities by species.

taper_correction

TRUE or FALSE, apply Cushman et al (2014) taper correction.

fill_missing

TRUE or FALSE, interpolate missing DBH values.

use_palm_allometry

TRUE or FALSE, if TRUE, compute biomass of palm trees using a palm-specific allometric model from Goodman et al. (2013).

flag_stranglers

TRUE or FALSE, individuals of known strangler fig species greater than 'dbh_stranglers' are flagged

dbh_stranglers

(optional) Minimal diameter (in mm) of strangler figs, default = 500.

maxrel

A numeric value: the threshold for flagging major errors in productivity, applied as absval(individual-tree-productivity) > maxrel * (average-productivity-per-hectare).

write_errors_to

A string giving a directory with the format "path/to/file" (without extension) to output all records for trees with major errors in productivity to a csv file. Defaults to not write such a file.

graph_problems_to

A string giving a directory with the format "path/to/file" (without extension) to output graphs showing problematic trees. The output may be multiple files, for example: path/to/file_1.pdf,path/to/file_2.pdf, path/to/file_3.pdf, and so on. Defaults to not write such files.

exclude_interval

NULL by default. If needed a vector (e.g. c(1,2)) indicating which census interval(s) must be discarded from computation due, for instance, to a change in measurement protocol.

Value

A data.table (data.frame) with all relevant variables.

Examples

1
2
3
4
5
data_preparation(
  path = agb_example("data"),
  site = "barro colorado island",
  stem = TRUE
)

ervanSTRI/AGBflux_pack documentation built on Oct. 15, 2021, 6:44 p.m.