About

This illustration accompanies the publication “A Gentle Introduction and Application of Feature-Based Clustering with Psychological Time Series”. The aim of this illustration website is to offer a transparent, open, and accessible repository providing annotated code for all analysis steps.

Open Data

We provide all data necessary to replicate the full results of the main manuscript as well as this illustration. We specifically provide a minial reproducible dataset that includes all variables necessary to perform the analysis, while still protecting the privacy and confidentiality of the participants. All data is available as part of our Open Science repository (Kreienkamp et al., 2023a).

Open Code

The full code of this illustration as well as the main manuscript is available as part of our GitHub repository (Kreienkamp et al., 2023b). A minimal version of the code as well as an archive file are available in our Open Science repository (Kreienkamp et al., 2023a). For convenience purposes, we have also collected a number of functions we created as part of the illustration as an R-package. This package is available as its own GitHub repository and can be downloaded with the devtools package devtools::install_github("JannisCodes/tsFeatureExtracR"), you can also download the R package here (Kreienkamp et al., 2023c).

Software Information

The full session information with all relevant system information and all loaded and installed packages is available in the collapsible section below.

System Info

R environment session info for reproducibility of results
Setting Value
version R version 4.4.1 (2024-06-14)
os macOS 15.1
system x86_64, darwin20
ui X11
language (EN)
collate en_US.UTF-8
ctype en_US.UTF-8
tz Europe/Amsterdam
date 2024-11-13
pandoc 3.3 @ /usr/local/bin/ (via rmarkdown)

Package Info

Package info for reproducibility of results
Package Loaded version Date Source
bibtex 0.5.1 2023-01-26 CRAN (R 4.4.0)
devtools 2.4.5 2022-10-11 CRAN (R 4.4.0)
dplyr 1.0.9 2022-04-28 CRAN (R 4.4.1)
factoextra 1.0.7 2020-04-01 CRAN (R 4.4.0)
forcats 0.5.1 2021-01-27 CRAN (R 4.4.1)
fpc 2.2-13 2024-09-24 CRAN (R 4.4.1)
ggplot2 3.5.1 2024-04-23 CRAN (R 4.4.0)
grateful 0.2.10 2024-09-04 CRAN (R 4.4.1)
htmltools 0.5.8.1 2024-04-04 CRAN (R 4.4.0)
kableExtra 1.4.0 2024-01-24 CRAN (R 4.4.0)
knitcitations 1.0.12 2021-01-10 CRAN (R 4.4.0)
knitr 1.39 2022-04-26 CRAN (R 4.4.1)
lubridate 1.8.0 2021-10-07 CRAN (R 4.4.1)
NbClust 3.0.1 2022-05-02 CRAN (R 4.4.0)
pander 0.6.5 2022-03-18 CRAN (R 4.4.0)
plotly 4.10.4 2024-01-13 CRAN (R 4.4.0)
purrr 0.3.4 2020-04-17 CRAN (R 4.4.1)
readr 2.1.2 2022-01-30 CRAN (R 4.4.1)
readxl 1.4.0 2022-03-28 CRAN (R 4.4.1)
reshape 0.8.9 2022-04-12 CRAN (R 4.4.0)
rmarkdown 2.14 2022-04-25 CRAN (R 4.4.1)
stringr 1.4.0 2019-02-10 CRAN (R 4.4.1)
tibble 3.1.7 2022-05-03 CRAN (R 4.4.1)
tidyr 1.2.0 2022-02-01 CRAN (R 4.4.1)
tidyverse 2.0.0 2023-02-22 CRAN (R 4.4.0)
tsFeatureExtracR 0.1.0 2024-11-13 local
usethis 3.0.0 2024-07-29 CRAN (R 4.4.0)

Full Session Info (including loaded but unattached packages — for troubleshooting only)

R version 4.4.1 (2024-06-14)

Platform: x86_64-apple-darwin20

locale: en_US.UTF-8||en_US.UTF-8||en_US.UTF-8||C||en_US.UTF-8||en_US.UTF-8

attached base packages:

  • stats
  • graphics
  • grDevices
  • datasets
  • utils
  • methods
  • base

