Description Usage Arguments Value See Also Examples
This function calculates P values for association of any number
of eigen vectors with the metadata variables.
Method: anova(lm(eigen vector ~ variable))$"Pr(>F)"[1]
1 | eigenVariable(pcs, tech.vars)
|
pcs |
a matrix with eigen vectors, i.e. V matrix of an SVD |
tech.vars |
data frame with the metadata variables |
Matrix with the P values where columns are the eigen vectors and the rows are the variables from the metadata
ggplot object for a tile plot reflecting significant associations
1 2 3 4 5 6 7 8 9 | u <- matrix(runif(120), ncol = 3)
library(ggplot2)
var.test <- data.frame(batch = sample(c("a", "b"), 40, replace = TRUE),
age = sample(50:85, size = 40, replace = TRUE),
amp.plate = sample(c("A1", "B1", "C1", "D1", "E1"), 40, replace = TRUE),
height = sample(60:72, 40, replace = TRUE))
res <- eigenVariable(u, var.test)
print(res$result)
plot(res$plot)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.