check.data: Check consistency for potato and sweetpotato experimental...

View source: R/check_data.R

check.dataR Documentation

Check consistency for potato and sweetpotato experimental data

Description

Set of rules to check for consistency of potato and sweetpotato experimental data.

Usage

check.data(
  dfr,
  f = 5,
  out.mod = c("none", "rcbd", "met"),
  out.max = 4,
  add = NULL,
  print.text = TRUE,
  crop = c("auto", "pt", "sp")
)

Arguments

dfr

The name of the data frame.

f

Factor for extreme values detection. See details.

out.mod

Statistical model for outliers' detection. See details.

out.max

Threshold for outliers' detection.

add

Additional quantitative variables.

print.text

Logical, if TRUE the output is printed on screen.

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

Extreme low and high values are detected using the interquartile range. The rule is to detect any value out of the interval [Q_1 - f \times IQR; Q_3 + f \times IQR]. By default f = 5. If f = 0, the detection of extreme values is not executed.

Outliers are detected based on standardized residuals for some statistical models. Options are "rcbd" and "met" for a randomized complete block design and a multienvironment trial with RCBD in each environment. By default the threshold value is out.max = 4.

Value

It returns:

  • $Inconsist.List, a data.frame with a list of all the rows with some kind of inconsistency.

  • $Inconsist.Matrix, a data.frame with the positions in the fieldbook data frame where inconsistencies occur. These are coded with: (1) for inconsistencies among variables, (2) for out of range values, (3) for extreme values or outliers.

Author(s)

Raul Eyzaguirre.

Examples

check.data(potatoyield)
check.data(pjpz09)

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