View source: R/sampleCompute.R
computePcaSample | R Documentation |
Perform Principal Components Analysis, dealing with the number of dimensions, automatically or not.
computePcaSample(
data.sample,
pca.nb.dims = 0,
selected.var = NULL,
echo = FALSE,
prcomp.options = list(center = TRUE, scale = TRUE),
pca.variance.cum.min = 0.95
)
data.sample |
list containing features, profiles and clustering results. |
pca.nb.dims |
number of dimensions to keep after PCA. If pca.nb.dims=0 (default), this number is automatically computed. |
selected.var |
vector of features names to consider for the PCA. |
echo |
boolean: if FALSE (default), no description printed in the console. |
prcomp.options |
list of default parameters values for the function prcomp. |
pca.variance.cum.min |
minimal cumulative variance to retain in PCA. |
computePcaSample performs Principal Components Analysis, dealing with the number of dimensions, automatically or not
features list containing the results of PCA, returned by prcomp.
computeSpectralEmbeddingSample
dat <- rbind(matrix(rnorm(100, mean = 0, sd = 0.3), ncol = 2),
matrix(rnorm(100, mean = 2, sd = 0.3), ncol = 2),
matrix(rnorm(100, mean = 4, sd = 0.3), ncol = 2))
tf <- tempfile()
write.table(dat, tf, sep=",", dec=".")
x <- importSample(file.features=tf)
res <- computePcaSample(x, echo = TRUE)
plot(res$pca_full$x[,1], res$pca_full$x[,2], main="PCA", xlab="PC1", ylab="PC2")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.