Convert random group names (e.g. "a", "b") into meaningful groups (e.g. "control", "experimental"). It can be used to unblind at the *end* of the analysis, or it can be used as "scrambled" at the beginning of the analysis. Returns a data frame with all (unused) columns of data and key.

remove_blinding(data, key, scramble = FALSE)

Arguments

data

Dataframe with (at least) two columns: "sample_id" and "blinded_group"

key

Dataframe with (at least) two columns: "blinded_group" and "key"

scramble

Specifies whether to scramble the groups or not. Can be either TRUE or FALSE

Value

Examples

x <- data.frame(sample_id = c(1:20), blinded_group = c(rep(c(1:4), each = 5))) y <- data.frame(blinded_group = 1:4, key = c("control", "drug_a", "drug_b", "drug_c")) z <- unblind(x,y)
#> Error in unblind(x, y): could not find function "unblind"