pca: Project a set of points in a euclidean space (PCA).

Description Usage Arguments Value Author(s) Examples

View source: R/multivariate.R

Description

Project a set of points defined by a set of numeric variables in an eucleadean space using the pricipal componant analysis. This function is mainly a simplified interface on the prcomp function using as much as possible dimensions to keep all the variation. The aims of this PCA being only to project point in an orthogonal space therefore without any correlation between axis. Data are centered by not scaled by default.

Usage

1

Arguments

data

a numeric matrix describing the points

scale

a logical value indicating if the dimensions must be scaled to force for every column that sd=1. FALSE by default.

Value

a numeric matrix with at most n-1 dimensions, with n the number pf observations. This matrix defines the coordinates of each point in the orthogonal space.

Author(s)

Eric Coissac

Christelle Gonindard-Melodelima

Examples

1
2
3
4
5
6
7
8
data(bacteria)
bacteria_rel_freq <- sweep(bacteria,
                           1,
                           rowSums(bacteria),
                           "/")
bacteria_hellinger <- sqrt(bacteria_rel_freq)

project <- pca(bacteria_hellinger)

ProcMod documentation built on May 12, 2021, 9:08 a.m.

Related to pca in ProcMod...