plot_obspc: Plot observations in the coordinate plane PC1-PC2.

Description Usage Arguments Value Examples

View source: R/plot_obspc.R

Description

This function plots the observations in the coordinate plane PC1-PC2.

Usage

1
plot_obspc(mod, lchar = 3, pch = 20, ...)

Arguments

mod

A prcomp or princomp object.

lchar

The number of first characters to identify points. #' @param ... Arguments to be passed to methods, such as graphical parameters (see par).

Value

The function returns a list with two elements, coordinate points for first and second dimensions.

Examples

1
2
3
4
5
6
7
8
9
# For a prcomp object
pca1 <- prcomp(USArrests, scale=TRUE)  # Example
plot_obspc(pca1)  
# Default plot
plot_obspc(pca1, lchar=3, col='blue', pch=8)  # Customized plot
#
# For a princomp object
pca2 <- princomp(x=USArrests, cor=TRUE)
plot_obspc(pca2, col='red', ylim=c(-4, 4), xlim=c(-4, 4)) 

fhernanb/model documentation built on Sept. 16, 2017, 11 a.m.