Learn R Programming

vows (version 0.2-0)

plot.funkmeans: Plotting of k-means clustering results for massively parallel smooths

Description

Visualization of functional k-means clustering as implemented by funkmeans.

Usage

## S3 method for class 'funkmeans':
plot(x, fdobj, deriv = 0, ylim = NULL, ncluster = nrow(x$centers), mfrow = NULL,
     colvec = NULL, ...)

Arguments

x
a functional k-means clustering object obtained from funkmeans.
fdobj
a functional data object, of class "fd", defining the set of curves being clustered. See the example.
deriv
which derivative to display in the plots, which show 30 randomly selected curves, along with the cluster center, from each cluster. By default, the "0th derivative" is used (i.e., the curves themselves).
ylim
the y limits for the plots.
ncluster
number of clusters to display. By default, all are displayed.
mfrow
a vector of length 2 giving the numbers of rows and columns for the array of plots. By default, the number of rows will exceed the number of columns by 0 or 1, depending on ncluster.
colvec
a vector of colors for the clusters. By default, this is set to the first ncluster elements of c("dodgerblue", "green", "red", "orange", "yellow", "orchid", "brown", "grey", "purple"), if ncluster <= 9<="" code="">.
...
arguments passed to plot.

See Also

funkmeans, funkpanel

Examples

Run this code
data(test)
d4 = test$d4
x = test$x
semi.obj = semipar4d(d4, formula = ~sf(x), data = data.frame(x = x), lsp=-5:5)
fkmobj = funkmeans(semi.obj, ncomp = 8, centers = 6)
fdobj = fd(coef = semi.obj$coef[-1, ], basis = semi.obj$list.all[[1]]$basis)
plot(fkmobj, fdobj)

Run the code above in your browser using DataLab