Skip to Main Content
RStudio within the All of Us Computing Environment
RStudio runs as an application within the Researcher Workbench (RWB). There are important differences between this environment and a traditional RStudio desktop.
Differences:
-
RStudio in the RWB runs on a virtual machine in the All of Us cloud environment
-
Running RStudio in the RWB uses computational credits / costs
-
RStudio has two storage options in the RWB: Persistent Desk and Workspace Bucket
-
You cannot export individual-level datasets out of the RWB
Similarities:
-
You can load any R packages
-
The RStudio interface looks very similar to the RStudio desktop application
-
You can save syntax (.R) and Markdown (.rmd) files
Opening RStudio within the Researcher Workbench
STEP 1: Create a workspace within the Researcher Workbench
STEP 2: Select the RStudio icon on the right-hand panel
STEP 3: Select the check box to "automatically delete application after" a time period (recommended to reduce your computational costs)
STEP 4: Select "Start" to activate the application

Moving Researcher Workbench Data into RStudio
STEP 1: Within a workspace, use the cohort and dataset builder to create your dataset.
STEP 2: Select the Analyze button after you create your dataset
STEP 3: The Export Dataset box will appear. Select R as the programming language, and then select the Copy Code button to copy the dataset builder code to your clipboard.

STEP 4: Then in the RWB RStudio application, paste that code into your script (.R) file and execute. You will then see your dataframe in the environment pane.
See HERE for additional information on how to export RWB data into the RWB RStudio application.
Saving Your Work
The RStudio application within the Research Workbench (RWB) has two storage options: the persistent disk and the workspace bucket.
The persistent disk is your default storage. It is attached to the cloud environment and is affiliated with the user who initiates the RStudio application. Only you, the user, can view the files in the persistent disk.
You also have a workspace bucket provided as Google cloud storage. In contrast to the persistent disk, the files you place in the workspace bucket are sharable with other RWB collaborators.
You can write your R files to the persistent disk using traditional R functions. Then you can copy your files from the persistent disk to the workspace bucket using gsutil (Google Cloud).
See HERE for additional information.