Learn R Programming

vows (version 0.4)

funkpanel: Interactive visualization of massively parallel smoothing results

Description

This function uses interactive graphics tools, provided by the rpanel package (Bowman et al., 2007), to visualize the results of functional k-means clustering as implemented by funkmeans.

Usage

funkpanel(fkmobj, semiobj, arr4d, predictor, titl = "", xlab = "", ylab = "", ncluster = nrow(fkmobj$centers), slice = dim(fkmobj$arr.cluster)[3]%/%2, ylim.scatter = NULL, deriv.legend = 0, ylim.legend = NULL, scattermain = NULL, colvec = NULL)

Arguments

fkmobj
a functional k-means clustering object obtained from funkmeans4d.
semiobj
the massively parallel smoothing object on which the clustering was based; ordinarily produced by semipar.mp or semipar4d.
arr4d
a 4-dimensional array containing the raw data that were smoothed at each point. The first 3 dimensions refer to x, y, and z coordinates and the last dimension corresponds to different images.
predictor
a vector or matrix of covariates.
titl
title of the panel.
xlab,ylab
x- and y-axis labels.
ncluster
number of clusters to display. By default, all are displayed.
slice
index of the slice to be shown initially in the panel.
ylim.scatter
the y limits of the voxelwise scatterplots.
deriv.legend
which derivative to plot in the "legend"; see Details. By default, the curves themselves are used.
ylim.legend
the y limits used in the "legend"; see Details.
scattermain
title for the scatter plots.
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.

Details

The clusters defined by the input object are shown for a cross-section (slice), and a slider allows viewing of different slices. Clicking on a voxel produces a scatterplot of the data at that voxel, along with the fitted scatterplot. The "legend", produced by plot.funkmeans, consists of plots of 30 randomly selected curves, along with the cluster center, from each cluster.

References

Bowman, A., Crawford, E., Alexander, G., and Bowman, R. (2007). rpanel: Simple interactive controls for R functions using the tcltk package. Journal of Statistical Software, 17(9).

See Also

funkmeans, funkmeans4d, plot.funkmeans

Examples

Run this code
data(test)
d4 = test$d4
x = test$x
semi.obj = semipar4d(d4, ~sf(x), -5:5, data.frame(x = x))
fdobj = extract.fd(semi.obj)
fkmobj = funkmeans4d(fdobj, d4, ncomp=6, centers=3)
funkpanel(fkmobj, semi.obj, d4, x)

Run the code above in your browser using DataLab