plot.pca_warper: Plot a PCA warper transformation object

View source: R/pca_warper.R

plot.pca_warperR Documentation

Plot a PCA warper transformation object

Description

This method plots standard PCA summary diagrams for a pca_warper, i.e. a principal component transformation of feature space.

Usage

## S3 method for class 'pca_warper'
plot(x, which = c(1:2), col = c("white", "black"), bp.col = "lightblue", ...)

Arguments

x

A pca_warper object.

which

Which plots to plot: screeplot (1), biplot (2).

col, bp.col

Colours of biplot labels and barplot bars.

...

Currently not used.

Value

Returns NULL

Examples

### Create principal components warper for Maipo data set:
xvars <- c(paste("ndvi0", 1:8, sep = ""), paste("ndwi0", 1:8, sep = ""),
           paste("b", outer(1:8,2:7,paste,sep = ""), sep = ""))
fo <- as.formula(paste("class ~", paste(xvars, collapse=" +" )))
d <- maipofields

wrp <- pca_warper(d, xvars = xvars, yvar = "class")
plot(wrp)
round(wrp$pca$rotation[,1:3], digits = 2)
summary(wrp)

# Create a data frame with transformed data:
wd <- warp(d, warper = wrp)
summary(wd)

# Backtransform it, should be identical to d:
d2 <- unwarp(wd, warper = wrp)
all.equal(d, d2[,colnames(d)])
# Default tolerance works for this data set, but you may have to use
# e.g. tol = 10^(-6) for less well conditioned data sets and
# transformations.

alexanderbrenning/wiml documentation built on Sept. 29, 2023, 4:45 a.m.