madSelection <- sapply(as.character(unique(exampleDat$MASTER_PLATE)),
madSelect, exampleDat, control = "control",
treatment = "treatment", simplify = FALSE)
madSelection.c <- do.call(rbind,
lapply(names(madSelection), function(x) madSelection[[x]]))
Run the code above in your browser using DataLab