knitr::opts_chunk$set( collapse = TRUE, comment = "#>", fig.path = "man/figures/README-", out.width = "100%" )
The goal of $\texttt{traj}$ is to implement the three-step procedure proposed by Leffondree et al. (2004) to identify clusters of individual longitudinal trajectories. The procedure involves (1) calculating 24 measures describing the features of the trajectories; (2) using factor analysis to select a subset of the 24 measures and (3) using cluster analysis to identify clusters of trajectories, and classify each individual trajectory in one of the clusters.
You can install the development version of $\texttt{traj}$ from GitHub with:
# install.packages("devtools") devtools::install_github("tchouangue/traj")
This is a basic example which shows you how to solve a common problem:
library(traj) # Step 1. Setup data data = example.data$data # Step 2. Computing 24 measures of each trajectory s1 = step1measures(data, ID=TRUE) # Step 3. Factor analysis s2 = step2factors(s1) # Step 4. Clustering the trajectories s3 = step3clusters(s2, nclusters = 4) plot(s3)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.