# Extract subset of the microbial data to be used as an example
data(microbialdata)
X <- microbialdata$Xenv
y <- microbialdata$Y[, order(colMeans(microbialdata$Y > 0),
decreasing = TRUE)[21:40]]
fit <- gllvm(y, X[,1:3], formula = ~ pH + Phosp, family = poisson(),
studyDesign = X[,4:5], row.eff = ~(1|Site))
VP <- VP(fit)
plot(VP)
if (FALSE) {
# Plot the result of variance partitioning
plot(VP, col = palette(hcl.colors(5, "Roma")))
}
Run the code above in your browser using DataLab