latrend
An R package for clustering longitudinal datasets in a standardized way, providing interfaces to various R packages for longitudinal clustering, and facilitating the rapid implementation and evaluation of new methods
Science Score: 54.0%
This score indicates how likely this project is to be science-related based on various indicators:
-
✓CITATION.cff file
Found CITATION.cff file -
✓codemeta.json file
Found codemeta.json file -
✓.zenodo.json file
Found .zenodo.json file -
○DOI references
-
✓Academic publication links
Links to: arxiv.org -
○Committers with academic emails
-
○Institutional organization owner
-
○JOSS paper metadata
-
○Scientific vocabulary similarity
Low similarity (18.8%) to scientific vocabulary
Keywords
Repository
An R package for clustering longitudinal datasets in a standardized way, providing interfaces to various R packages for longitudinal clustering, and facilitating the rapid implementation and evaluation of new methods
Basic Info
- Host: GitHub
- Owner: niekdt
- License: gpl-2.0
- Language: R
- Default Branch: master
- Homepage: https://niekdt.github.io/latrend/
- Size: 66.5 MB
Statistics
- Stars: 34
- Watchers: 3
- Forks: 5
- Open Issues: 18
- Releases: 23
Topics
Metadata Files
README.md
latrend
<!--
-->
<!-- badges: end -->
The
latrend package provides a framework for clustering longitudinal datasets in a standardized way. The name is short for latent-class trend (analysis), referring to the discovery of hidden trends in the data. The package provides interfaces to various R packages for conducting this type of analysis.
The package is described in detail in the pre-print available at https://arxiv.org/abs/2402.14621
Features
- Unified cluster analysis, independent of the underlying algorithms used. Enabling users to compare the performance of various longitudinal cluster methods on the case study at hand.
- Supports many different methods for longitudinal clustering out of the box (see the list of supported packages below).
- The framework consists of extensible
S4methods based on an abstract model class, enabling rapid prototyping of new cluster methods or model specifications. - Standard plotting tools for model evaluation across methods (e.g., trajectories, cluster trajectories, model fit, metrics)
- Support for many cluster metrics through the packages clusterCrit, mclustcomp, and igraph.
- The structured and unified analysis approach enables simulation studies for comparing methods.
- Standardized model validation for all methods through bootstrapping or k-fold cross-validation.
See the release notes page for the latest updates.
Installation
The latest release of latrend can be installed from CRAN by running:
R
install.packages("latrend")
It can also be installed from Github directly using: ```R remotes::installgithub('niekdt/latrend', ref = remotes::githubrelease())
include vignettes
remotes::installgithub('niekdt/latrend', ref = remotes::githubrelease(), build_vignettes = TRUE) ```
Usage
R
library(latrend)
Load and view example data.
R
data(latrendData)
head(latrendData)
options(latrend.id = "Id", latrend.time = "Time")
plotTrajectories(latrendData, response = "Y")

Cluster the trajectories and plot the results.
R
kmlMethod <- lcMethodKML("Y", nClusters = 3)
model <- latrend(kmlMethod, data = latrendData)
summary(model)
plot(model)

Identify solutions for 1 to 5 clusters.
R
kmlMethods <- lcMethods(kmlMethod, nClusters = 1:5)
models <- latrendBatch(kmlMethods, data = latrendData)
Determine the number of clusters through one or more internal cluser metrics.
R
metric(models, c("WMAE", "BIC"))
plotMetric(models, c("Dunn", "ASW", "WMAE", "WRSS", "BIC", "estimationTime"))

