pc.hull.plot: Principal Component Plot of Convex Hulls

Description Usage Arguments Details Author(s) Examples

View source: R/pc.hull.plot.R

Description

Function generates a principal component plot to best view convex hulls in low dimensions.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
pc.hull.plot(
  dat,
  std = FALSE,
  PC = c(1, 2),
  group = NULL,
  group.cols = NULL,
  group.lwd = NULL,
  group.lty = NULL,
  ...
)

Arguments

dat

A matrix or data frame of data

std

A logical value that if TRUE finds standard deviates of the data (data are both centered and scaled by variable standard deviations).

PC

A vector of length 2 to indicate which PCs to view. The default is c(1, 2). This can be changed to view alternative dimensions. Illogical requests will defualt to c(1, 2) with a warning

group

A factor of vector coercible to factor. If null, the a single convex hull with be returned.

group.cols

A optional vector with length equal to the number of group levels to describe the colors of the hulls. If NULL, R standard colors will be used.

group.lwd

A optional vector with length equal to the number of group levels to describe the line weight (magnification) of the hulls. If NULL, group.lwd = 1 will be used.

group.lty

A optional vector with length equal to the number of group levels to describe the line type of the hulls. If NULL, group.lty = 1 (solid line) will be used.

...

other arguments for graphical parameters

Details

Principal components are obtained from eigen analysis of an among-group covariance or correlation matrix. (Correlation matrix is used if std = TRUE.) Typical plot parameters should be available but parameters for hulls are controlled with specific function arguments. One can add points, lines, arrows, or a legend to the plot canvas, among other plot tricks, if desired. (See points, lines, arrows, and legend).

Author(s)

Michael Collyer

Examples

1
2
3
4
library(RRPP)
data("Pupfish")
group <- interaction(Pupfish$Sex, Pupfish$Pop)
pc.hull.plot(Pupfish$coords, group = group)

mlcollyer/ACHC documentation built on May 30, 2020, 10:26 p.m.