This page was last updated on September 23, 2019.
Getting started:
read.csv
url
library
getwd
Data frame structure:
names
head
str
inspect
(tigerstats
/ mosaic
packages)Frequency tables:
xtabs
prop.table
rowPerc
(tigerstats
)colPerc
(tigerstats
)Graphs:
barchartGC
(tigerstats
/ lattice
packages)histogram
(tigerstats
/ lattice
packages)hist
(base stats
package)Descriptive stats:
favstats
(tigerstats
and mosaic
packages)mean
median
var
sd
IQR
Getting started:
read.csv
url
library
getwd
Data frame structure:
names
head
str
inspect
(tigerstats
/ mosaic
packages)Contingency tables:
xtabs
addmargins
prop.table
rowPerc
(tigerstats
)colPerc
(tigerstats
)Graphs:
barchartGC
(tigerstats
/ lattice
packages)mosaicplot
stripchart
(lattice
package)xyplot
(lattice
package)boxplot
Getting started:
read.csv
url
library
Descriptive stats:
favtstats
mean
Getting started:
read.csv
url
library
Data frame structure:
head
str
inspect
(tigerstats
/ mosaic
packages)length
Sampling:
set.seed
sample
do
(mosaic
package)Data management and exploration:
filter
(from the dplyr
package)subset
na.omit
length
mean
sd
sqrt
Graphs:
histogram
hist
Getting started:
library
Data frame structure:
head
str
Tabulation:
xtabs
Simulation:
set.seed
sample
do
rflip
(from the mosaic
package in the tigerstats
package)Graphs:
barplot
(different from the barchartGC
function used in previous tutorials)Getting started:
library
Data frame structure:
head
str
Tabulation:
xtabs
Simulation:
set.seed
sample
do
rflip
(from the mosaic
package in the tigerstats
package)Math:
sum
Graphs:
barplot
(different from the barchartGC
function used in previous tutorials)Getting started:
library
Data frame structure:
str
inspect
length
Tabulation:
xtabs
prop.table
Simulation:
rep
set.seed
sample
do
Math:
sum
sqrt
Data management and exploration:
mean
Graphs:
barplot
Binomial distribution:
binom.confint
(from the binom
package)Getting started:
library
Data frame structure:
str
inspect
names
Tabulation:
xtabs
Simulation:
set.seed
sample
do
seq
Math:
sum
Graphs:
barplot
Binomial distribution:
dbinom
(base package)binom.confint
(from the binom
package)binom.test
(from the binom
package)Getting started:
library
Data frame structure:
str
inspect
Create tables:
kable
Math:
sum
curve
(base package)Graphs:
barplot
segments
Goodness of fit:
dchisq
(base package)qchisq
(base package)chisqtestGC
(from the tigerstats
package)Getting started:
library
Data frame structure:
inspect
Tabulation:
xtabs
Manipulate data:
t
(base package, for transposing matrix)Graphs:
mosaicplot
Odds ratio:
oddsratio
(from the epitools
package)Getting started:
library
Data frame structure:
inspect
names
levels
Tabulation:
xtabs
prop.table
Manipulate data:
t
(base package, for transposing matrix)Graphs:
mosaicplot
Contingency analysis:
fisher.test
chisq.test
Getting started:
read.csv
url
library
Data frame structure:
head
inspect
(tigerstats
/ mosaic
packages)Simulation:
set.seed
sample
do
mean
Normal distribution:
rnorm
pnormGC
(tigerstats
package)qnormGC
(tigerstats
package)Graphs:
histogram
Getting started:
read.csv
url
library
Data frame structure:
head
inspect
(tigerstats
/ mosaic
packages)The “t” distribution:
pt
qt
t.test
(mosaic
package loaded as part of the tigerstats
package)Graphs:
histogram
hist
Getting started:
read.csv
url
library
Data management / manipulation:
inspect
(tigerstats
/ mosaic
packages)levels
filter
(tidyr
package)xtabs
(tigerstats
/ mosaic
packages)The “t” distribution:
qt
t.test
(mosaic
package loaded as part of the tigerstats
package)Graphs:
hist
boxplot
qqnorm
qqline
segments
par
Assumptions:
leveneTest
(car
package)qqnorm
qqline
shapiro.test
Getting started:
read.csv
url
library
Data management / manipulation:
inspect
(tigerstats
/ mosaic
packages)levels
head
xtabs
(tigerstats
/ mosaic
packages)levels
ordered
names
Graphs:
stripchart
ggstripchart
(from the ggpubr
package)qqnorm
qqline
par
Assumptions:
leveneTest
(car
package)ANOVA:
lm
anova
summary
ANOVA Table:
names
colSums
as.data.frame
rbind
kable
(knitr
and kableExtra
packages)Post-hoc tests:
TukeyHSD
annotate
(ggplot2
package, loaded with ggpubr
package)Getting started:
read.csv
url
library
Data management / manipulation:
inspect
(tigerstats
/ mosaic
packages)head
Graphs:
plot
jitter
Correlation:
cor.test
Getting started:
read.csv
url
library
Data management / manipulation:
inspect
(tigerstats
/ mosaic
packages)head
Data visualization:
plot
jitter
Assumptions:
qqnorm
qqline
residuals
shapiro.test
abline
Regression:
lm
summary
confint
visreg
(from the visreg
package)Prediction:
predict.lm
seq
data.frame
sample
points
Getting started:
read.csv
url
library
Data frame structure:
names
inspect
(tigerstats
/ mosaic
packages)Graphs:
stripchart
(lattice
package)Descriptive stats:
favstats
(tigerstats
and mosaic
packages)Tables (all from the kableExtra
package):
kable
kable_styling
add_header_above
kable_as_image
Getting started:
read.csv
url
library
Testing assumptions:
head
hist
qqnorm
qqline
par
plot
shapiro.test
leveneTest
(from the car
package)inspect
(from the tigerstats
package)Transformations:
log
log10
logit
(from the car
package)invlogit
(from the arm
package)exp