{"id":13449296,"url":"https://github.com/dewittpe/REDCapExporter","last_synced_at":"2025-03-22T22:32:29.775Z","repository":{"id":56935279,"uuid":"170775498","full_name":"dewittpe/REDCapExporter","owner":"dewittpe","description":"R package to export data from REDCap projects via the REDCap API","archived":false,"fork":false,"pushed_at":"2024-11-06T18:46:51.000Z","size":2121,"stargazers_count":2,"open_issues_count":5,"forks_count":0,"subscribers_count":4,"default_branch":"main","last_synced_at":"2024-11-06T19:27:59.240Z","etag":null,"topics":["api","data-export","r","r-package","redcap","redcap-api"],"latest_commit_sha":null,"homepage":"http://www.peteredewitt.com/REDCapExporter/","language":"R","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/dewittpe.png","metadata":{"files":{"readme":"README.Rmd","changelog":"NEWS.md","contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-02-15T00:04:48.000Z","updated_at":"2024-11-06T18:45:14.000Z","dependencies_parsed_at":"2024-10-28T15:37:02.066Z","dependency_job_id":null,"html_url":"https://github.com/dewittpe/REDCapExporter","commit_stats":{"total_commits":150,"total_committers":3,"mean_commits":50.0,"dds":0.2533333333333333,"last_synced_commit":"453d79412addfc0e1641a4845e0d298815cc4240"},"previous_names":[],"tags_count":8,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dewittpe%2FREDCapExporter","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dewittpe%2FREDCapExporter/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dewittpe%2FREDCapExporter/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dewittpe%2FREDCapExporter/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dewittpe","download_url":"https://codeload.github.com/dewittpe/REDCapExporter/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245028993,"owners_count":20549634,"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":["api","data-export","r","r-package","redcap","redcap-api"],"created_at":"2024-07-31T06:00:35.143Z","updated_at":"2025-03-22T22:32:29.764Z","avatar_url":"https://github.com/dewittpe.png","language":"R","funding_links":[],"categories":["Tools"],"sub_categories":[],"readme":"\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  out.width = \"100%\"\n)\n```\n\n# REDCapExporter\n\n\u003c!-- badges: start --\u003e\n![R-CMD-check](https://github.com/dewittpe/REDCapExporter/workflows/R-CMD-check/badge.svg)\n[![Codecov test coverage](https://codecov.io/gh/dewittpe/REDCapExporter/graph/badge.svg)](https://app.codecov.io/gh/dewittpe/REDCapExporter)\n[![CRAN_Status_Badge](https://www.r-pkg.org/badges/version/REDCapExporter)](https://cran.r-project.org/package=REDCapExporter)\n[![CRAN RStudio mirror downloads](https://cranlogs.r-pkg.org/badges/REDCapExporter)](http://www.r-pkg.org/pkg/REDCapExporter)\n[![CRAN RStudio mirror downloads](https://cranlogs.r-pkg.org/badges/grand-total/REDCapExporter)](http://www.r-pkg.org/pkg/REDCapExporter)\n\u003c!-- badges: end --\u003e\n\nThe goal of REDCapExporter is to provide a simple and relatively secure way to\ndownloading and formatting data from a [REDCap](https://www.project-redcap.org/)\nproject.\n\nWhile REDCap (**R**esearch **E**lectronic **D**ata **Cap**ture) is a fantastic\ntool for data capture, the dissemination of the collected data in a format that\nmultiple data analysis can easily access and share can be improved.  The\nREDCapExporter package provides a set of tools to provide easy access to REDCap\ndata via the REDCap API with two aims:\n\n1. Scripting functions to allow for easy access to, and formatting of, a data\n   set within a REDCap project.\n2. Produce a skeleton R data package to house, document, archive, and\n   disseminate a data set.\n\n_Why is REDCapExporter needed?_\n\nIf you are familiar with REDCap then you know that exporting the data from the\nweb interface is straight forward, easy to use, and powerful.  However, there is\na fair amount of (meta) data that could be valuable to data analysis which is\nnot included in the export.  The REDCapExporter aims to report and cross link\nthe meta data, collected data, and (expanded) documentation in one location.\nThe resulting `.tar.gz` data package is easy to disseminate.\n\nVersion control of data is difficult.  Small data files can easily be added to\ngit repositories, and larger files using git-lfs.  Subversion can handle larger\ndata sets with its own pros and cons.  However, adding the data to multiple\nrepositories will consume a lot of disk space unnecessarily  and there are issues\narising from sensitive data being versioned and while using public repository\nhosts.  A R data package will provide an implicit versioning of data while\nkeeping only one copy of the data on the local disk.\n\n## Installation\n\nInstall the released version from CRAN:\n```{r, eval = FALSE}\ninstall.packages(\"REDCapExporter\", repos = \"https://cran.rstudio.com\")\n```\n\nYou can install the development version of REDCapExporter from\n[GitHub](https://github.com/) with:\n\n```{r, eval = FALSE}\n# install.packages(\"pak\")\npak::pak(\"dewittpe/REDCapExporter\")\n```\n\n## Expected Use Case\n\nYou have multiple REDCap projects and you have an API token for each project\nallowing for data download.\n\n### Dealing with API Tokens\n\nThere are several ways to do this.  A simple way is based on the\n[keyring](https://keyring.r-lib.org/) package.\n\n```{r, eval = FALSE}\nlibrary(REDCapExporter)\n\n# Check if a file based keyring called \"REDCapExporter\" exists and create one if\n# not.\nREDCapExporter_keyring_check()\n\n# Add, or verify existance of, an API token for PROJECT1\nREDCapExporter_add_api_token(\"PROJECT1\")\n\n# Add, or verify existance of, an API token for PROJECT2\nREDCapExporter_add_api_token(\"PROJECT2\")\n```\n\nTo set the token to use for the current session,\nset an environmental variable and use\n`REDCapExporter_get_api_token` to retrieve the token from the keyring.\n\n```{r, eval = FALSE}\nSys.setenv(REDCap_API_TOKEN = REDCapExporter_get_api_token(\"PROJECT1\"))\n```\n\n### Export data from REDCap\n\nYou may set one more environmental variable, or specify it explicitly in the call\nto `export_core`.  It is recommended to set the environmental variable for easy\nof use.\n\n```{r, eval = FALSE}\nSys.setenv(REDCap_API_URI = \"https://\u003cyour-redcap-domain\u003e/api/\")\n```\n\nExport the data from REDCap and format it, based on the metadata of the REDCap\nproject via:\n\n```{r, eval = FALSE}\nproject1_redcap_core \u003c- export_core()\nproject1 \u003c- format_record(project1_redcap_core)\n```\n\n### Example\n\nThe example data provided in this package are statistics from the 2000-2001\nNational Hockey League Stanley Cup Champion Colorado Avalanche.  The data was\ntranscribed from [Hockey Reference](https://www.hockey-reference.com/teams/COL/2001.html)\ninto a REDCap Project hosed at the University of Colorado Denver.\n\nThe data set `avs_raw_core` was generated via the following, after setting up my\nkeyring and token as described above.\n```{r}\nlibrary(REDCapExporter)\nSys.setenv(REDCap_API_URI = \"https://redcap.ucdenver.edu/api/\")\nSys.setenv(REDCap_API_TOKEN = REDCapExporter_get_api_token(\"2000_2001_Avalanche\"))\navs_raw_core \u003c- export_core()\navsDF \u003c- format_record(avs_raw_core)\n```\n\nA simple summary statistic from the data set: the number of goals scored by\nposition:\n\n```{r}\naggregate(goals ~ position, data = avsDF, FUN = sum)\n```\n\n\n\n\n\n\n\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdewittpe%2FREDCapExporter","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdewittpe%2FREDCapExporter","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdewittpe%2FREDCapExporter/lists"}