This document provides a running list of all packages and functions introduced in the lecture slides. I will try to update it each Tuesday, just before class. If I forget, please email me.


To get additional information:

  • learn about a package by typing help(package = "PACKAGE_NAME") into the R console.
  • find package tutorials by typing browseVignettes(package = "PACKAGE_NAME")
  • learn about a function by typing ??function_name (two question marks) into the R console.
    • if you already have the package loaded into memory, you can just type ?function_name (one question mark)
    • or, if you know the name of the package, you can type ?package_name::function_name
    • or you can search for the function at rdocumentation.org

Week 1: Introduction

Packages Used

  • tibble

Functions Used

  • function()
  • sum()
  • exp()
  • log()
  • sqrt()
  • library()
  • tibble()
  • runif()
  • str()
  • list()
  • diag()
  • try()
  • c()
  • mena()
  • Mean()
  • mean()

Week 2: Getting-To-Know-Your-Data

Packages Used

  • tidyverse

Functions Used

  • library()
  • theme_set()
  • theme_grey()
  • read_csv()
  • str()
  • summary()
  • quantile()
  • c()
  • table()
  • count()
  • group_by()
  • summarize()
  • across()
  • _join()
  • full_join()
  • ungroup()
  • mutate()
  • factor()
  • ggplot()
  • aes()
  • geom_col()
  • geom_text()
  • ggtitle()
  • ylab()
  • xlab()
  • theme_minimal()
  • theme()
  • element_blank()
  • element_rect()
  • facet_wrap()
  • element_text()
  • scale_fill_brewer()
  • select()
  • hms()
  • dmy()
  • geom_histogram()
  • scale_x_time()
  • hours()
  • seq()
  • hour()
  • case_when()
  • summarise()
  • gather()
  • scale_fill_viridis_d()
  • theme_gray()

Week 3: Describing-Your-Data

Packages Used

  • tidyverse
  • janitor

Functions Used

  • library()
  • read_csv()
  • c()
  • clean_names()
  • print()
  • names()
  • class()
  • parse_number()
  • mutate()
  • across()
  • str_remove()
  • str_remove_all()
  • str_replace()
  • str_replace_all()
  • stri_replace_all_regex()
  • fix_replacement()
  • pivot_longer()
  • ggplot()
  • aes()
  • geom_point()
  • geom_smooth()
  • facet_wrap()
  • summary()
  • filter()
  • na()
  • full_join()
  • rename()
  • ungroup()
  • left_join()
  • inner_join()
  • anti_join()
  • _join()

Week 4: Vizualize-Your-Data

Packages Used

  • tidyverse
  • choroplethr
  • scales

Functions Used

  • library()
  • mutate()
  • filter()
  • select()
  • tibble()
  • mean()
  • default()
  • str()
  • table()
  • all()
  • seq()
  • where()
  • data()
  • starts_with()
  • pivot_longer()
  • dim()
  • str_remove()
  • str_to_title()
  • ggplot()
  • aes()
  • geom_point()
  • geom_smooth()
  • facet_wrap()
  • theme_minimal()
  • theme()
  • scale_x_continuous()
  • dollar_format()
  • scale_y_continuous()
  • percent_format()
  • labs()

Week 5: Survey-Stats

Packages Used

  • tidyverse

Functions Used

  • library()
  • attach()
  • ggplot()
  • aes()
  • geom_point()
  • geom_smooth()
  • data()
  • tibble()
  • dim()
  • pivot_longer()
  • pivot_wider()
  • names()
  • all()
  • group_by()
  • mutate()
  • ungroup()
  • filter()
  • arrange()
  • sum()
  • desc()
  • fct_reorder()
  • coord_flip()
  • theme_minimal()
  • ggtitle()
  • sqrt()
  • round()
  • read_csv()
  • str()
  • table()
  • select()
  • column()
  • case_when()
  • summary()
  • mean()
  • sd()
  • na()
  • nrow()
  • c()
  • unit()

Week 6: Cause-And-Effect

Packages Used

  • tidyverse
  • ggdag
  • choroplethr
  • usmap
  • haven

Functions Used

  • library()
  • seed()
  • runif()
  • tibble()
  • rep()
  • group_by()
  • summarise()
  • mean()
  • geom_col()
  • ggplot()
  • aes()
  • read_tsv()
  • filter()
  • c()
  • select()
  • arrange()
  • data()
  • as_tibble()
  • pivot_wider()
  • mutate()
  • slice()
  • fips()
  • numeric()
  • left_join()
  • inner_join()
  • scale_x_continuous()
  • dollar_format()
  • scale_y_continuous()
  • percent_format()
  • xlab()
  • ylab()
  • ggtitle()
  • theme_minimal()
  • geom_point()
  • factor()
  • ntile()
  • scale_color_viridis_d()
  • guide_legend()
  • theme()
  • geom_smooth()
  • read_sav()
  • zap_labels()
  • case_when()
  • between()
  • integer()
  • na_if()
  • geom_jitter()
  • geom_boxplot()
  • ylim()
  • scale_color_brewer()

Week 7: Better-Plots

Packages Used

  • tidyverse

Functions Used

  • library()
  • read_rds()
  • count()
  • print()
  • top_n()
  • ggplot()
  • aes()
  • fct_reorder()
  • geom_col()

