Learn R Programming

ChemoSpec (version 4.4.97)

labelExtremes3d: Identify Extreme Values in 3D

Description

A utility function to identify the extreme values in a 3D plot data set, presumably so that they can be labeled. Algorithm is similar to labelExtremes, except that labelExtremes3d does not do the plotting (because the results are used by functions that use different plotting paradigms). An internal function, not generally called by the user.

Usage

labelExtremes3d(data, names, tol)

Arguments

data

A matrix of 3 columns containing x, y and z values for the labels, with rows corresponding to sample names.

names

A character vector of sample names; must have length equal to nrow(data).

tol

A number describing the fraction of points to be labeled. tol = 1.0 labels all the points; tol = 0.05 labels approximately the most extreme 5 percent. Note that this is simply based upon quantiles, assumes that x, y and z are each normally distributed, and treats x, y and yz separately. Thus, this is not a formal treatment of outliers, just a means of labeling points. Note too that while this function could deal with groups separately, the way it is called by plotScoresRGL lumps all groups together.

Value

A data frame containing the x, y and z coordinates, along with the corresponding labels.

References

https://github.com/bryanhanson/ChemoSpec