RStudio

RStudio is an integrated development environment (IDE) for R, providing console access, code editing with syntax highlighting, plotting tools, and debugging features.

Launching RStudio

  1. Connect to interactive.hpc.caltech.edu

  2. Navigate to Interactive AppsRStudio Server

  3. Specify resource requirements (hours, cores, memory, GPUs)

  4. Click Launch

  5. Click Connect to RStudio Server once a node is available

Note

Requires campus network or Caltech VPN.

Package Installation

R and RStudio are installed in a read-only central location. Configure a writable directory for packages:

1. Create Library Directory

mkdir -p /resnick/groups/<group-name>/<username>/R-Libraries

Tip

Use group directories (20 TB) rather than home directories (50 GB limit).

2. Configure R Environment

Edit ~/.Renviron:

vi ~/.Renviron

Add:

R_LIBS_USER=/resnick/groups/<group-name>/<username>/R-Libraries

3. Restart RStudio

Log out and restart your RStudio session through Open OnDemand.

4. Install Packages

In R console:

install.packages("tidyverse", dependencies = TRUE)

Example: Installing tidyverse

# Check library path
.libPaths()

# Install tidyverse and dependencies
install.packages("tidyverse", dependencies = TRUE)

# Load and verify
library(tidyverse)

Troubleshooting

Package Installation Fails

  • Check disk quota: hpcquota

  • Ensure R_LIBS_USER is set correctly

  • Try installing without dependencies first

RStudio Won’t Connect

  • Clear browser cache

  • Try a different browser

  • Check if you have pending jobs using resources