biplot_color: Function for biplotting with no point labels and with points...

Description Usage Arguments Value Examples

View source: R/biplot.R

Description

This function implements biplot for prcomp objects.

Usage

1
2
biplot_color(x, y, rank = TRUE, ties_method = c("max", "min", "first",
  "last", "random"), choices = 1:2, expand = 1, ...)

Arguments

x

prcomp object.

y

numeric. Quantitative values used to color the points. If rank is FALSE, all values must be positive integers and less than or equal to the length of y.

rank

logical. If TRUE (default) y will be transformed by the rank() function

ties_method

character. ties.method used by the rank() function

choices

numeric. 2 principal components to plot. Default to first two PCs.

expand

numeric. value used to adjust the spread of the arrows relative to the points.

...

arguments passed to plot.

Value

Invisibly returns scaled point coordinates used in plot.

Examples

1
2
3
4
5
6
mat <- matrix(rnorm(1000), ncol=10)
colnames(mat) <- paste("X", 1:ncol(mat), sep="")

pc <- prcomp(mat)

biplot_color(pc, rank(pc$x[,1]))

scone documentation built on Nov. 8, 2020, 5:20 p.m.