Return subset of observations in pcaviz object.

# S3 method for pcaviz
subset(x, subset, …)

Arguments

x

An object of class "pcaviz".

subset

Logical expression indicating elements or rows to keep; missing values are taken as false.

Additional arguments to generic subset function. These additional arguments are not used here.

Value

A pcaviz object in containing data and PCA results for the selected elements only.

Note that unused levels are dropped from all factors (i.e., categorical variables).

See also

link{pcaviz}, subset, droplevels

Examples

# Create the pcaviz object. data(iris) a <- pcaviz(prcomp(iris[1:4]),dat = iris) # Retain the subset of Iris samples in which the first PC is # positive. b <- subset(a,PC1 > 0)