Learn R Programming

klaR (version 1.7-3)

quadplot: Plotting of 4 dimensional membership representation simplex

Description

For a 4 class discrimination problem the membership values of each class are visualized in a 3 dimensional barycentric coordinate system.

Usage

quadplot(e = NULL, f = NULL, g = NULL, h = NULL, angle = 75, 
    scale.y = 0.6, label = 1:4, labelcol = rainbow(4), 
    labelpch = 19, labelcex = 1.5, main = "", s3d.control = list(), 
    simplex.control = list(), legend.control = list(), ...)

Value

A scatterplot3d object.

Arguments

e

either a matrix with 4 columns represanting the membership values or a vector with the membership values of the first class

f

vector with the membership values of the second class

g

vector with the membership values of the third class

h

vector with the membership values of the forth class

angle

angle between x and y axis

scale.y

scale of y axis related to x- and z axis

label

label for the classes

labelcol

colors to use for the labels

labelpch

pch for the labels

labelcex

cex for the labels

main

main title of the plot

s3d.control

a list with further arguments passed to the underlying scatterplot3d function call that sets up the plot

simplex.control

a list with further arguments passed to the underlying function call that draws the barycentric coordinate system

legend.control

a list with further arguments passed to the underlying function call that adds the legend

...

further arguments passed to the underlying plot function that draws the data points

Author

Karsten Luebke, karsten.luebke@fom.de, and Uwe Ligges

Details

The membership values are calculated with quadtrafo and plotted with scatterplot3d.

References

Garczarek, Ursula Maria (2002): Classification rules in standardized partition spaces. Dissertation, University of Dortmund. URL http://hdl.handle.net/2003/2789

See Also

triplot, scatterplot3d

Examples

Run this code
library("MASS")
data(B3)
opar <- par(mfrow = c(1, 2), pty = "s")
posterior <- predict(lda(PHASEN ~ ., data = B3))$post
s3d <- quadplot(posterior, col = rainbow(4)[B3$PHASEN], 
        labelpch = 22:25, labelcex = 0.8,
        pch = (22:25)[apply(posterior, 1, which.max)], 
        main = "LDA posterior assignments")
quadlines(centerlines(4), sp = s3d, lty = "dashed")

posterior <- predict(qda(PHASEN ~ ., data = B3))$post
s3d <- quadplot(posterior, col = rainbow(4)[B3$PHASEN], 
        labelpch = 22:25, labelcex = 0.8,
        pch = (22:25)[apply(posterior, 1, which.max)],
        main = "QDA posterior assignments")
quadlines(centerlines(4), sp = s3d, lty = "dashed")
par(opar)

Run the code above in your browser using DataLab