set.seed(1)
X <- rbind(
matrix(stats::rnorm(100, mean = -2), ncol = 5),
matrix(stats::rnorm(100, mean = 2), ncol = 5)
)
meta_data <- data.frame(
batch = rep(c("A", "B"), each = 20),
group = sample(c("g1", "g2"), 40, replace = TRUE)
)
res <- compute_lisi(
X, meta_data,
c("batch", "group"),
perplexity = 10
)
head(res)
boxplot(res)
Run the code above in your browser using DataLab