pca: Principal components analysis of a 'zoocat' object

Description Usage Arguments Value Examples

Description

Principal components analysis of a "zoocat" object. This function is a wrap of the stats::prcomp. The rotation returned by stats::prcomp is binded with the cattr table to be a data frame, and the x returned by stats::prcomp is binded with the index to be a "zoo" object.

Usage

1
2
## S3 method for class 'zoocat'
prcomp(x, ...)

Arguments

x

the zoocat object.

...

other argument.

Value

a list with following elements: prcomp.obj (the object returned by stats::prcomp), rotation (the data frame containing information of the variable loadings), z (the zoo object containing the rotated data).

Examples

1
2
3
4
5
6
x <- matrix(1 : 20, nrow = 5)
colAttr <- data.frame(month = c(2, 3, 5, 6), name = c(rep('xxx', 3), 'yyy'))
zc <- zoocat(x, order.by = 1991 : 1995, colattr = colAttr)
pca <- prcomp(zc)
print(pca$rotation)
print(pca$z)

zoocat documentation built on May 2, 2019, 10:22 a.m.