allofus R Package

R-CMD-check CRAN status

The goal of the allofus R package is to streamline the use of R within the All of Us Researcher Workbench. It has 4 primary goals:

  1. Facilitate the use of popular tidyverse ecosystem of R packages on the Researcher Workbench
  2. Help researchers more efficiently and accurately extract and synthesize survey data and EHR data
  3. Increase the interoperability between tools created by the Observational Health Data Sciences and Informatics community (OHDSI) for the OMOP CDM) and the Researcher Workbench
  4. Make connecting to the database and managing files simple

The allofus R package was developed by Louisa Smith and Rob Cavanaugh at Northeastern University and is not affiliated with or endorsed by the All of Us Research Program.

Installation

Install the released version of allofus from CRAN:

install.packages("allofus")

Install the development version from Github:

install.packages("pak")
pak::pak("roux-ohdsi/allofus")

Use

Read through the getting started vignette to learn how to use the package.

A community workspace on the All of Us Researcher Workbench will soon be available.

A note on “Workbench 2.0”

The All of Us Researcher Workbench has migrated to a new, Verily-based platform (“Workbench 2.0”). A few things work differently there compared to the original workbench:

  • Buckets aren’t created automatically. Workbench 2.0 workspaces no longer come with a WORKSPACE_BUCKET set up for you. Run aou_create_bucket() once per workspace to create one (or aou_create_bucket(temporary = TRUE) for a bucket that auto-deletes its contents after a couple of weeks) before using aou_ls_bucket() and related functions.
  • Environment variables are resolved behind the scenes. WORKSPACE_CDR and GOOGLE_PROJECT are no longer injected as OS environment variables on workbench 2.0. allofus resolves them automatically via the wb CLI when the package loads, and caches the result to ~/.aou-env so subsequent sessions don’t need to re-resolve them.
  • aou_create_temp_table() currently doesn’t support joins. The temporary table it creates can be queried directly (e.g., with dplyr::collect()), but it currently can’t be used in a join with another table in a later query. This seems to be a limitation in how the workbench is set up; it is unclear if it can be fixed.

Citation

Please cite the allofus package as:

Smith LH, Cavanaugh R (2024). “allofus: An R Package to Facilitate Use of the All of Us Researcher Workbench.” Journal of the American Medical Informatics Association, ocae198. doi:10.1093/jamia/ocae198.

or with

citation("allofus")

Note: A pre-print of the special issue can be found here: https://doi.org/10.1101/2024.04.10.24305611

We also encourage you to reference the specific version of the package you use for an analysis. You can look this up with

packageVersion("allofus")

Bugs

Please leave us comments, requests, and report bugs using the “Issues” tab on github.