check.numeric: Check fieldbook variables are numeric

View source: R/check_numeric.R

check.numericR Documentation

Check fieldbook variables are numeric

Description

Check that fieldbook variables are stored as numeric.

Usage

check.numeric(
  dfr,
  crop = c("auto", "pt", "sp", "uk"),
  add = NULL,
  checknames = FALSE
)

Arguments

dfr

The name of the data frame.

crop

"auto" for autodetection or "pt" for potato, "sp" for sweetpotato and "uk" for unknown.

add

Additional quantitative variables.

checknames

Logical indicating if column names should be checked, default FALSE.

Details

It checks that all variables recognized by check.names are stored as numeric. Non-numeric columns are transformed to numeric and the NAs values introduced by coercion are listed.

Value

It returns the data frame with all non-numeric variables transformed to numeric, and a list of all NAs values introduced by coercion.

Author(s)

Raul Eyzaguirre.

Examples

tmp <- check.names(potatoyield)
tmp <- check.numeric(tmp)
tmp <- check.names(pjpz09)
tmp <- check.numeric(tmp)

reyzaguirre/st4gi documentation built on July 5, 2025, 6:38 a.m.