library(data.table)
set.seed(456)
df <- data.frame(
genotype = rep(c("g1", "g2"), each = 10),
treatment = rep(c("C", "T"), times = 10),
time = rep(c(1:5), times = 2),
date_time = rep(paste0("2024-08-", 21:25), times = 2),
pheno1 = rnorm(20, 10, 1),
pheno2 = sort(rnorm(20, 5, 1)),
pheno3 = sort(runif(20))
)
out <- frem(df, des = "genotype", phenotypes = c("pheno1", "pheno2", "pheno3"), returnData = TRUE)
lapply(out, class)
frem(df,
des = c("genotype", "treatment"), phenotypes = c("pheno1", "pheno2", "pheno3"),
cor = FALSE
)
frem(df,
des = "genotype", phenotypes = c("pheno1", "pheno2", "pheno3"),
combine = FALSE, timeCol = "time", time = "all"
)
frem(df,
des = "genotype", phenotypes = c("pheno1", "pheno2", "pheno3"),
combine = TRUE, timeCol = "time", time = 1
)
frem(df,
des = "genotype", phenotypes = c("pheno1", "pheno2", "pheno3"),
cor = FALSE, timeCol = "time", time = 3:5, markSingular = TRUE
)
df[df$time == 3, "genotype"] <- "g1"
frem(df,
des = "genotype", phenotypes = c("pheno1", "pheno2", "pheno3"),
cor = FALSE, timeCol = "date_time", time = "all", markSingular = TRUE
)
Run the code above in your browser using DataLab