plot.sharpel1pca: Plot a Sharpel1pca Object

View source: R/plot.sharpel1pca.R

plot.sharpel1pcaR Documentation

Plot a Sharpel1pca Object

Description

Plots the scores on the first two principal components.

Usage

## S3 method for class 'sharpel1pca'
plot(x, ...)

Arguments

x

an object of class sharpel1pca with scores for at least the first two dimensions

...

arguments to be passed to or from other methods.

Details

This function is a method for the generic function plot, for objects of class sharpel1pca.

See Also

sharpel1pca

Examples

##for a 100x10 data matrix X, 
## lying (mostly) in the subspace defined by the first 2 unit vectors, 
## projects data into 1 dimension.
X <- matrix(c(runif(100*2, -10, 10), rep(0,100*8)),nrow=100) 
               + matrix(c(rep(0,100*2),rnorm(100*8,0,0.1)),ncol=10)
mysharpel1pca <- sharpel1pca(X)

##projects data into 2 dimensions.
mysharpel1pca <- sharpel1pca(X, projDim=2, center=FALSE, projections="l1")

## plot first two scores
plot(mysharpel1pca$scores)

pcaL1 documentation built on Jan. 22, 2023, 1:55 a.m.