Specify AKMedoids method

lcMethodAkmedoids(
  response,
  time = getOption("latrend.time"),
  id = getOption("latrend.id"),
  nClusters = 3,
  clusterCenter = median,
  crit = "Calinski_Harabasz",
  ...
)

Arguments

response

The name of the response variable.

time

The name of the time variable.

id

The name of the trajectory identification variable.

nClusters

The number of clusters to estimate.

clusterCenter

A function for computing the cluster center representation.

crit

Criterion to apply for internal model selection. Not applicable.

...

Arguments passed to akmedoids::akclustr. The following external arguments are ignored: traj, id_field, k

References

Adepeju M, Langton S, Bannister J (2020). akmedoids: Anchored Kmedoids for Longitudinal Data Clustering. R package version 0.1.5, https://CRAN.R-project.org/package=akmedoids.

Examples

data(latrendData)
if (rlang::is_installed("akmedoids")) {
  method <- lcMethodAkmedoids(response = "Y", time = "Time", id = "Id", nClusters = 3)
  model <- latrend(method, data = latrendData)
}
#> [1] "Processing...."
#> [1] ".............."
#> [1] "solution of k = 3 determined!"