pcat: PCA with prcomp and plot of select pc score

View source: R/pcat.R

pcatR Documentation

PCA with prcomp and plot of select pc score

Description

This functions returns a result of prcomp object.

Usage

pcat(dat, x, y, scaling, cols, txt, tpos, ...)

Arguments

dat

dataframe, matrix or prcomp object

x, y

axis of pca score. 'x=1, y=2' means xaxis for PC1 score and yaxis for PC2 score

scaling

prcomp option, scaling or not. The default is "TRUE"

cols

A vector of manual colour

txt

A size of text(optional)

tpos

text position(optional)

...

Further plot arguments. E.g., pch

Value

return prcomp object

Examples

# minimum usage
res <- pcat(iris[-5], scaling = TRUE, cols = c(1:3)[iris$Species])
res <- pcat(iris[-5], x =1, y = 3, scaling = TRUE, cols = c(1:3)[iris$Species], pch = 20)

shkonishi/rsko documentation built on Feb. 21, 2023, 5:12 a.m.