other attached packages:

  • bibtex(v.0.5.1)
  • grateful(v.0.2.10)
  • knitcitations(v.1.0.12)
  • pander(v.0.6.5)
  • devtools(v.2.4.5)
  • usethis(v.3.0.0)
  • NbClust(v.3.0.1)
  • htmltools(v.0.5.8.1)
  • plotly(v.4.10.4)
  • reshape(v.0.8.9)
  • readxl(v.1.4.0)
  • fpc(v.2.2-13)
  • factoextra(v.1.0.7)
  • tsFeatureExtracR(v.0.1.0)
  • kableExtra(v.1.4.0)
  • lubridate(v.1.8.0)
  • forcats(v.0.5.1)
  • stringr(v.1.4.0)
  • dplyr(v.1.0.9)
  • purrr(v.0.3.4)
  • readr(v.2.1.2)
  • tidyr(v.1.2.0)
  • tibble(v.3.1.7)
  • ggplot2(v.3.5.1)
  • tidyverse(v.2.0.0)
  • knitr(v.1.39)
  • rmarkdown(v.2.14)

loaded via a namespace (and not attached):

  • rstudioapi(v.0.13)
  • jsonlite(v.1.8.9)
  • shape(v.1.4.6.1)
  • magrittr(v.2.0.3)
  • jomo(v.2.7-6)
  • modeltools(v.0.2-23)
  • nloptr(v.2.0.3)
  • fs(v.1.6.5)
  • vctrs(v.0.6.5)
  • RefManageR(v.1.4.0)
  • memoise(v.2.0.1)
  • minqa(v.1.2.4)
  • broom(v.1.0.0)
  • cellranger(v.1.1.0)
  • mitml(v.0.4-5)
  • htmlwidgets(v.1.5.4)
  • plyr(v.1.8.7)
  • cachem(v.1.0.6)
  • mime(v.0.12)
  • lifecycle(v.1.0.4)
  • iterators(v.1.0.14)
  • pkgconfig(v.2.0.3)
  • Matrix(v.1.4-1)
  • R6(v.2.5.1)
  • fastmap(v.1.2.0)
  • shiny(v.1.9.1)
  • digest(v.0.6.37)
  • colorspace(v.2.0-3)
  • ps(v.1.8.1)
  • pkgload(v.1.4.0)
  • fansi(v.1.0.3)
  • httr(v.1.4.3)
  • mgcv(v.1.8-40)
  • compiler(v.4.4.1)
  • remotes(v.2.4.2)
  • withr(v.2.5.0)
  • backports(v.1.4.1)
  • DBI(v.1.1.3)
  • psych(v.2.2.5)
  • highr(v.0.9)
  • pkgbuild(v.1.3.1)
  • pan(v.1.9)
  • MASS(v.7.3-61)
  • sessioninfo(v.1.2.2)
  • tools(v.4.4.1)
  • prabclus(v.2.3-4)
  • httpuv(v.1.6.15)
  • nnet(v.7.3-19)
  • glue(v.1.6.2)
  • callr(v.3.7.6)
  • nlme(v.3.1-158)
  • promises(v.1.3.0)
  • grid(v.4.4.1)
  • cluster(v.2.1.3)
  • generics(v.0.1.2)
  • gtable(v.0.3.0)
  • tzdb(v.0.3.0)
  • class(v.7.3-22)
  • data.table(v.1.14.2)
  • hms(v.1.1.1)
  • xml2(v.1.3.6)
  • utf8(v.1.2.2)
  • flexmix(v.2.3-19)
  • ggrepel(v.0.9.6)
  • foreach(v.1.5.2)
  • pillar(v.1.7.0)
  • later(v.1.3.2)
  • robustbase(v.0.99-4-1)
  • splines(v.4.4.1)
  • lattice(v.0.20-45)
  • renv(v.0.15.5)
  • survival(v.3.7-0)
  • tidyselect(v.1.1.2)
  • miniUI(v.0.1.1.1)
  • svglite(v.2.1.3)
  • stats4(v.4.4.1)
  • xfun(v.0.31)
  • diptest(v.0.77-1)
  • DEoptimR(v.1.1-3)
  • stringi(v.1.7.6)
  • lazyeval(v.0.2.2)
  • yaml(v.2.3.5)
  • boot(v.1.3-28)
  • evaluate(v.0.15)
  • codetools(v.0.2-18)
  • kernlab(v.0.9-33)
  • cli(v.3.6.3)
  • rpart(v.4.1.16)
  • xtable(v.1.8-4)
  • systemfonts(v.1.1.0)
  • munsell(v.0.5.0)
  • processx(v.3.8.4)
  • Rcpp(v.1.0.8.3)
  • parallel(v.4.4.1)
  • ellipsis(v.0.3.2)
  • assertthat(v.0.2.1)
  • prettyunits(v.1.1.1)
  • mclust(v.6.1.1)
  • profvis(v.0.3.8)
  • urlchecker(v.1.0.1)
  • lme4(v.1.1-29)
  • glmnet(v.4.1-8)
  • viridisLite(v.0.4.0)
  • ggthemes(v.4.2.4)
  • scales(v.1.3.0)
  • crayon(v.1.5.1)
  • rlang(v.1.1.4)
  • mnormt(v.2.1.0)
  • mice(v.3.16.0)

