Getting Started with RStudio

RStudio is a powerful integrated development environment (IDE) for R programming. Coder workspaces allow you to run RStudio Server, which provides the full RStudio interface accessible through your web browser.

Creating a Workspace with RStudio

When creating a new workspace, you need to enable the RStudio service to make it available.

Note

RStudio must be enabled when the workspace is created. It can’t be added to an existing workspace.

  1. Navigate to the “New Workspace” Page
  2. Complete the required fields
  3. Make sure “Include RStudio” is set to “Yes”
  4. Complete the workspace creation process

Once your workspace has booted, you can start RStudio in a new browser window using the button on the workspace dashboard.

Workspace Dashboard with RStudio Installed

Setting Up an RStudio Project

RStudio Projects are used to organize your work and manage working directories. Here’s how to create a new project:

  1. In RStudio, click FileNew Project
  2. In the New Project Wizard, choose “New Directory”, to create a new directory for your project
  3. For the project type, select “New Project”
  4. Enter a name for the new directory: my-project. Leave “Create project as a subdirectory of” set to ~.
  5. Click Create Project

RStudio will create a .Rproj file in your project directory. This file stores project-specific settings and makes it easy to return to your work.

Installing R Packages

You can install packages in your workspace just like a local RStudio installation:

# Install from CRAN
install.packages("tidyverse")
install.packages("ggplot2")

# Install from GitHub
install.packages("devtools")
devtools::install_github("username/repository")
Tip

Packages installed in your workspace persist across sessions but are isolated from other workspaces. This ensures reproducibility and avoids package conflicts.

Setting Up Git

If you plan to use version control:

  1. Open the Terminal in RStudio (ToolsTerminalNew Terminal)
  2. Configure your Git identity:
git config --global user.name "Your Name"
git config --global user.email "your.email@example.com"

Additional Resources

Here are some helpful resources to get the most out of RStudio: