multi_ellipse: Create a Hotelling T2 ellipse for a PCA score plot per group

View source: R/multi_ellipse.R

multi_ellipseR Documentation

Create a Hotelling T2 ellipse for a PCA score plot per group

Description

This function can be used to create a confidence (Hotelling T2) interval for a PCA score plot per group.

Usage

multi_ellipse(data, x, y, alpha = 0.95, len = 200, ellipse = NULL)

Arguments

data

data frame or table

x

(name of) x vector

y

(name of) y vector

alpha

confidence interval

len

number of points to create the ellipse

ellipse

name of column of groups

Details

This is a helper function which is used to create a confidence (Hotelling T2) interval for a PCA score plot per group.

Value

A data frame is returned with the points to create the ellipse.

Author(s)

Rico Derks, modified by Marco Bladergroen

# if ellipse is not NULL this function assumes you have data with a factorial column named as in 'ellipse' to draw multiple ellipses. x and y should contain the name (string) of the columns of the data to be plotted. If ellipse is NULL the (single) ellipse is drawn according to data in x and y (vectors).


ricoderks/Rcpm documentation built on May 18, 2022, 7:49 a.m.