{"id":32200555,"url":"https://github.com/ropensci/mctq","last_synced_at":"2026-02-19T08:35:20.293Z","repository":{"id":43442020,"uuid":"325638383","full_name":"ropensci/mctq","owner":"ropensci","description":"☀️ Toolkit for the Munich ChronoType Questionnaire","archived":false,"fork":false,"pushed_at":"2025-01-04T07:52:33.000Z","size":5307,"stargazers_count":13,"open_issues_count":14,"forks_count":2,"subscribers_count":3,"default_branch":"main","last_synced_at":"2026-01-27T02:51:34.316Z","etag":null,"topics":["biological-rhythm","chronobiology","chronotype","circadian-phenotype","circadian-rhythm","entrainment","mctq","peer-reviewed","r","r-package","sleep","temporal-phenotype"],"latest_commit_sha":null,"homepage":"https://docs.ropensci.org/mctq","language":"R","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ropensci.png","metadata":{"files":{"readme":"README.md","changelog":"NEWS.md","contributing":".github/CONTRIBUTING.md","funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":"CITATION.cff","codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":"codemeta.json","zenodo":null},"funding":{"github":["danielvartan"]}},"created_at":"2020-12-30T20:06:29.000Z","updated_at":"2026-01-08T21:05:20.000Z","dependencies_parsed_at":"2025-01-04T20:03:08.332Z","dependency_job_id":null,"html_url":"https://github.com/ropensci/mctq","commit_stats":{"total_commits":252,"total_committers":3,"mean_commits":84.0,"dds":0.007936507936507908,"last_synced_commit":"79ac6c980a7ee88950924ef2c758816c7f13d138"},"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"purl":"pkg:github/ropensci/mctq","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ropensci%2Fmctq","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ropensci%2Fmctq/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ropensci%2Fmctq/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ropensci%2Fmctq/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ropensci","download_url":"https://codeload.github.com/ropensci/mctq/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ropensci%2Fmctq/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29532428,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-17T03:01:11.216Z","status":"ssl_error","status_checked_at":"2026-02-17T03:00:31.803Z","response_time":100,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["biological-rhythm","chronobiology","chronotype","circadian-phenotype","circadian-rhythm","entrainment","mctq","peer-reviewed","r","r-package","sleep","temporal-phenotype"],"created_at":"2025-10-22T03:51:57.236Z","updated_at":"2026-02-19T08:35:20.276Z","avatar_url":"https://github.com/ropensci.png","language":"R","funding_links":["https://github.com/sponsors/danielvartan"],"categories":[],"sub_categories":[],"readme":"# mctq \u003ca href = \"https://docs.ropensci.org/mctq/\"\u003e\u003cimg src = \"man/figures/logo.png\" align=\"right\" height=\"139\" /\u003e\u003c/a\u003e\n\n\u003c!-- badges: start --\u003e\n[![Status at rOpenSci Software Peer\nReview](https://badges.ropensci.org/434_status.svg)](https://github.com/ropensci/software-review/issues/434)\n[![Repo\nstatus](https://www.repostatus.org/badges/latest/active.svg)](https://www.repostatus.org/#active)\n[![CRAN\nstatus](https://www.r-pkg.org/badges/version/mctq)](https://cran.r-project.org/package=mctq)\n[![CRAN\nDOI](http://img.shields.io/badge/DOI-10.32614/CRAN.package.mctq-1284C5.svg)](https://doi.org/10.32614/CRAN.package.mctq)\n[![CRAN\ndownloads](https://cranlogs.r-pkg.org/badges/grand-total/mctq)](https://danielvartan.shinyapps.io/cran-logs/?package=mctq)\n[![R-universe](https://ropensci.r-universe.dev/badges/mctq)](https://ropensci.r-universe.dev)\n[![Lifecycle:\nmaturing](https://img.shields.io/badge/lifecycle-maturing-blue.svg)](https://lifecycle.r-lib.org/articles/stages.html#maturing)\n[![R-CMD-check](https://github.com/ropensci/mctq/workflows/R-CMD-check/badge.svg)](https://github.com/ropensci/mctq/actions)\n[![Codecov test\ncoverage](https://codecov.io/gh/ropensci/mctq/branch/main/graph/badge.svg)](https://app.codecov.io/gh/ropensci/mctq?branch=main)\n[![License:\nMIT](https://img.shields.io/badge/license-MIT-green)](https://choosealicense.com/licenses/mit/)\n[![fair-software.eu](https://img.shields.io/badge/fair--software.eu-%E2%97%8F%20%20%E2%97%8F%20%20%E2%97%8F%20%20%E2%97%8F%20%20%E2%97%8F-green)](https://fair-software.eu)\n[![CII Best\nPractices](https://bestpractices.coreinfrastructure.org/projects/6244/badge)](https://bestpractices.coreinfrastructure.org/projects/6244)\n\u003c!-- badges: end --\u003e\n\n## Overview\n\n`mctq` is an R package that provides a complete toolkit to process the\nMunich ChronoType Questionnaire (MCTQ), a quantitative and validated\ntool to assess chronotypes using individuals’ sleep behavior, as\npresented by Till Roenneberg, Anna Wirz-Justice, and Martha Merrow in\n[2003](https://doi.org/10.1177/0748730402239679). Its aim is to\nfacilitate the work of sleep and chronobiology scientists with MCTQ data\nand improve reproducibility in research.\n\n`mctq` adheres to the [tidyverse\nprinciples](https://tidyverse.tidyverse.org/articles/manifesto.html) and\nintegrates with the [tidyverse ecosystem](https://www.tidyverse.org/).\n\nLearn more about the MCTQ questionnaire at\n\u003chttps://www.thewep.org/documentations/mctq\u003e.\n\n### Why an R package for a questionnaire?\n\nAlthough it may seem like a simple questionnaire, MCTQ requires\nextensive date/time manipulation, which poses challenges for many\nscientists. The `mctq` package addresses this issue by providing tools\nto handle the processing tasks for the three MCTQ versions (standard,\nmicro, and shift) with few dependencies, relying mainly on the\n[lubridate](https://lubridate.tidyverse.org/) and\n[hms](https://hms.tidyverse.org/) packages from\n[tidyverse](https://www.tidyverse.org/).\n\nWe designed `mctq` with user experience in mind, creating an interface\nthat resembles the questionnaire data as shown in MCTQ publications and\nproviding extensive documentation about each computation proposed by the\nMCTQ authors. The package also includes fictional datasets for testing\nand learning purposes.\n\n## Prerequisites\n\nYou need some familiarity with the [R programming\nlanguage](https://www.r-project.org/) and the\n[lubridate](https://lubridate.tidyverse.org/) and\n[hms](https://hms.tidyverse.org/) packages from\n[tidyverse](https://www.tidyverse.org/) to use `mctq`’s main functions.\n\nIf you are new to R, we recommend Hadley Wickham and Garrett Grolemund’s\nfree online book [R for Data Science](https://r4ds.hadley.nz/) and the\nCoursera course from Johns Hopkins University [Data Science: Foundations\nusing\nR](https://www.coursera.org/specializations/data-science-foundations-r)\n(free for audit students).\n\nPlease refer to the [lubridate](https://lubridate.tidyverse.org/) and\n[hms](https://hms.tidyverse.org/) documentation to learn more about\nhandling date/time data in R. We also recommend reading the [Dates and\ntimes](https://r4ds.hadley.nz/datetimes) chapter from Wickham \u0026\nGrolemund’s book [R for Data Science](https://r4ds.hadley.nz/).\n\n## Installation\n\nYou can install the released version of `mctq` from\n[CRAN](https://CRAN.R-project.org/package=mctq) with:\n\n``` r\ninstall.packages(\"mctq\")\n```\n\nAnd the development version from [GitHub](https://github.com/) with:\n\n``` r\n# install.packages(\"remotes\")\nremotes::install_github(\"ropensci/mctq\")\n```\n\n## Usage\n\n`mctq` uses the [lubridate](https://lubridate.tidyverse.org/) and\n[hms](https://hms.tidyverse.org/) packages, which provide special\nobjects to handle date/time values in R. Ensure your dataset conforms to\nthis structure before using `mctq`. Refer to the respective package\ndocumentation for more details.\n\nBecause of the [circular nature of time](https://youtu.be/eelVqfm8vVc),\nusing appropriate temporal objects is crucial to avoid computation\nmistakes while adapting data from a base 10 to a base 12 numerical\nsystem.\n\nFor detailed usage instructions, visit our [Get started\nguide](https://docs.ropensci.org/mctq/articles/mctq.html).\n\n### Workdays and work-free days variables\n\nAfter preparing your data, use the following `mctq` functions to process\nit. The function names follow the patterns used in MCTQ publications,\nmaking it easy to apply the necessary computations:\n\n- `fd()`: compute MCTQ work-free days.\n- `so()`: compute MCTQ local time of sleep onset.\n- `gu()`: compute MCTQ local time of getting out of bed.\n- `sdu()`: compute MCTQ sleep duration.\n- `tbt()`: compute MCTQ total time in bed.\n- `msl()`: compute MCTQ local time of mid-sleep.\n- `napd()`: compute MCTQ nap duration (only for MCTQ Shift).\n- `sd24()`: compute MCTQ 24 hours sleep duration (only for MCTQ Shift).\n\nExample:\n\n``` r\n# Local time of preparing to sleep on workdays\nsprep_w \u003c- c(hms::parse_hm(\"23:45\"), hms::parse_hm(\"02:15\"))\n# Sleep latency or time to fall asleep after preparing to sleep on workdays\nslat_w \u003c- c(lubridate::dminutes(30), lubridate::dminutes(90))\n# Local time of sleep onset on workdays\nso(sprep_w, slat_w)\n```\n\n    00:15:00\n    03:45:00\n\n### Combining workdays and work-free days variables\n\nFor computations combining workdays and work-free days, use:\n\n- `sd_week()`: compute MCTQ average weekly sleep duration.\n- `sd_overall()`: compute MCTQ overall sleep duration (only for MCTQ\n  Shift).\n- `sloss_week()`: compute MCTQ weekly sleep loss.\n- `le_week()`: compute MCTQ average weekly light exposure.\n- `msf_sc()`: compute MCTQ chronotype or sleep-corrected local time of\n  mid-sleep on work-free days.\n- `sjl()` and `sjl_rel()`: compute MCTQ social jet lag.\n- `sjl_sc()` and `sjl_sc_rel()`: compute Jankowski’s MCTQ\n  sleep-corrected social jetlag.\n- `sjl_weighted()`: compute MCTQ absolute social jetlag across all\n  shifts (only for MCTQ Shift).\n\nExample:\n\n``` r\n# Local time of mid-sleep on workdays\nmsw \u003c- c(hms::parse_hm(\"02:05\"), hms::parse_hm(\"04:05\"))\n# Local time of mid-sleep on work-free days\nmsf \u003c- c(hms::parse_hm(\"23:05\"), hms::parse_hm(\"08:30\"))\n# Relative social jetlag\nsjl_rel(msw, msf)\n```\n\n    [1] \"-10800s (~-3 hours)\"  \"15900s (~4.42 hours)\"\n\n### Utilities\n\n`mctq` includes utility tools to help with your MCTQ data and provides\nfictional datasets for the standard, micro, and shift MCTQ versions for\ntesting and learning purposes.\n\nAll functions are documented with guidelines behind the computations.\nClick [here](https://docs.ropensci.org/mctq/reference/index.html) to see\nthe full list.\n\n## Citation\n\nIf you use `mctq` in your research, please consider citing it. We put\nsignificant effort into building and maintaining this free and\nopen-source R package. Find the citation below.\n\n``` r\ncitation(\"mctq\")\n```\n\n    To cite {mctq} in publications use:\n\n      Vartanian, D. (2025). {mctq}: Munich ChronoType Questionnaire tools\n      (Version 0.3.2.9001) [Computer software - R package]. CRAN; rOpenSci.\n      https://doi.org/10.32614/CRAN.package.mctq\n\n    A BibTeX entry for LaTeX users is\n\n      @Misc{,\n        title = {{mctq}: Munich ChronoType Questionnaire tools},\n        author = {Daniel Vartanian},\n        year = {2025},\n        publisher = {CRAN; rOpenSci},\n        doi = {10.32614/CRAN.package.mctq},\n        note = {R package version 0.3.2.9001},\n      }\n\n## Contributing\n\nWe welcome contributions, including bug reports. Take a moment to review\nour [Guidelines for\nContributing](https://docs.ropensci.org/mctq/CONTRIBUTING.html).\n\n## Acknowledgments\n\nThe initial development of `mctq` was supported by a scholarship from\nthe [University of Sao Paulo (USP)](http://usp.br/) (❤️).\n\nThe `mctq` hex logo is based on an illustration by [hilda design matters\nZurich](https://hilda.ch/) for the [Daylight Academy\n(DLA)](https://daylight.academy/).\n\n\u003cbr\u003e\n\nBecome an `mctq` supporter!\n\nClick [here](https://github.com/sponsors/danielvartan) to make a\ndonation. Please indicate the `mctq` package in your donation message.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fropensci%2Fmctq","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fropensci%2Fmctq","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fropensci%2Fmctq/lists"}