| reflect | R Documentation |
candisc and cancor objects have coefficients for the X and Y and weighted scores for these,
whose signs are arbitrary, in the sense that a given column can be reflected (multiplied by -1) without changing the fit.
But, often you will want to reverse the direction of one or more dimensions for ease of interpretation.
This function allows you to reflect any columns of the variable coefficients (and corresponding observation scores). This is often useful for interpreting a biplot, for example when a component (often the first) has all negative signs.
reflect(object, columns = 1:2, ...)
## S3 method for class 'data.frame'
reflect(object, columns = 1:2, ...)
## S3 method for class 'cancor'
reflect(object, columns = 1:2, ...)
## S3 method for class 'candisc'
reflect(object, columns = 1:2, ...)
object |
An object whose columns are to be reflected |
columns |
a vector of indices of the columns to reflect |
... |
Unused |
reflect methods are available for:
data.frames
"cancor" objects
"candisc" objects
Note that plot.candisc() and plot.candisc() can handle this internally using the argument rev.axes.
The object with specified columns of the variable coefficients and observation scores multiplied by -1.
reflect(data.frame): "data.frame" method.
reflect(cancor): "cancor" method.
reflect(candisc): "candisc" method.
Michael Friendly
ggbiplot::reflect has similar methods for PCA-like objects
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.