Session 1
Today we will start using R and RStudio.
We will also create the project folder that we will use throughout the course.

R is a language and environment designed for statistical and graphical operations.
R allows us to work with data by writing code.
That may sound intimidating at first, but the goal is not to become a programmer overnight.
R was developed in the early 1990s by Ross Ihaka and Robert Gentleman.
It was inspired by an earlier language called S.
The problem with S? You had to buy it. And we all know we would rather spend our money on more important things…
Like food 🍔

R is:
You do not need to learn everything R can do.
You only need to start building the tools that are useful for your own work.
R does the work.
RStudio helps us work with R.
RStudio makes it easier to:

RStudio User Guide 2026.08.2
Open a new R script:
File → New File → R Script
Then write:
Run each line from the script:
Windows: Ctrl + Enter
Mac: Command + Enter
An RStudio Project connects RStudio with a specific folder on your computer.
That folder can contain everything related to your work:
my-project/
│
├── data/
├── scripts/
├── outputs/
└── my-project.Rproj

Today we will create one project that we will use throughout the course.
Name it:
intro-r-course
Then create three folders:
intro-r-course/
│
├── data/
├── scripts/
└── outputs/
Projects help us avoid this:
final.csv
final2.csv
final_revised.csv
final_revised2.csv
script.R
script_new.R
figure1.png
scattered across:
Desktop/
Downloads/
Documents/
A project gives your work a home.
You may be wondering:
Why do I need to learn R after spending years getting good at Excel?
A selfish reason:
In many courses, labs, graduate programs, and research projects, knowing some R is already expected.

Not just so that someone can replicate it exactly and know whether it’s right or wrong, but also so that others can learn from it.
A new skill in your arsenal
Programming skills are increasingly in demand and highly valued [@lai2019]. Not only in academia but also in industry, knowing how to handle, visualize, and analyze data can be a huge advantage [@feng2020]. I’m not saying everyone has to be an expert, but everyone should at least have a basic understanding.

https://cran.r-project.org/web/packages/meme/vignettes/meme.html
Clean, organize, and explore datasets.
Fit simple and complex models.
Create figures, maps, and animations.
Create reports, websites, presentations, and manuscripts.
Build interactive tools to explore data.
Avoid doing repetitive tasks by hand.
Allison Horst code hero
R has a large and generous community.
There are tutorials, books, forums, examples, packages, and people willing to help.
R is learned by practicing.
You will:
You are going to see errors.

A lot of them.
That is normal.
R is not about avoiding errors.
It is about making enough of them that you eventually learn how to fix them.
In conclusion, whether or not you learn R will depend on how much time you spend on it, not on whether or not you take this tutorial. [@lawlor2022]
Allison Horst rollercoaster
Before the next session:
intro-r-course project.scripts/ as:practice-01.R
# explaining each line of code you wrote, the title of the script, and your name..Rproj file.The easiest way to learn R is to use it.
You do not need to memorize every command.
Write code, make mistakes, modify examples, and keep your old scripts.
Comments
We can add notes to scripts using
#.Anything after
#is ignored by R.Comments help your future self understand what your code was doing.