check_vars: Performs sanity checks on soil variables

Description Usage Arguments Details Value Examples

View source: R/checks.R

Description

The computation of nutrient fertilization plans requires a few atmospheric, crop, and soil variables to be shared among all soil analyses. Each nutrient fertilization plan requires specific variables, the functions checks whether these features have been filled in the appropriate variable list, for each specific nutrient.

Usage

1
check_vars(vars = NULL, nutrient)

Arguments

vars

A list where atmospheric, crop, and soil variables needed are given, or NULL

nutrient

One of "nitrogen", "phosphorus", "potassium"

Details

The data object are passed to appropriate fertplan functions by demand_nutrient(), further information on variables, and their unit of measure can be found in help pages and vignettes of the fertplan package. Variable list templates for variables:

Template for nitrogen nutrient list:

Template for phosphorus nutrient list:

Template for potassium nutrient list:

Note that the appropriate classes of the variables needed for each specific nutrient may be looked up by passing NULL as vars argument, like in check_vars(NULL, "potassium").

Value

A data.table subset of the vars list featuring only the specific variables for the nutrient given or, if vars is NULL a character vector of classes of the relevant variables for each specific nutrient.

Examples

1
check_vars(NULL, "potassium")

mbask/fertplan documentation built on July 3, 2020, 12:01 p.m.