Skip to contents

Design experiment with all the data new and old together.

Usage

follow_up2(all_data, batch_column = "batch", ...)

Arguments

all_data

A data.frame with all the data about the samples. Each row is a sample.

batch_column

The name of the column of all_data with the batches used. If NA it is interpreted as a new data, if not empty it is considered a batch.

...

Arguments passed on to design

size_subset

Numeric value of the number of sample per batch.

omit

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

iterations

Numeric value of iterations that will be performed.

name

A character used to name the subsets, either a single one or a vector the same size as n.

Value

A data.frame with the batch_column filled with the new batches needed.

Details

If the batch_column is empty the samples are considered new. If the size_subset is missing, it will be estimated from the previous batch Similarly, iterations and name will be guessed or inferred from the samples.

See also

Examples

data(survey, package = "MASS")
# Create the first batch
first_batch_n <- 118
variables <- c("Sex", "Smoke", "Age")
survey1 <- survey[seq_len(first_batch_n), variables]
index1 <- design(survey1, size_subset = 50, iterations = 10)
#> Warning: There might be some problems with the data use check_data().
r_survey <- inspect(index1, survey1)
# Create the second batch with "new" students
survey2 <- survey[seq(from = first_batch_n +1, to = nrow(survey)), variables]
survey2$batch <- NA
# Prepare the follow up
all_classroom <- rbind(r_survey, survey2)
follow_up2(all_classroom, size_subset = 50, iterations = 10)
#> Warning: There are some problems with the data.
#> Warning: There are some problems with the new samples and the batches.
#> Warning: There are some problems with the new data.
#> Warning: There are some problems with the old data.
#>   [1] "SubSet3"    "SubSet3"    "SubSet2"    "SubSet2"    "SubSet1"   
#>   [6] "SubSet1"    "SubSet1"    "SubSet3"    "SubSet1"    "SubSet1"   
#>  [11] "SubSet2"    "SubSet3"    "SubSet1"    "SubSet1"    "SubSet1"   
#>  [16] "SubSet3"    "SubSet3"    "SubSet2"    "SubSet1"    "SubSet3"   
#>  [21] "SubSet1"    "SubSet1"    "SubSet1"    "SubSet3"    "SubSet1"   
#>  [26] "SubSet1"    "SubSet1"    "SubSet2"    "SubSet2"    "SubSet3"   
#>  [31] "SubSet2"    "SubSet2"    "SubSet1"    "SubSet2"    "SubSet2"   
#>  [36] "SubSet3"    "SubSet3"    "SubSet1"    "SubSet3"    "SubSet3"   
#>  [41] "SubSet1"    "SubSet2"    "SubSet3"    "SubSet1"    "SubSet3"   
#>  [46] "SubSet2"    "SubSet3"    "SubSet3"    "SubSet2"    "SubSet1"   
#>  [51] "SubSet2"    "SubSet2"    "SubSet1"    "SubSet3"    "SubSet2"   
#>  [56] "SubSet2"    "SubSet1"    "SubSet1"    "SubSet2"    "SubSet2"   
#>  [61] "SubSet1"    "SubSet2"    "SubSet3"    "SubSet2"    "SubSet1"   
#>  [66] "SubSet2"    "SubSet3"    "SubSet2"    "SubSet3"    "SubSet2"   
#>  [71] "SubSet3"    "SubSet3"    "SubSet2"    "SubSet2"    "SubSet3"   
#>  [76] "SubSet3"    "SubSet3"    "SubSet1"    "SubSet1"    "SubSet2"   
#>  [81] "SubSet1"    "SubSet1"    "SubSet3"    "SubSet1"    "SubSet3"   
#>  [86] "SubSet2"    "SubSet2"    "SubSet2"    "SubSet1"    "SubSet3"   
#>  [91] "SubSet2"    "SubSet1"    "SubSet2"    "SubSet2"    "SubSet2"   
#>  [96] "SubSet1"    "SubSet1"    "SubSet2"    "SubSet2"    "SubSet3"   
#> [101] "SubSet2"    "SubSet1"    "SubSet3"    "SubSet3"    "SubSet2"   
#> [106] "SubSet3"    "SubSet3"    "SubSet1"    "SubSet3"    "SubSet1"   
#> [111] "SubSet3"    "SubSet2"    "SubSet3"    "SubSet1"    "SubSet1"   
#> [116] "SubSet3"    "SubSet1"    "SubSet3"    "NewSubset1" "NewSubset3"
#> [121] "NewSubset3" "NewSubset2" "NewSubset1" "NewSubset2" "NewSubset3"
#> [126] "NewSubset2" "NewSubset2" "NewSubset2" "NewSubset1" "NewSubset1"
#> [131] "NewSubset2" "NewSubset2" "NewSubset1" "NewSubset3" "NewSubset3"
#> [136] "NewSubset1" "NewSubset3" "NewSubset3" "NewSubset3" "NewSubset3"
#> [141] "NewSubset2" "NewSubset1" "NewSubset2" "NewSubset1" "NewSubset1"
#> [146] "NewSubset3" "NewSubset2" "NewSubset1" "NewSubset3" "NewSubset2"
#> [151] "NewSubset2" "NewSubset2" "NewSubset3" "NewSubset1" "NewSubset2"
#> [156] "NewSubset3" "NewSubset2" "NewSubset3" "NewSubset1" "NewSubset3"
#> [161] "NewSubset2" "NewSubset1" "NewSubset1" "NewSubset2" "NewSubset1"
#> [166] "NewSubset1" "NewSubset1" "NewSubset2" "NewSubset1" "NewSubset3"
#> [171] "NewSubset3" "NewSubset3" "NewSubset2" "NewSubset3" "NewSubset2"
#> [176] "NewSubset3" "NewSubset2" "NewSubset2" "NewSubset2" "NewSubset2"
#> [181] "NewSubset2" "NewSubset1" "NewSubset1" "NewSubset2" "NewSubset1"
#> [186] "NewSubset2" "NewSubset3" "NewSubset1" "NewSubset3" "NewSubset3"
#> [191] "NewSubset1" "NewSubset1" "NewSubset2" "NewSubset2" "NewSubset1"
#> [196] "NewSubset1" "NewSubset1" "NewSubset2" "NewSubset3" "NewSubset1"
#> [201] "NewSubset3" "NewSubset1" "NewSubset2" "NewSubset2" "NewSubset2"
#> [206] "NewSubset3" "NewSubset1" "NewSubset1" "NewSubset3" "NewSubset3"
#> [211] "NewSubset2" "NewSubset1" "NewSubset1" "NewSubset1" "NewSubset3"
#> [216] "NewSubset1" "NewSubset1" "NewSubset3" "NewSubset3" "NewSubset2"
#> [221] "NewSubset2" "NewSubset1" "NewSubset3" "NewSubset1" "NewSubset3"
#> [226] "NewSubset3" "NewSubset1" "NewSubset2" "NewSubset3" "NewSubset3"
#> [231] "NewSubset3" "NewSubset2" "NewSubset2" "NewSubset3" "NewSubset3"
#> [236] "NewSubset2" "NewSubset1"