plot Method for tclust Objects

Description

The plot method for classes tclust and tkmeans.

Usage

1
2
3
4
## S3 method for class 'tclust'
 plot(x, ...)
## S3 method for class 'tkmeans'
 plot(x, ...)

Arguments

x

The tclust or tkmeans object to be displayed.

...

Further (optional) arguments which specify the details of the resulting plot (see section "Further Arguments").

Details

One and two dimensional structures are treated separately (e.g. tolerance intervals/ellipses are displayed). Higher dimensional structures are displayed by plotting the two first Fisher's canonical coordinates (evaluated by discr_coords) and derived from the final cluster assignments (trimmed observations are not taken into account). plot.tclust.Nd can be called with one or two-dimensional tclust-objects too. The function fails, if "store.x = FALSE" is specified in tclust, because the original data matrix is required here.

Further Arguments

xlab, ylab, xlim, ylim, pch, col

Arguments passed to plot.

main

The title of the plot. Use "/p" for displaying the chosen parameters alpha and k or "/r" for plotting the chosen restriction (tclust only).

main.pre

An optional string which is added to the plot's caption.

sub

A string specifying the subtitle of the plot. Use "/p" (default) for displaying the chosen parameters alpha and k, "/r" for plotting the chosen restriction (tclust only) and "/pr" for both.

sub1

A secondary (optional) subtitle.

labels

A string specifying the type of labels to be drawn. Either "none" (default), "cluster" or "observation" can be specified. If specified, parameter pch is ignored.

text

A vector of length n (the number of observations) containing strings which are used as labels for each observation. If specified, the parameters labels and pch are ignored.

by.cluster

Logical value indicating whether parameters pch and col refer to observations (FALSE) or clusters (TRUE).

jitter.y

Logical value, specifying whether the drawn values shall be jittered in y-direction for better visibility of structures in 1 dimensional data.

tol

The tolerance interval. 95% tolerance ellipsoids (assuming normality) are plotted by default (tclust only).

tol.col, tol.lty, tol.lwd

Vectors of length k or 1 containing the col, lty and lwd arguments for the tolerance ellipses/lines (tclust only).

Author(s)

Agustin Mayo Iscar, Luis Angel Garcia Escudero, Heinrich Fritz

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#--- EXAMPLE 1------------------------------
sig <- diag (2)
cen <- rep (1, 2)
x <- rbind (
	rmvnorm (360, cen * 0,   sig),
	rmvnorm (540, cen * 5,   sig * 6 - 2),
	rmvnorm (100, cen * 2.5, sig * 50)
)
# Two groups and 10% trimming level
a <- tclust (x, k = 2, alpha = 0.1, restr.fact = 12)

plot (a)
plot (a, labels = "observation")
plot (a, labels = "cluster")
plot (a, by.cluster = TRUE)

#--- EXAMPLE 2------------------------------
x <- c(	rnorm(72,	0,   1),
		rnorm(108, 10,   1),
		rnorm(20,  2.5, 10))

a <- tkmeans (x, k = 2, alpha = 0.1)
plot (a, jitter.y = TRUE)