I would like to use R for solving a problem of experimental design in which I will randomly assign my experimental units to treatment or control groups. The problem is the following:
Let's say that I have 120 plants with unique IDs (subsetted in 4 different clones), 3 time points, 2 pathogens, 2 control groups. Therefore, for each time point I would like to assign for each clone: -3 of pathogen A, 3 of pathogen B, 2 of control A and 2 of control B.
clones <- c(rep("clone A", 30), rep("clone B", 30), rep("clone C", 30), rep("clone D", 30))
IDs <- 1:120
plants <- data.frame(IDs = IDs,
clones = clones)
# How can I randomly assign the following for each IDs?
control <- c("control A", "control B")
pathogen <- c("pathogen A", "Pathogen B")
time_point <- c("T1", "T2", "T3")
Thanks for the help!
Created on 2022-04-15 by the reprex package (v2.0.1)