R, RStudio, git

2026-01-13

Work environment in this class

  • R in the RStudio IDE

  • Github repositories for

    • homework assignments
    • final project

How current is your environment?

Jenny Bryan, Happy Git and GitHub for the useR, chapter 5.1:

Get current, people.

Good practice:

  • R: don’t fall behind more than one minor version (update once a year)
  • RStudio: new features are constantly released. (Jenny: once a month, Heike: whenever I think of it - maybe twice a year??)
  • git: update with operating system

Homework for next Tuesday: check your installations and update if needed

Connecting-RStudio-and-Git-Github

  1. Clone this repository to your local machine
  2. Open RStudio using the project file Connecting-RStudio-and-Git-Github.Rproj
  3. Open the file README.Rmd
  4. Make sure that the following code chunks run successfully
  • Load Packages …

  • Versions

Installations found:
  < R version 4.5.1 (2025-06-13) >
  RStudio version: < 2025.5.1.513 >
  < git version 2.49.0 >
  • Connection to git
Run the code chunk 'gitconnection' at least once successfully.
✔ Setting active project to "/Users/hofmann/Documents/Teaching/Stat
  451/Stat451-Spring-2026/homework-repos/homework-0-setup-B".
Project Path:  /Users/hofmann/Documents/Teaching/Stat 451/Stat451-Spring-2026/homework-repos/homework-0-setup-B 
Git repository detected.
GitHub Remote(s):
[1] "origin"

Checking pull access...
Pull rights: YES 

Checking push access...
Push rights: YES 
  1. Create the README.md file by rendering the README.Rmd file

  2. Check the resulting README.md file:

    • is your version of R (relatively) current? (most current: 4.5.1)
    • is your RStudio version from this year?
    • is your version of git (relatively) current? (most current: 2.51.0)

    If any of your answers above is ‘no’ install a newer version.

    • Do you have push and pull access to the Git repository?

    If not, make sure that you have followed all of the steps laid out in chapter 12 of Jenny Bryan’s “Happy Git and GitHub for the useR”

  3. Commit and push all changed files to Github classroom.

  4. Your done!

Using AI tools

  • We will be using LLMs in this course

  • We need to document any use (save prompt & output)

  • We need to critically assess any output

The problem with AIs

  • non-deterministic (different day, different luck)

  • model updated quietly by providers

  • inconsistent performance, seemingly not related to task difficulty

Perceived Performance of AI tools

AI Setup in R

  • package ellmer supports integration with most LLM providers
  • you will need to sign up for a service (market changes fast - Gemini offers a year of free Gemini Pro, OpenAI gives $18/m credit)
  • chat <- ellmer::chat_anthropic() opens chat with claude
  • live_console(chat) uses the console as a chat, exit with Q