
Last chance! 50% off unlimited learning
Sale ends in
Principal components analysis is a eigenanalysis of a correlation or covariance matrix used to project a high-dimensional system to fewer dimensions.
pca(mat, cor = FALSE, dim = min(nrow(mat),ncol(mat)))
# S3 method for pca
summary(object, dim = length(object$sdev), ...)
# S3 method for pca
scores(x, labels = NULL, dim = length(x$sdev))
# S3 method for pca
loadings(x, dim = length(x$sdev), digits = 3, cutoff = 0.1)
varplot.pca(x, dim=length(x$sdev))
an object of class "pca", a list with components:
a matrix of the coordinates of the samples in the reduced space
a matrix of the contributions of the variables to the axes of the reduced space.
a vector of standard deviations for each dimension
a matrix or data.frame of interest, samples as rows, attributes as columns
logical: whether to use a correlation matrix (if TRUE), or covariance matrix (if FALSE)
the number of dimensions to return
an object of class ‘pca’
an object of class ‘dsvord’ and type='pca'
an (optional) vector of labels to identify points
number of digits to report
threshold to suppress printing small values
arguments to pass to function summary
David W. Roberts droberts@montana.edu http://ecology.msu.montana.edu/droberts/droberts.html
PCA is a common multivariate technique. The version here is simply
a wrapper for the prcomp
function to make its use and
plotting consistent with the other LabDSV functions.
princomp
, prcomp
,
pco
, nmds
,
fso
, cca
data(bryceveg) # returns a vegetation data.frame
data(brycesite)
x <- pca(bryceveg,dim=10) # returns the first 10 eigenvectors
# and loadings
plot(x)
surf(x,brycesite$elev)
points(x,brycesite$depth=='deep')
Run the code above in your browser using DataLab