Plot convex hulls for different groups in 3D scatterplots created using rgl. Used internally (mostly).

hulls_by_group_3D(xyz, fac, col = seq_len(nlevels(fac)), ...)

Arguments

xyz

Coordinates for the scatterplot

fac

A factor grouping data points.

col

A vector (either character or numeric) indicating the colors used for each group.

...

Further arguments passed to rgl::triangles3d() (e.g. specular, alpha).

Examples

#load landmark data and necessary packages
library(geomorph)
data("tails")
shapes <- tails$shapes
species <- tails$data$species

#perform PCA
pca <- prcomp(two.d.array(shapes))

#plot and add convex hulls
if (FALSE) {

plot3d(pca$x)
hulls_by_group_3D(pca$x, fac = species, col = "gray")

}