cdt: Compute derived variables for potato and sweetpotato

View source: R/cdt.R

cdtR Documentation

Compute derived variables for potato and sweetpotato

Description

Compute derived variables for a given fieldbook data frame.

Usage

cdt(
  dfr,
  method = c("none", "ps", "np"),
  value = NULL,
  crop = c("auto", "pt", "sp")
)

Arguments

dfr

The name of the data frame.

method

Method to scale data from plot to hectare level. Options are plot size "ps" and number of plants for a full hectare "np". See details.

value

Value for the method selected in square meters if method = "ps" and in number of plants per hectare if method = "np". For data frames with plots with different values, value must be the name of the column in the data frame with the corresponding values for each plot.

crop

"auto" for autodetection or "pt" for potato and "sp" for sweetpotato.

Details

The data frame must use the labels (lower or upper case) listed in functions ptont() and spont(). Conversion from kilograms per plot to tons per hectare can be done using ps, the plot size, or np, the total number of plants that can be allocated in a full hectare. In both cases computations can be adjusted by the number of harvested plants if available in the fieldbook. For method = "np", number of plants sowed must be specified to compute non adjusted values.

Value

It returns a data frame with the original and derived variables.

Author(s)

Raul Eyzaguirre.

Examples

cdt(potatoyield)
cdt(pjpz09)

reyzaguirre/st4gi documentation built on March 29, 2025, 10:38 p.m.