In order to run a successful experiment a good design is needed even before measuring the data. This functions checks several heuristics for a good experiment and warns if they are not found.
Arguments
- pheno
Data.frame with the variables of each sample, one row one sample.
- omit
Character vector with the names of the columns to omit.
- na.omit
Check the effects of missing values too.
Examples
rdata <- expand.grid(sex = c("M", "F"), class = c("lower", "median", "high"))
rdata2 <- rbind(rdata, rdata)
check_data(rdata2)
#> [1] TRUE
# \donttest{
#Different warnings
check_data(rdata)
#> Warning: There is a combination of categories with no replicates; i.e. just one sample.
#> [1] FALSE
check_data(rdata[-c(1, 3), ])
#> Warning: Two categorical variables don't have all combinations.
#> Warning: There is a category with just one sample.
#> Warning: There is a combination of categories with no replicates; i.e. just one sample.
#> [1] FALSE
data(survey, package = "MASS")
check_data(survey)
#> Warning: Two categorical variables don't have all combinations.
#> Warning: Some values are missing.
#> Warning: There is a combination of categories with no replicates; i.e. just one sample.
#> [1] FALSE
# }