References

(R Core Team, 2024) (Francois & Hernangómez, 2023) (Wickham, Hester, Chang, et al., 2022) (Wickham, François, et al., 2022) (Kassambara & Mundt, 2020) (Wickham, 2021) (Hennig, 2024) (Wickham, Chang, et al., 2024) (Rodriguez-Sanchez & Jackson, 2024) (Cheng et al., 2024) (Zhu, 2024) (Boettiger, 2021) (Xie, 2022) (Spinu et al., 2021) (Charrad et al., 2022) (Daróczi & Tsegelskyi, 2022) (Sievert et al., 2024) (Henry & Wickham, 2020) (Wickham, Hester, & Bryan, 2022) (Wickham & Bryan, 2022) (Wickham, 2022) (Allaire et al., 2022) (Wickham, 2019) (Müller & Wickham, 2022) (Wickham & Girlich, 2022) (Wickham, 2023) (Kreienkamp, 2023) (Wickham, Bryan, et al., 2024) (Wickham, 2016) (Rodriguez-Sanchez & Jackson, 2023) (Xie, 2015) (Xie, 2014) (Grolemund & Wickham, 2011) (Charrad et al., 2014) (Sievert, 2020) (Wickham, 2007) (Xie et al., 2018) (Xie et al., 2020) (Wickham et al., 2019)
Allaire, J., Xie, Y., McPherson, J., Luraschi, J., Ushey, K., Atkins, A., Wickham, H., Cheng, J., Chang, W., & Iannone, R. (2022). Rmarkdown: Dynamic documents for r. https://CRAN.R-project.org/package=rmarkdown
Boettiger, C. (2021). Knitcitations: Citations for knitr markdown files. https://github.com/cboettig/knitcitations
Charrad, M., Ghazzali, N., Boiteau, V., & Niknafs, A. (2014). NbClust: An R package for determining the relevant number of clusters in a data set. Journal of Statistical Software, 61(6), 1–36. https://www.jstatsoft.org/v61/i06/
Charrad, M., Ghazzali, N., Boiteau, V., & Niknafs, A. (2022). NbClust: Determining the best number of clusters in a data set. https://sites.google.com/site/malikacharrad/research/nbclust-package
Cheng, J., Sievert, C., Schloerke, B., Chang, W., Xie, Y., & Allen, J. (2024). Htmltools: Tools for HTML. https://CRAN.R-project.org/package=htmltools
Daróczi, G., & Tsegelskyi, R. (2022). Pander: An r pandoc writer. https://rapporter.github.io/pander/
Francois, R., & Hernangómez, D. (2023). Bibtex: Bibtex parser. https://CRAN.R-project.org/package=bibtex
Grolemund, G., & Wickham, H. (2011). Dates and times made easy with lubridate. Journal of Statistical Software, 40(3), 1–25. https://www.jstatsoft.org/v40/i03/
Hennig, C. (2024). Fpc: Flexible procedures for clustering. https://www.unibo.it/sitoweb/christian.hennig/en/
Henry, L., & Wickham, H. (2020). Purrr: Functional programming tools. https://CRAN.R-project.org/package=purrr
Kassambara, A., & Mundt, F. (2020). Factoextra: Extract and visualize the results of multivariate data analyses. http://www.sthda.com/english/rpkgs/factoextra
Kreienkamp, J. (2023). tsFeatureExtracR: Functions for feature extraction, feature missingness analysis and imputation.
Kreienkamp, J., Agostini, M., Monden, R., Epstude, K., Jonge, P. de, & Bringmann, L. F. (2023a). Feature-Based Clustering of Psychological Time Series [OSF repository: Materials, data, code]. https://osf.io/j8dzv/?view_only=c765efa51e6545e588b29999611eb789
Kreienkamp, J., Agostini, M., Monden, R., Epstude, K., Jonge, P. de, & Bringmann, L. F. (2023b). Migration-trajectories [GitHub repository: Materials, computer code]. https://janniscodes.github.io/migration-trajectories/
Kreienkamp, J., Agostini, M., Monden, R., Epstude, K., Jonge, P. de, & Bringmann, L. F. (2023c). tsFeatureExtracR. doi.org/10.5281/zenodo.8221675
Müller, K., & Wickham, H. (2022). Tibble: Simple data frames. https://CRAN.R-project.org/package=tibble
R Core Team. (2024). R: A language and environment for statistical computing. R Foundation for Statistical Computing. https://www.R-project.org/
Rodriguez-Sanchez, F., & Jackson, C. P. (2023). Grateful: Facilitate citation of r packages. https://pakillo.github.io/grateful/
Rodriguez-Sanchez, F., & Jackson, C. P. (2024). Grateful: Facilitate citation of r packages. https://pakillo.github.io/grateful/
Sievert, C. (2020). Interactive web-based data visualization with r, plotly, and shiny. Chapman; Hall/CRC. https://plotly-r.com
Sievert, C., Parmer, C., Hocking, T., Chamberlain, S., Ram, K., Corvellec, M., & Despouy, P. (2024). Plotly: Create interactive web graphics via plotly.js. https://CRAN.R-project.org/package=plotly
Spinu, V., Grolemund, G., & Wickham, H. (2021). Lubridate: Make dealing with dates a little easier. https://CRAN.R-project.org/package=lubridate
Wickham, H. (2007). Reshaping data with the reshape package. Journal of Statistical Software, 21(12). https://www.jstatsoft.org/v21/i12/
Wickham, H. (2016). ggplot2: Elegant graphics for data analysis. Springer-Verlag New York. https://ggplot2.tidyverse.org
Wickham, H. (2019). Stringr: Simple, consistent wrappers for common string operations. https://CRAN.R-project.org/package=stringr
Wickham, H. (2021). Forcats: Tools for working with categorical variables (factors). https://CRAN.R-project.org/package=forcats
Wickham, H. (2022). Reshape: Flexibly reshape data. http://had.co.nz/reshape
Wickham, H. (2023). Tidyverse: Easily install and load the tidyverse. https://CRAN.R-project.org/package=tidyverse
Wickham, H., Averick, M., Bryan, J., Chang, W., McGowan, L. D., François, R., Grolemund, G., Hayes, A., Henry, L., Hester, J., Kuhn, M., Pedersen, T. L., Miller, E., Bache, S. M., Müller, K., Ooms, J., Robinson, D., Seidel, D. P., Spinu, V., … Yutani, H. (2019). Welcome to the tidyverse. Journal of Open Source Software, 4(43), 1686. https://doi.org/10.21105/joss.01686
Wickham, H., & Bryan, J. (2022). Readxl: Read excel files. https://CRAN.R-project.org/package=readxl
Wickham, H., Bryan, J., Barrett, M., & Teucher, A. (2024). Usethis: Automate package and project setup. https://CRAN.R-project.org/package=usethis
Wickham, H., Chang, W., Henry, L., Pedersen, T. L., Takahashi, K., Wilke, C., Woo, K., Yutani, H., Dunnington, D., & van den Brand, T. (2024). ggplot2: Create elegant data visualisations using the grammar of graphics. https://CRAN.R-project.org/package=ggplot2
Wickham, H., François, R., Henry, L., & Müller, K. (2022). Dplyr: A grammar of data manipulation. https://CRAN.R-project.org/package=dplyr
Wickham, H., & Girlich, M. (2022). Tidyr: Tidy messy data. https://CRAN.R-project.org/package=tidyr
Wickham, H., Hester, J., & Bryan, J. (2022). Readr: Read rectangular text data. https://CRAN.R-project.org/package=readr
Wickham, H., Hester, J., Chang, W., & Bryan, J. (2022). Devtools: Tools to make developing r packages easier. https://CRAN.R-project.org/package=devtools
Xie, Y. (2014). Knitr: A comprehensive tool for reproducible research in R. In V. Stodden, F. Leisch, & R. D. Peng (Eds.), Implementing reproducible computational research. Chapman; Hall/CRC. http://www.crcpress.com/product/isbn/9781466561595
Xie, Y. (2015). Dynamic documents with R and knitr (2nd ed.). Chapman; Hall/CRC. https://yihui.org/knitr/
Xie, Y. (2022). Knitr: A general-purpose package for dynamic report generation in r. https://yihui.org/knitr/
Xie, Y., Allaire, J. J., & Grolemund, G. (2018). R markdown: The definitive guide. Chapman; Hall/CRC. https://bookdown.org/yihui/rmarkdown
Xie, Y., Dervieux, C., & Riederer, E. (2020). R markdown cookbook. Chapman; Hall/CRC. https://bookdown.org/yihui/rmarkdown-cookbook
Zhu, H. (2024). kableExtra: Construct complex table with kable and pipe syntax. https://CRAN.R-project.org/package=kableExtra