Learn R Programming

pcadapt (version 1.0)

corpca: Principal Components Analysis

Description

corpca performs a principal components analysis on a dataset, and returns an object x which contains the loadings, the scores and the singular values of the K first principal components. It handles missing values in a dataset and actually computes the eigen elements of the rather small n x n covariance matrix. All these variables are accesible using the dollar sign (example : stds <- x$neutral_sdev).

Usage

corpca(data, K)

Arguments

data
a data matrix or a data frame.
K
an integer specifying the number of principal components that are retained.

Examples

Run this code
x <- read4pcadapt("geno3pops",option="example")
y <- pcadapt(x,K=3)

Run the code above in your browser using DataLab