Supported packages
The latrend package provides interfaces to the relevant methods for longitudinal clustering for the following packages:
* akmedoids
* crimCV
* dtwclust
* fda
* flexmix
* funFEM
* kml
* lcmm
* mclust
* mixAK
* mixtools
Contributing
We appreciate any contributions in the form of ideas, feature requests, bug reports, bug fixes, documentation improvements, code reformatting, and code submissions. Please see the Contributing guide.
Owner
- Name: Niek Den Teuling
- Login: niekdt
- Kind: user
- Location: Eindhoven, the Netherlands
- Company: Philips Research
- Website: https://orcid.org/0000-0003-1026-5080
- Repositories: 1
- Profile: https://github.com/niekdt
Citation (CITATION.cff)
cff-version: 1.2.0 message: "If you use this software, please cite it as below." authors: - family-names: "Den Teuling" given-names: "Niek" orcid: "https://orcid.org/0000-0003-1026-5080" - family-names: "Pauws" given-names: "Steffen" orcid: "https://orcid.org/0000-0003-2257-9239" - family-names: "van den Heuvel" given-names: "Edwin" orcid: "https://orcid.org/0000-0001-9157-7224" title: "latrend: A Framework for Clustering Longitudinal Data" version: 1.6.2 date-released: 2025-06-30 url: "https://github.com/niekdt/latrend"
GitHub Events
Total
- Release event: 1
- Watch event: 1
- Push event: 7
- Create event: 1
Last Year
- Release event: 1
- Watch event: 1
- Push event: 7
- Create event: 1
Committers
Last synced: 8 months ago
Top Committers
| Name | Commits | |
|---|---|---|
| Niek Den Teuling | n****g@p****m | 909 |
| Niek Den Teuling | n****e@n****e | 407 |
| olivroy | 5****y | 1 |
Committer Domains (Top 20 + Academic)
Issues and Pull Requests
Last synced: 6 months ago
All Time
- Total issues: 92
- Total pull requests: 8
- Average time to close issues: about 1 month
- Average time to close pull requests: about 2 hours
- Total issue authors: 15
- Total pull request authors: 2
- Average comments per issue: 1.36
- Average comments per pull request: 0.75
- Merged pull requests: 7
- Bot issues: 0
- Bot pull requests: 0
Past Year
- Issues: 5
- Pull requests: 0
- Average time to close issues: 2 months
- Average time to close pull requests: N/A
- Issue authors: 4
- Pull request authors: 0
- Average comments per issue: 2.4
- Average comments per pull request: 0
- Merged pull requests: 0
- Bot issues: 0
- Bot pull requests: 0
Top Authors
Issue Authors
- niekdt (61)
- hichew22 (5)
- zh-zhang1984 (2)
- yuwenhuang717 (1)
- Leprechault (1)
- janstochl (1)
- knokknok (1)
- thomasp85 (1)
Pull Request Authors
- niekdt (7)
- olivroy (1)
Top Labels
Issue Labels
Pull Request Labels
Packages
- Total packages: 1
-
Total downloads:
- cran 502 last-month
- Total dependent packages: 0
- Total dependent repositories: 0
- Total versions: 13
- Total maintainers: 1
cran.r-project.org: latrend
A Framework for Clustering Longitudinal Data
- Homepage: https://github.com/niekdt/latrend
- Documentation: http://cran.r-project.org/web/packages/latrend/latrend.pdf
- License: GPL-2 | GPL-3 [expanded from: GPL (≥ 2)]
-
Latest release: 1.6.2
published 8 months ago
Rankings
Maintainers (1)
Dependencies
- R >= 3.6.0 depends
- R.utils * imports
- Rdpack * imports
- assertthat >= 0.2.1 imports
- data.table >= 1.12.0 imports
- foreach * imports
- magrittr * imports
- matrixStats * imports
- methods * imports
- rlang * imports
- rmarkdown >= 1.18 imports
- stats * imports
- akmedoids >= 1.3.0 suggests
- caret * suggests
- clusterCrit * suggests
- covr * suggests
- crimCV * suggests
- devtools * suggests
- doParallel * suggests
- dplyr * suggests
- dtwclust * suggests
- evaluate * suggests
- fda * suggests
- flexmix * suggests
- funFEM * suggests
- ggplot2 * suggests
- gridExtra * suggests
- igraph * suggests
- kml >= 2.4.1 suggests
- knitr >= 1.24 suggests
- lcmm >= 1.9.3 suggests
- lintr * suggests
- lme4 * suggests
- longitudinalData >= 2.4.1 suggests
- mclust * suggests
- mclustcomp * suggests
- mixAK * suggests
- mixtools * suggests
- pkgdown * suggests
- psych * suggests
- qqplotr * suggests
- rcmdcheck * suggests
- roxygen2 >= 7.1.0 suggests
- simTool * suggests
- testthat >= 3.0.0 suggests
- tibble * suggests
- tinytex * suggests
- actions/checkout v2 composite
- r-lib/actions/check-r-package v2 composite
- r-lib/actions/setup-pandoc v1 composite
- r-lib/actions/setup-r v2 composite
- r-lib/actions/setup-renv v2 composite
- r-lib/actions/setup-tinytex v1 composite
- actions/checkout v2 composite
- r-lib/actions/setup-pandoc v2 composite
- r-lib/actions/setup-r v2 composite
- r-lib/actions/setup-renv v2 composite
- actions/checkout v2 composite
- r-lib/actions/setup-r v2 composite
- r-lib/actions/setup-renv v2 composite