View source: R/pcapairs_bymoose.R
pcapairs_bymoose | R Documentation |
This function generates an upper triangle PCA plot for all pairs of PC loadings provided.
pcapairs_bymoose(myloadings, varexp, pcol = "dodgerblue")
myloadings |
a matrix or data frame of PC loadings (only those you would like to plot). |
varexp |
a vector of the the variance explained by each PC |
pcol |
plot colors for the dots background |
a base R plot
ex_data = sapply(1:5, function(x){rnorm( 50, 0, 2) }) ## add in some extreme values to a sample ex_data[1,] = ex_data[1,] + sample( c(8, -8), ncol(ex_data), replace = TRUE ) ex_data[2,] = ex_data[2,] + sample( c(3, -3), ncol(ex_data), replace = TRUE ) ## plot pcapairs_bymoose(myloadings = ex_data, varexp = rep(1/ncol(ex_data), ncol(ex_data)), pcol = "tomato" )
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.