biplot3d: Three-dimensional biplots, based on package rgl

biplot3DR Documentation

Three-dimensional biplots, based on package rgl

Description

Plots variables and cases in the same plot, based on a principal component analysis.

Usage

biplot3D(x,...)
## Default S3 method:
biplot3D(x,y,var.axes=TRUE,col=c("green","red"),cex=c(2,2),
            xlabs = NULL, ylabs = NULL, expand = 1,arrow.len = 0.1,
            ...,add=FALSE)
 ## S3 method for class 'princomp'
biplot3D(x,choices=1:3,scale=1,...,
            comp.col=1,comp.labs=paste("Comp.",1:3),
            scale.scores=lambda[choices]^(1-scale),
            scale.var=scale.comp, scale.comp=sqrt(lambda[choices]), 
            scale.disp=1/scale.comp)

Arguments

x

princomp object or matrix of point locations to be drawn (typically, cases)

choices

Which principal components should be used?

scale

a scaling parameter like in biplot

scale.scores

a vector giving the scaling applied to the scores

scale.var

a vector giving the scaling applied to the variables

scale.comp

a vector giving the scaling applied to the unit length of each component

scale.disp

a vector giving the scaling of the display in the directions of the components

comp.col

color to draw the axes of the components, defaults to black

comp.labs

labels for the components

...

further plotting parameters as defined in rgl::material3d

y

matrix of second point/arrow-head locations (typically, variables)

var.axes

logical, TRUE draws arrows and FALSE points for y

col

vector/list of two elements the first giving the color/colors for the first data set and the second giving color/colors for the second data set.

cex

vector/list of two elements the first giving the size for the first data set and the second giving size for the second data set.

xlabs

labels to be plotted at x-locations

ylabs

labels to be plotted at y-locations

expand

the relative expansion of the y data set with respect to x

arrow.len

The length of the arrows as defined in arrows3D

add

logical, adding to existing plot or making a new one?

Details

This "biplot" is a triplot, relating data, variables and principal components. The relative scaling of the components is still experimental, meant to mimic the behavior of classical biplots.

Value

the 3D plotting coordinates of the tips of the arrows of the variables displayed, returned invisibly

Author(s)

K.Gerald v.d. Boogaart http://www.stat.boogaart.de

See Also

gsi

Examples

data(SimulatedAmounts)
pc <- princomp(acomp(sa.lognormals5))
pc
summary(pc)
plot(pc)      #plot(pc,type="screeplot")
biplot(pc)
if(requireNamespace("rgl", quietly = TRUE)) {
  biplot3D(pc)
} ## this function requires package 'rgl'


compositions documentation built on June 22, 2024, 12:15 p.m.