Summary and Setup

Edit this page

AI Carpentry empowers researchers to make informed use of AI. This workshop aims to teach researchers with no previous experience of programming the basic concepts and skills they need to begin applying AI-assisted coding in their projects. After following the workshop, learners will be able to critically evaluate coding outputs generated by an AI chatbot and plan the next steps to continue building their expertise.

Prerequisite

Getting Started

This workshop assumes no prior experience with the tools covered in the workshop.

To get started, follow the setup instructions to get access to the required software for this workshop.

Workshop Overview

Lesson Overview
Exploring Large Language Models Learn how large language models work, as the central technology of generative AI coding tools, and about the role payed by randomness in their outputs.
Considering Implications of GenAI Use Discuss the implications of the development and use of generative AI, and reflect on how this could influence when and how you choose to use these tools.
Learning Programming with GenAI Get started with programming, using a chatbot to explain, create, and modify code, and develop strategies to remain in control of your research.

Preparations


AI Carpentry’s teaching is hands-on, and to follow this lesson learners must have R and RStudio installed on their computers. They also need to be able to install a number of R packages, create directories, and download files.

To avoid troubleshooting during the lesson, learners should follow the instructions below to download and install everything beforehand. If the computer is managed by their organization’s IT department they might need help from an IT administrator.

Install R and RStudio

R and RStudio are two separate pieces of software:

  • R is a programming language and software used to run code written in R.
  • RStudio is an integrated development environment (IDE) that makes using R easier. In this course we use RStudio to interact with R.

If you don’t already have R and RStudio installed, follow the instructions for your operating system below. You have to install R before you install RStudio.

Update R and RStudio

If you already have R and RStudio installed, first check if your R version is up to date:

  • When you open RStudio your R version will be printed in the console on the bottom left. Alternatively, you can type sessionInfo() into the console. If your R version is 4.0.0 or later, you don’t need to update R for this lesson. If your version of R is older than that, download and install the latest version of R from the R project website for Windows, for MacOS, or for Linux
  • It is not necessary to remove old versions of R from your system, but if you wish to do so you can check How do I uninstall R?
  • After installing a new version of R, you will have to reinstall all your packages with the new version. For Windows, there is a package called installr that can help you with upgrading your R version and migrate your package library.

To update RStudio to the latest version, open RStudio and click on Help > Check for Updates. If a new version is available follow the instruction on screen. By default, RStudio will also automatically notify you of new versions every once in a while.

Callout

The changes introduced by new R versions are usually backwards-compatible. That is, your old code should still work after updating your R version. However, if breaking changes happen, it is useful to know that you can have multiple versions of R installed in parallel and that you can switch between them in RStudio by going to Tools > Global Options > General > Basic.

While this may sound scary, it is far more common to run into issues due to using out-of-date versions of R or R packages. Keeping up with the latest versions of R, RStudio, and any packages you regularly use is a good practice.

[Material on this page has been adapted from Data Carpentry’s Data Analysis and Visualization in R for Ecologists lesson.]