A series of introductory R videos.
I’ve uploaded 20+ R tutorials to YouTube for a new undergraduate course in Ecology and Evolutionary Biology at CU developed by Andrew Martin and Brett Melbourne, which in jocular anticipation was named IQUIT: an introduction to quantitative inference and thinking.
We made the videos to address the most common R programming problems that arose for students in the first iteration of the course. These short tutorials may be of use elsewhere:
c()
class
, length
, str
sqrt
, log
, exp
round
Creating special vectors: sequences and repetition
:
seq
(hit args)rep
(also note argument structure)Relational operators and logical data types
==
, !=
, >
, <
, >=
, <=
TRUE
and FALSE
2-d data structures: matrices and data frames
Intro to indexing: matrices and vectors
[
str
Data frame subsetting and indexing
df[c("column names")], df$column, df[, 1]
R style & other secrets to happiness
ls
, rm
read.csv
NA
is.na
Visualization part 1: intro to plot()
plot
xlab
, ylab
, col
Visualization part 2: other types of plots
Visualization part 3: adding data to plots
points
lines
, and segments
(also abline
)Visualization part 4: annotation and legends
text
Visualization part 5: graphical parameters
col
, cex
, pch
(see ?points
for pch
options)col
, lwd
, lty
for
loopmean
, sd
, var
, median
Randomization & sampling distributions
sample
and rep
Debugging R code 1: letting R find your data
Debugging R code 2: unreported errors
n
on the uncertainty in a sample meanConveying uncertainty with confidence intervals while not obscuring the data
segments
functionsample
or some other scheme, then iteratively simulate differences in means with CIs
If you see mistakes or want to suggest changes, please create an issue on the source repository.
Text and figures are licensed under Creative Commons Attribution CC BY 4.0. Source code is available at https://github.com/mbjoseph/mbjoseph.github.io, unless otherwise noted. The figures that have been reused from other sources don't fall under this license and can be recognized by a note in their caption: "Figure from ...".