View a markdown version of this page

Using the RStudio IDE in Amazon SageMaker Unified Studio - Amazon SageMaker Unified Studio

Using the RStudio IDE in Amazon SageMaker Unified Studio

RStudio is an integrated development environment for R, provided through Posit Workbench. In Amazon SageMaker Unified Studio, you can create an RStudio space to write, run, and visualize R code with access to the data and resources in your project. RStudio spaces behave like other code spaces: each space maintains its own persistent Amazon EBS volume, compute instance, and runtime configuration. For more information about RStudio concepts, components, and Region availability, see RStudio on Amazon SageMaker AI in the Amazon SageMaker AI Developer Guide.

Prerequisites

Before you can use RStudio, your administrator or project owner must set up the following:

  • A valid RStudio (Posit Workbench) license registered and accepted with AWS License Manager for the account that hosts your domain. For how to obtain and validate a license, see Get an RStudio license in the Amazon SageMaker AI Developer Guide.

  • An Amazon SageMaker domain that uses IAM Identity Center and the SageMakerAIDomain blueprint, with RStudio enabled (the enableRStudio parameter). The Tooling blueprint does not offer RStudio. For how to set this up, see Setting up the SageMakerAIDomain blueprint for code spaces.

  • The required inline policy attached to your project's IAM role. This policy grants the permissions that RStudio and Posit Workbench require for license checkout, log delivery, and application lifecycle operations. Without it, RStudio space creation or session startup fails. For how to add this policy, see Adding the required inline policy for RStudio.

Creating and launching an RStudio space

After the prerequisites are in place, you can create an RStudio space and start a session. To create and launch a space, complete the following steps:

  1. Navigate to Amazon SageMaker Unified Studio using the URL from your admin and log in using your SSO or AWS credentials.

  2. Navigate to the project you want to create a space in, and then choose Code spaces from the left sidebar.

  3. Choose Create space, and then choose the RStudio application type.

  4. Choose Create to create and start the space.

  5. When the space is ready, choose Open to launch RStudio in your browser.

  6. In Posit Workbench, choose New Session and wait until the session starts. You can then run R code in the session.