Programming with R

Prepare for Programming with R

Thursday, October 8, 2026 and Thursday, October 22, 2026
6:00-9:00 PM Central Time
Bruner Hall, Room 126

No previous R experience is required. We will use RStudio for this lesson. Please complete the setup before the first meeting and bring the same laptop to both meetings.

What to bring

  • A Windows, macOS, or Linux laptop
  • Your laptop’s charging cable

Complete these steps before the workshop

  1. Install R and (optionally) RStudio, unless you already have it.
  2. Download and extract the lesson files.
  3. Complete the pre-workshop survey. If you already completed it for this series, you do not need to complete it again.
  4. Review The Carpentries Code of Conduct.

Install R

R

R is a programming language that is especially powerful for data exploration, visualization, and statistical analysis. To interact with R in our lessons, typically use RStudio.

Install R by:

  • Downloading and running this .exe file from CRAN.
  • Installing the RStudio IDE.

  • Note that if you have separate user and admin accounts, you should run the installers as administrator (right-click on .exe file and select "Run as administrator" instead of double-clicking). Otherwise problems may occur later, for example when installing R packages.

Install R by:

  • Navigating to CRAN and following the instructions outlined there, using your package manager. We have reproduced the commands below:
    Use the terminal command prompt to type/copy-and-paste these commands in, pressing Enter after each line to run the command.
    Do not run the lines with # at the start of each line, as this indicates a comment and is not part of the command.
    # update indices
    sudo apt update -qq
    
    # install two helper packages we need
    sudo apt install --no-install-recommends software-properties-common dirmngr
    
    # add the signing key for these repos
    wget -qO- https://cloud.r-project.org/bin/linux/ubuntu/marutter_pubkey.asc | sudo tee -a /etc/apt/trusted.gpg.d/cran_ubuntu_key.asc
    
    # add the repo from CRAN
    sudo add-apt-repository "deb https://cloud.r-project.org/bin/linux/ubuntu $(lsb_release -cs)-cran40/"
    
    # install R itself
    sudo apt install --no-install-recommends r-base
                
  • Installing the RStudio Server IDE:
    # install dependencies
    sudo apt install -y r-base-core r-recommended r-base-dev gdebi-core build-essential libcurl4-gnutls-dev libxml2-dev libssl-dev
    sudo apt install --no-install-recommends gdebi-core
    
    # cd ~/Downloads
    
    # download the latest RStudio Server .deb file
    wget https://download2.rstudio.org/server/jammy/amd64/rstudio-server-2025.05.1-513-amd64.deb
    
    # install the .deb file
    sudo gdebi rstudio-server-2025.05.1-513-amd64.deb
    
    # start the RStudio Server
    sudo systemctl start rstudio-server
    
    # enable RStudio Server to start on boot
    sudo systemctl enable rstudio-server
                
  • After installation of RStudio Server, check you can access it by:
    • Opening a web browser and navigating to http://localhost:8787.
    • Logging in with the username and password you used when you set up Linux / WSL2.

If you are using Windows and WSL2, the full in-depth instructions for installing R on WSL2 can be found in this POSIT article.

Download the lesson files

  1. Download the lesson data ZIP file.
  2. Create a folder named r-novice-inflammation on your Desktop.
  3. Move the downloaded ZIP file to the r-novice-inflammation folder.
  4. Extract the ZIP file. Some computers will create folders named r-novice-inflammation-data. If that happens, open that folder and move the data folder inside it up into r-novice-inflammation.
  5. Check the result: opening r-novice-inflammation should show data directly inside it. Open data and confirm that it contains inflammation-01.csv.

If your Desktop is redirected through OneDrive, use the Desktop location you have used in the previous workshops.