{"id":19647403,"url":"https://github.com/danielvartan/actverse","last_synced_at":"2025-04-28T15:31:54.652Z","repository":{"id":40432969,"uuid":"298334922","full_name":"danielvartan/actverse","owner":"danielvartan","description":"🏃‍♀️ Actigraphy Data Analysis in R","archived":false,"fork":false,"pushed_at":"2023-09-26T04:34:07.000Z","size":2457,"stargazers_count":9,"open_issues_count":21,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-04-12T03:38:57.186Z","etag":null,"topics":["actigraphy","chronobiology","r","r-package","rstats","sleep"],"latest_commit_sha":null,"homepage":"https://danielvartan.github.io/actverse/","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/danielvartan.png","metadata":{"files":{"readme":"README.Rmd","changelog":"NEWS.md","contributing":".github/CONTRIBUTING.md","funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","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-09-24T16:28:54.000Z","updated_at":"2025-03-11T21:16:21.000Z","dependencies_parsed_at":"2023-02-14T10:45:22.716Z","dependency_job_id":"8c624592-1e21-4723-aa45-a6fd33e98630","html_url":"https://github.com/danielvartan/actverse","commit_stats":null,"previous_names":["gipso/actverse","danielvartan/actverse","giperbio/actverse"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/danielvartan%2Factverse","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/danielvartan%2Factverse/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/danielvartan%2Factverse/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/danielvartan%2Factverse/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/danielvartan","download_url":"https://codeload.github.com/danielvartan/actverse/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251338705,"owners_count":21573599,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["actigraphy","chronobiology","r","r-package","rstats","sleep"],"created_at":"2024-11-11T14:44:01.793Z","updated_at":"2025-04-28T15:31:49.614Z","avatar_url":"https://github.com/danielvartan.png","language":"R","funding_links":["https://github.com/sponsors/danielvartan"],"categories":[],"sub_categories":[],"readme":"---\noutput: github_document\n---\n\n\u003c!-- README.md is generated from README.Rmd. Please edit that file --\u003e\n\n```{r, include = FALSE}\nknitr::opts_chunk$set(\n  collapse = TRUE,\n  comment = \"#\u003e\",\n  fig.path = \"man/figures/README-\",\n  out.width = \"100%\"\n)\n\nlibrary(actverse)\nlibrary(dplyr)\nlibrary(lubridate)\nlibrary(hms)\n```\n\n# actverse\n\n\u003c!-- badges: start --\u003e\n[![Project Status: WIP – Initial development is in progress, but there has not yet been a stable, usable release suitable for the public.](https://www.repostatus.org/badges/latest/wip.svg)](https://www.repostatus.org/#wip)\n[![Lifecycle: experimental](https://img.shields.io/badge/lifecycle-experimental-orange.svg)](https://lifecycle.r-lib.org/articles/stages.html)\n[![R-CMD-check](https://github.com/giperbio/actverse/workflows/R-CMD-check/badge.svg)](https://github.com/giperbio/actverse/actions)\n[![Codecov test coverage](https://codecov.io/gh/giperbio/actverse/branch/main/graph/badge.svg)](https://app.codecov.io/gh/giperbio/actverse?branch=main)\n[![License: MIT](https://img.shields.io/badge/license-MIT-green)](https://choosealicense.com/licenses/mit/)\n[![Contributor Covenant](https://img.shields.io/badge/Contributor%20Covenant-v2.0%20adopted-ff69b4.svg)](https://giperbio.github.io/actverse/CODE_OF_CONDUCT.html)\n\u003c!-- badges: end --\u003e\n\n## Overview\n\n`actverse` is an R package that provides a complete toolkit to process, analyze and visualize actigraphy data. Its aim is to facilitate the work of sleep and chronobiology scientists with actigraphy data and to improve reproducibility in research.\n\n`actverse` adheres to the [tidyverse principles](https://tidyverse.tidyverse.org/articles/manifesto.html) and integrates with the [tidyverse ecosystem](https://www.tidyverse.org/).\n\n## Prerequisites\n\nYou need to have some familiarity with the [R programming language](https://www.r-project.org/) and with the [`tsibble`](https://tsibble.tidyverts.org/index.html) package to use `actverse` main functions.\n\nIf you don't feel comfortable with R, we strongly recommend checking Hadley Wickham and Garrett Grolemund's free and online book [R for Data Science](https://r4ds.had.co.nz/) and the Coursera course from John Hopkins University [Data Science: Foundations using R](https://www.coursera.org/specializations/data-science-foundations-r) (free for audit students).\n\nPlease refer to the [`tsibble`](https://tsibble.tidyverts.org/index.html) package documentation to learn more about it. `tsibble` is an essential package to deal with time series in R. We also recommend that you read the [Dates and times](https://r4ds.had.co.nz/dates-and-times.html) chapter from Wickham \u0026 Grolemund's book [R for Data Science](https://r4ds.had.co.nz/) and the [tsibble objects](https://otexts.com/fpp3/tsibbles.html) subchapter from Rob J. Hyndman  \u0026 George Athanasopoulos' book [Forecasting: Principles and Practice](https://otexts.com/fpp3/).\n\n## Installation\n\nYou can install `actverse` with:\n\n``` {r, eval = FALSE}\n# install.packages(\"remotes\")\nremotes::install_github(\"giperbio/actverse\")\n```\n\n## Usage\n\nThe R ecosystem has a [vast number](https://cran.r-project.org/view=TimeSeries) of time series standards and we had to choose one of them while developing `actverse`. A standard for time objects is a must, because [time can have many representations](https://youtu.be/eelVqfm8vVc) and can be rooted in  different numerical systems. We believe that the best time series standard available for packages that adheres to the [tidyverse principles](https://tidyverse.tidyverse.org/articles/manifesto.html) is the [`tsibble`](https://tsibble.tidyverts.org/index.html). As the name suggests, `tsibble` is an adaptation for time series of the [tidyverse](https://www.tidyverse.org/) [`tibble`](https://tibble.tidyverse.org/) object.\n\nMost `actverse` functions will require that your data be in the [`tsibble`](https://tsibble.tidyverts.org/index.html) standard. Adapting your data is a simple process and can make a big difference when dealing with time series in R. Please refer to [`tsibble`](https://tsibble.tidyverts.org/index.html) documentation to learn how to do this.\n\nWe also recommend seeing the [`tsbox`](https://www.tsbox.help/) package, an R\npackage that propose to be an \"universal translator\" (🖖) for R time series standards.\n\n### Read/Write\n\n* `read_acttrust()`: Read, tidy, and validate an [ActTrust](https://condorinst.com/en/acttrust-actigraph/) file.\n* `write_acttrust()`: Adapt and write a `tsibble` to a readable [ActTrust](https://condorinst.com/en/acttrust-actigraph/) file.\n\nExample:\n\n```{r message = FALSE, warning = FALSE}\nfile \u003c- get_from_zenodo(\n    doi = \"10.5281/zenodo.4898822\", path = tempdir(),\n    file = \"processed.txt\"\n)\n\ndata \u003c- read_acttrust(file, tz = \"America/Sao_Paulo\")\n\ndata\n```\n\n### Period functions\n\n* `periodogram()`: Compute Sokolove \u0026 Bushell's $\\chi^{2}$ periodogram.\n* `spectrogram()`: Compute a spectrogram based on Sokolove \u0026 Bushell's periodogram.\n\nExample:\n\n```{r message = FALSE, warning = FALSE}\nper \u003c- periodogram(data, \"pim\")\n\nspec \u003c- spectrogram(data, \"pim\")\n```\n\n### Data interpolation\n\n* `na_approx()` `na_locf()` `na_overall_mean()` `na_overall_median()` `na_overall_mode()` `na_spline()` `na_weekly_mean()` `na_zero()` `na_plot()`: Replace `NA` by interpolation.\n\nExample:\n\n```{r message = FALSE, warning = FALSE}\nx \u003c- c(NA, 1, 5, 10, NA, 5, 10, 1, NA, 10, 1, 5, NA, NA)\nindex \u003c- seq(as.Date(\"2020-01-01\"), as.Date(\"2020-01-14\"), by = \"day\")\n\nna_approx(x, index, fill_na_tips = TRUE)\nna_plot(x, index, na_approx(x, index, fill_na_tips = TRUE))\n```\n\n### API clients\n\n* `get_from_zenodo()`: Get data from a Zenodo record.\n* `get_sun_stats()`: Get sun related statistics from different APIs.\n\nExample:\n\n```{r message = FALSE, warning = FALSE}\nget_sun_stats(lat = -23.5489, lon = -46.6388, tz = \"America/Sao_Paulo\") %\u003e%\n    dplyr::as_tibble() %\u003e% \n    t()\n```\n\n### Other features\n\n`actverse` also comes with many utility functions and provides free actigraphy datasets for testing and learning purposes.\n\nAll functions are properly documented, showing all the guidelines behind the computations. Click [here](https://giperbio.github.io/actverse/) to see a list of them.\n\nExample:\n\n```{r message = FALSE, warning = FALSE}\n# Find the epochs/periodicities in a 'tsibble'\nread_acttrust(file, regularize = FALSE) %\u003e%\n    find_epoch()\n```\n\n## Citation\n\nIf you use `actverse` in your research, please consider citing it. We put a lot of work to build and maintain a free and open-source R package. You can find the citation below.\n\n```{r}\ncitation(\"actverse\")\n```\n\n## Contributing\n\nWe welcome contributions, including bug reports.\n\nTake a moment to review our [Guidelines for Contributing](https://giperbio.github.io/actverse/CONTRIBUTING.html).\n\n## Acknowledgments\n\nThe initial development of `actverse` was supported by three scholarships provided by the [University of Sao Paulo (USP)](http://usp.br/) (❤️).\n\n\u003cbr\u003e\n\nBecome an `actverse` supporter!\n\nClick [here](https://github.com/sponsors/danielvartan) to make a donation. Please indicate the `actverse` package in your donation message.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdanielvartan%2Factverse","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdanielvartan%2Factverse","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdanielvartan%2Factverse/lists"}