Skip to contents

Given the index and the data of the samples append the batch assignment

Usage

inspect(i, pheno, omit = NULL, index_name = "batch")

Arguments

i

List of indices of samples per batch

pheno

Data.frame with the sample information.

omit

Name of the columns of the pheno that will be omitted.

index_name

Column name of the index of the resulting data.frame.

Value

The data.frame with a new column batch with the name of the batch the sample goes to.

Examples

data(survey, package = "MASS")
columns <- c("Sex", "Age", "Smoke")
index <- design(pheno = survey[, columns], size_subset = 70,
                iterations = 10)
#> Warning: There might be some problems with the data use check_data().
batches <- inspect(index, survey[, columns])
head(batches)
#>      Sex    Age Smoke   batch
#> 1 Female 18.250 Never SubSet3
#> 2   Male 17.583 Regul SubSet4
#> 3   Male 16.917 Occas SubSet3
#> 4   Male 20.333 Never SubSet4
#> 5   Male 23.667 Never SubSet3
#> 6 Female 21.000 Never SubSet4