Summary and Setup

This is a brief overview of AI-supported programming with GitHub Copilot in RStudio.

The material is suitable for R users who already have experience with R and want to learn how to use AI tools to support their programming in RStudio.

In the following, some possibilities are introduced on how AI tools can be used in RStudio to facilitate and accelerate programming. Basic knowledge of R is assumed.

Overview

Questions

  • How do I use AI tools in RStudio?
  • What AI features are available in RStudio?
  • How can AI support my programming?

Objectives

  • Overview of AI-supported programming possibilities in RStudio
  • Practical application of AI tools for R programming

Literature


As additional reading, we recommend the official RStudio documentation on AI-supported features, since it is regularly updated with the latest information.

Setup

This lesson introduces AI-supported coding tools in RStudio, specifically focusing on GitHub Copilot and other AI assistants. To participate in this lesson, you will need to set up the required software and accounts.

Software Requirements

R

You will need a recent version of R installed on your computer. We recommend:

  • R version 4.2.0 or later

Download R from CRAN.

RStudio

You will need a recent version of RStudio with GitHub Copilot support:

  • RStudio version 2024.02 or later (required for GitHub Copilot integration)

Download RStudio from Posit.

Callout

Why RStudio 2022.02 or later?

GitHub Copilot integration in RStudio was introduced in version 2022.02. Earlier versions do not support the Copilot extension, which is essential for this lesson.

Optional: R Packages

Some chapters in this lesson use additional R packages. These will be introduced as needed during the lesson, but you may want to install them in advance:

R

# For data manipulation (used in examples)
install.packages("tidyverse")

# For AI integration in pipelines (Chapter: Using AI within Pipelines)
install.packages("ellmer")
Callout

About the ellmer Package

The ellmer package provides interfaces to various AI models directly from R. While this is covered in detail in a later chapter, having it pre-installed will save time during the lesson.

Setup Verification

Before the lesson begins, verify your setup:

  1. Check R version:

    R

    R.version.string

    Should show R version 4.2.0 or later.

  2. Check RStudio version:

    • Open RStudio
    • Go to HelpAbout RStudio
    • Verify the version is 2024.02 or later

Getting Help

If you encounter issues with setup:

  • Refer to the RStudio documentation for RStudio-specific questions
  • Contact the instructors before the lesson if you have persistent setup problems

What’s Next?

Once your setup is complete, you’re ready to start the lesson! The first chapter, Getting Started with GitHub Copilot, will guide you through:

  • Registering for GitHub (if you haven’t already)
  • Applying for the GitHub Student Developer Pack
  • Installing and configuring GitHub Copilot in RStudio
  • Testing that everything works correctly

We look forward to exploring AI-supported coding with you!