RStudio

For Rstudio we recommend using the 'Local Jobs' feature to run jobs in the background. This way you can submit multiple jobs whilst also making sure the job continues to run if you navigate away from Rstudio without blocking the interface.

Learn more about local jobs in Rstudioarrow-up-right.

Recovering an unresponsive RStudio session

In certain cases RStudio sessions can become unresponsive, due to large amounts of output printed or large amount of data loaded. If restarting the application in Nuvolos doesn't resolve the issue, you can follow the steps in the Application Troubleshooting guide to clear the application state.

RStudio is responsive but it doesn't accept commands

If you can interact with the RStudio window (menu items are working, dropdowns open, etc.) but commands you try to run in R will not execute, it might be that the R console is showing a plus sign at the start of the line:

R waiting for further input

If this is the case, R is waiting for further input. As you can see in the above example, a curly brace was open, and R waits the curly brace to be closed for the expression to be complete (and executable).

If you want to cancel the statement, make sure to focus on the R console in RStudio by clicking on it, then hit the Escape button on your keyboard.

After the cancelled statement

Using Tensorflow and Keras with RStudio

Tensorflow and Keras can be installed via miniconda in Rstudio. To install them, use the following steps:

  1. Restart the R session to be in a clean setting (select Session > Quit Session on the top menu)

  2. Make sure reticulate can use miniconda via running in the R commands:

3. Install tensorflow R package and then call the install_tensorflow() function. If you would like to use GPU acceleration, run install_tensorflow(version="gpu"):

4. Install Keras R package and then call the install_keras() function:

To test the installation, follow the example from the RStudio website: https://tensorflow.rstudio.com/guide/keras/#mnist-examplearrow-up-right

GitHub Copilot with RStudio

Starting from RStudio app version R 4.3.2 with RStudio 2023.09, the GitHub Copilot integration is configurable in Global Options:

circle-info

GitHub Copilot requires a GitHub account with an active GitHub Copilot subscription. It currently cannot make use of an OpenAI API key. For OpenAI API integration, see the ellmer package section below.

Using ellmer with OpenAI GPT-5.2 and other Large Language Models

The ellmer package provides a unified interface for interacting with large language models directly from R, including OpenAI's GPT-5.2. This allows you to leverage AI capabilities for code generation, data analysis assistance, and natural language processing tasks within your RStudio workflow.

Installation

Install the ellmer package from CRAN:

Configuration with OpenAI API

To use ellmer with OpenAI's GPT-5.2 model, you need to provide your API key.

circle-exclamation

We recommend storing your OpenAI API key as a Nuvolos secret, which will be automatically exposed as an environment variable in your application. See Environment Variables and Secrets for details on how to set up secrets.

Set up your OPENAI_API_KEY as a Nuvolos secret. Once configured, the secret will be available as an environment variable when your RStudio application starts, and ellmer will automatically detect it.

Using ellmer with GPT-5.2

Create a chat object to interact with the GPT-5.2 model:

You can also use ellmer for more advanced tasks:

Additional Configuration

You can customize the model's behavior with additional parameters:

For more information about ellmer, consult the package documentation by running ?ellmer in R or visiting the package's CRAN page.

Last updated

Was this helpful?