Set-Up Instructions

Executive Summary

Author: Jacob S. Zelko

Date: 2023-02-20

Summary: Instructions on setting up the environment for analysis with necessary installation instructions

Environment Set-Up

R and RStudio Requirements

For this characterizatopm assessment, you will need:

Furthermore, I am assuming that RStudio is the client being used for this assessment. As RStudio can be configured very differently depending on what sort of operating system you are using, please see this RStudio guide on how to switch the version of R being used in RStudio.

NOTE: If you do not want to manually deal with multiple versions of R on your system, I suggest checking out the great Rust tool, rig which allows you to have multiple R versions on the same machine simultaneously and switch between them seamlessly.

Install RTools42 (Windows Only Requirement)

For Windows only users, one will need to download the tool RTools42. To do this, click this link which will download the installer. Execute the installer and follow the instructions there. Make sure after you have installed the tool, restart RStudio if it is running on your computer!

Java Installation

Java is required to be installed for this to work. In practical deployment, I have found Java 1.8 to be sufficient for assessments:

I have left out specific installation instructions for which executable to use due to the instructions and types differing between operating systems.

Configuring R Environment

For this tutorial, you will need the renv package installed into your main R environment (for more information about this package, refer to the Appendix). This can be done via:

install.packages("renv")

NOTE: For steps 2, 3 and 4, RStudio may have already done or attempted to do this for you. If it did, you may not see anything when you run these steps in the console.

Then, from within RStudio, navigate to the folder MentalHealthEquity/study. Within that directory, do the following steps within the RStudio console:

  1. Load the RStudio project within the MentalHealthEquity folder or run devtools::load_all() to load the package
  2. Load the renv package: library(renv)
  3. Activate the renv environment: renv::activate()
  4. Restore the needed project packages by running: renv::restore() and accepting

The following code block shows how this would run:

library(renv)

renv::activate()
renv::restore()

If everything worked correctly up to this point, you should be prepared to run the study!



ohdsi-studies/MentalHealthEquity documentation built on March 9, 2023, 12:39 p.m.