inspect: Check for common errors in multi-environment trial data

Description Usage Arguments Value Author(s) Examples

Description

[Stable]

inspect() scans a data.frame object for errors that may affect the use of functions in metan. By default, all variables are checked regarding the class (numeric or factor), missing values, and presence of possible outliers. The function will return a warning if the data looks like unbalanced, has missing values or possible outliers.

Usage

1
inspect(.data, ..., plot = FALSE, threshold = 15, verbose = TRUE)

Arguments

.data

The data to be analyzed

...

The variables in .data to check. If no variable is informed, all the variables in .data are used.

plot

Create a plot to show the check? Defaults to FALSE.

threshold

Maximum number of levels allowed in a character / factor column to produce a plot. Defaults to 15.

verbose

Logical argument. If TRUE (default) then the results for checks are shown in the console.

Value

A tibble with the following variables:

Author(s)

Tiago Olivoto tiagoolivoto@gmail.com

Examples

1
2
3
4
5
6
7
8
9
library(metan)
inspect(data_ge)

# Create a toy example with messy data
df <- data_ge2[-c(2, 30, 45, 134), c(1:5)]
df[c(1, 20, 50), c(4, 5)] <- NA
df[40, 5] <- df[40, 5] * 2

inspect(df, plot = TRUE)

metan documentation built on Nov. 10, 2021, 9:11 a.m.