Learn R Programming

shapeR (version 1.0-1)

cluster.plot: Plot data clusters

Description

Plots data clusters

Usage

cluster.plot( ddata, classes, main="", col.stock=NULL,
              plotCI = FALSE, conf.level = 0.68, ...)

Value

None

Arguments

ddata

Matrix of points

classes

A factor including the cluster values

main

Title for the plot

col.stock

Colors for the plotted classes

plotCI

Plot means with confidence intervals

conf.level

The confidence interval for the standard error of the mean

...

Additional parameters to be passed to 'plot' or 'ldahist' if one dimension

Author

Lisa Anne Libungan

References

Oksanen, J., Blanchet, F.G., Kindt, R., Legendre, P., Minchin, P.R., O'Hara, R.B., Simpson, G.L., Solymos, P., Stevens, M.H.H. and Wagner, H. (2013). vegan: Community Ecology Package. R package version 2.0-10.

Examples

Run this code
data(shape)
library(vegan)
cap.res = capscale(getStdWavelet(shape) ~ getMasterlist(shape)$pop)

eig=eigenvals(cap.res,constrained=TRUE)
eig.ratio = eig/sum(eig)

cluster.plot(scores(cap.res)$sites[,1:2],getMasterlist(shape)$pop
,plotCI=TRUE
,xlab=paste("CAP1 (",round(eig.ratio[1]*100,1),"%)",sep="")
,ylab=paste("CAP2 (",round(eig.ratio[2]*100,1),"%)",sep="")
,main="Canonical clustering"
)

Run the code above in your browser using DataLab