Learn R Programming

traj (version 3.0.0)

plot.trajClusters: Plot trajClusters object

Description

Plots the curves corresponding to (or closest to) the centroids of the clusters and plots a random sample from each groups.

Usage

# S3 method for trajClusters
plot(x, sample.size = 5, ask = TRUE, which.plots = NULL, ...)

scatterplots(x, ask = TRUE, ...)

CVIplot(x, ...)

Arguments

x

object of class trajClusters as returned by the function trajClusters().

sample.size

the number of random trajectories to be randomly sampled from each cluster. Defaults to 5.

ask

logical. If TRUE, the user is asked before each plot. Defaults to TRUE.

which.plots

either NULL or a vector of integers. If NULL, every available plot is displayed. If a vector is supplied, only the corresponding plots will be displayed.

...

other parameters to be passed through to plotting functions.

Examples

Run this code
if (FALSE) {
data("trajdata")
trajdata.noGrp <- trajdata[, -which(colnames(trajdata) == "Group")] #remove the Group column

m = trajMeasures(trajdata.noGrp, ID = TRUE)
c3 = trajClusters(m, nclusters = 3)

plot(c3)

#The pointwise mean trajectories correspond to the third and fourth displayed plots.

c4 = trajClusters(m, nclusters = 4)

plot(c4, which.plots = 3:4)

}


Run the code above in your browser using DataLab