Plot Mean Trajectory

Description

Plot cluster-specific mean trajectory for one or all clusters provided by a traj object.

Usage

1
plotMeanTraj(x, clust.num = NULL,  ...)

Arguments

x

traj object.

clust.num

Integer indicating the cluster number to plot.NULL to print all clusters. Defaults to NULL.

...

Arguments to be passed to plot.

Details

The function plots cluster specific mean trajectory calculated at each time point. By setting the clust.num argument to an integer corresponding to a cluster number, one can plot the mean trajectory of that cluster only. Any other plotting arguments can be added to the function.

Author(s)

Dan Vatnik, Marie-Pierre Sylvestre
dan.vatnik@gmail.com

See Also

mean

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
# Setup data and time
data = example.data$data
time = example.data$time

# Run step1measures, step2factors and step3clusters with
# a predetermined number of clusters
s1 = step1measures(data,time, ID=TRUE)
s2 = step2factors(s1)
s3.4clusters = step3clusters(s2, nclust = 4)

# Plot mean trajectories
plotMeanTraj(s3.4clusters)