# Mock data
X <- matrix(rnorm(40), nrow = 10,
dimnames = list(paste0("sample", 1:10),
paste0("feat", 1:4)))
sample_data <- data.frame(
sample_id = rownames(X),
group = factor(rep(c("A", "B"), each = 5)),
age = rep(20:29, length.out = 10),
row.names = rownames(X),
stringsAsFactors = FALSE
)
# Simple control structures
dist_control <- list(method = "euclidean")
perm_control <- list(
joint_terms = list(control = permute::how(blocks = NULL, nperm = 9)),
group = list(control = permute::how(blocks = NULL, nperm = 9)),
age = list(control = permute::how(blocks = NULL, nperm = 9))
)
result <- permanova(
X = X,
sample_data = sample_data,
formula_rhs = ~ group + age,
dist_control = dist_control,
perm_control = perm_control,
independent = TRUE,
platform = "ms",
assay = "lipidomics",
seed = 42,
verbose = FALSE
)
Run the code above in your browser using DataLab