Obtain the size of each cluster, where the size is determined by the number of assigned trajectories to each cluster.

clusterSizes(object, ...)

Arguments

object

The lcModel object.

...

Additional arguments passed to trajectoryAssignments().

Value

A named integer vector of length nClusters(object) with the number of assigned trajectories per cluster.

Details

The cluster sizes are computed from the trajectory cluster membership as decided by the trajectoryAssignments() function.

Examples

data(latrendData)
method <- lcMethodLMKM(Y ~ Time, id = "Id", time = "Time")
model <- latrend(method, latrendData, nClusters = 2)
clusterSizes(model)
#>   A   B 
#>  80 120