Week 8: Presenting-Your-Work

Packages Used

character(0)

Functions Used

character(0)


Week 9: Midterm-Presentations

Packages Used

character(0)

Functions Used

  • c()
  • setdiff()
  • seed()
  • sample()
  • length()
  • tibble()
  • seq_along()

Week 10: Regression-1

Packages Used

  • tidyverse
  • moderndive
  • broom

Functions Used

  • library()
  • select()
  • str()
  • summary()
  • cor()
  • summarize()
  • ggplot()
  • aes()
  • geom_point()
  • labs()
  • geom_jitter()
  • geom_smooth()
  • lm()
  • Pr()
  • tidy()
  • mean()
  • table()

Week 11: Regression-2

Packages Used

  • tidyverse
  • lubridate

Functions Used

  • library()
  • function()
  • tibble()
  • add_ten()
  • map()
  • c()
  • map_df()
  • files()
  • read_tsv()
  • str()
  • summary()

Week 12: Prediction

Packages Used

  • tidyverse
  • broom

Functions Used

  • library()
  • seed()
  • tibble()
  • seq_len()
  • runif()
  • ggplot()
  • aes()
  • geom_point()
  • theme_minimal()
  • scale_color_viridis_d()
  • theme()
  • lm()
  • I()
  • function()
  • augment()
  • summarise()
  • sum()
  • n()
  • sqrt()
  • pull()
  • get_rmse()
  • mutate()
  • predict()
  • pivot_longer()
  • starts_with()
  • case_when()
  • round()
  • facet_wrap()
  • geom_line()
  • ggtitle()

Week 13: Missing-Data

Packages Used

  • haven
  • tidyverse
  • labelled
  • knitr
  • kableExtra
  • janitor

Functions Used

  • library()
  • read_sav()
  • glimpse()
  • tabyl()
  • adorn_pct_formatting()
  • mutate()
  • case_when()
  • numeric()
  • if_else()
  • between()
  • integer()
  • na()
  • median()
  • labelled()
  • val_labels()
  • as_factor()
  • lm()
  • summary()
  • predict()
  • round()
  • select()
  • starts_with()
  • filter()
  • arrange()
  • distinct()
  • kable()
  • kable_styling()
  • c()
  • column_spec()
  • spec_color()

Most frequently used functions so far

Function Times Used
mutate() 41
aes() 32
library() 31
I() 30
c() 26
ggplot() 25
lm() 22
tibble() 19
summary() 17
table() 16
filter() 14
geom_point() 14
group_by() 14
case_when() 12
mean() 12
select() 12
across() 11
geom_smooth() 11
str() 11
clean_names() 10
factor() 9
theme() 9
geom_col() 8
numeric() 8
anti_join() 7
full_join() 7
ntile() 7
parse_number() 7
predict() 7
round() 7
ungroup() 7
arrange() 6
count() 6
facet_wrap() 6
get_rmse() 6
left_join() 6
names() 6
read_csv() 6
sum() 6
summarize() 6
theme_minimal() 6
_join() 5
dim() 5
geom_jitter() 5
map_df() 5
quantile() 5
runif() 5
tabyl() 5
between() 4
data() 4
ggtitle() 4
hour() 4
inner_join() 4
integer() 4
labs() 4
na() 4
pivot_longer() 4
pivot_wider() 4
sqrt() 4
starts_with() 4
summarise() 4
column_spec() 3
desc() 3
function() 3
geom_histogram() 3
if_else() 3
Pr() 3
scale_color_viridis_d() 3
seed() 3
spec_color() 3
str_remove() 3
str_replace() 3
str_replace_all() 3
add_ten() 2
all() 2
cor() 2
default() 2
diag() 2
dollar_format() 2
element_blank() 2
element_rect() 2
element_text() 2
exp() 2
fct_reorder() 2
files() 2
geom_boxplot() 2
hms() 2
labelled() 2
log() 2
map() 2
median() 2
na_if() 2
percent_format() 2
print() 2
read_sav() 2
read_tsv() 2
scale_fill_brewer() 2
scale_x_continuous() 2
scale_x_time() 2
scale_y_continuous() 2
seq() 2
slice() 2
str_remove_all() 2
tidy() 2
val_labels() 2
xlab() 2
ylab() 2
ylim() 2
adorn_pct_formatting() 1
as_factor() 1
as_tibble() 1
attach() 1
augment() 1
class() 1
column() 1
coord_flip() 1
distinct() 1
dmy() 1
fips() 1
fix_replacement() 1
gather() 1
geom_line() 1
geom_text() 1
glimpse() 1
guide_legend() 1
hours() 1
kable() 1
kable_styling() 1
length() 1
list() 1
Mean() 1
mena() 1
n() 1
nrow() 1
pull() 1
read_rds() 1
rename() 1
rep() 1
sample() 1
scale_color_brewer() 1
scale_fill_viridis_d() 1
sd() 1
seq_along() 1
seq_len() 1
setdiff() 1
str_to_title() 1
stri_replace_all_regex() 1
theme_gray() 1
theme_grey() 1
theme_set() 1
top_n() 1
try() 1
unit() 1
where() 1
zap_labels() 1