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

data_preparation(site, stem, WD = NULL, taper_correction, fill_missing,
  use_palm_allometry, flag_strangler, dbh_stranglers, maxrel,
  output_errors, DATA_path = NULL, exclude_interval = NULL)

Arguments

site

The full name of your site (in lower case); e.g., 'barro colorado island'.

stem

TRUE or FALSE, using the stem data (stem = TRUE) rather than the tree data (i.e. called 'full', stem = FALSE).

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).

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).

output_errors

TRUE or FALSE, output all records for trees with major errors in productivity to a csv file.

DATA_path

The pathname where the data are located.

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.

flag_stranglers

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

Value

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

Examples

# NOT RUN {
data_preparation(
  site = "barro colorado island",
  stem = TRUE,
  taper_correction = TRUE,
  fill_missing = TRUE,
  use_palm_allometry = TRUE,
  flag_strangler = TRUE,
  dbh_stranglers = 500,
  maxrel = 0.2,
  output_errors = TRUE,
  DATA_path = NULL,
  exclude_interval = NULL
)
# }