| inspect | R Documentation |
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.
inspect(.data, ..., plot = FALSE, threshold = 15, verbose = TRUE)
.data |
The data to be analyzed |
... |
The variables in |
plot |
Create a plot to show the check? Defaults to |
threshold |
Maximum number of levels allowed in a character / factor column to produce a plot. Defaults to 15. |
verbose |
Logical argument. If |
A tibble with the following variables:
Variable The name of variable
Class The class of the variable
Missing Contains missing values?
Levels The number of levels of a factor variable
Valid_n Number of valid n (omit NAs)
Outlier Contains possible outliers?
Tiago Olivoto tiagoolivoto@gmail.com
library(metan)
inspect(data_ge)
# Create a toy example with messy data
df <- data_ge2[-c(2, 30, 45, 134), c(1:5)] %>% as.data.frame()
df[c(1, 20, 50), 5] <- NA
df[40, 4] <- "2..814"
inspect(df)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.