R4DS-2e Ch. 11

group_by()

{dplyr}

group data by levels of column

coord_cartesian()

{ggplot2}

use Cartesian coordinates

theme()

{ggplot2}

customize non-data components of plot

select()

{dplyr}

keep specified columns

guide_legend()

{ggplot2}

control legend formatting

sum()

{base}

sum elements of vector

mutate()

{dplyr}

create or modify data columns

geom_text()

{ggplot2}

adds text to plot

c()

{base}

create vector of numbers, characters, etc.

facet_wrap()

{ggplot2}

create subplots from one variable

geom_bar()

{ggplot2}

create bar chart based on counts in data

ggplot()

{ggplot2}

create a plotting area

scale_x_date()

{ggplot2}

scale x axis to be date

library()

{base}

load R packages

arrow()

{grid}

plot arrows

arrange()

{dplyr}

change order of rows based on values of columns

scale_y_log10()

{ggplot2}

scale y axis to be log base 10

str_wrap()

{stringr}

wrap strings into nicely formatted paragraphs

labs()

{ggplot2}

modify axis, legend, and plot labels

annotate()

{ggplot2}

annotate plot independent of data

range()

{base}

return vector of minimum and maximum

desc()

{dplyr}

order in descending order

scale_color_discrete()

{ggplot2}

scale color aesthetic to be discrete

cut()

{base}

divide range of vector into intervals

geom_point()

{ggplot2}

add layer of points to plot

seq()

{base}

create sequences of numbers

list()

{base}

create recursive vector (list)

class()

{base}

return object class

case_when()

{dplyr}

conditionally set values across multiple conditions

scale_color_brewer()

{ggplot2}

map colors to data with ColorBrewer

tibble()

{tibble}

create tibble

geom_smooth()

{ggplot2}

create smoothed lines to plot

guides()

{ggplot2}

set guides for scale

cumsum()

{base}

calculate the cumulative sums of a vector

coord_fixed()

{ggplot2}

force aspect ratio between data units on axes

geom_segment()

{ggplot2}

plot line segment

rnorm()

{stats}

generate random sample from normal distribution

unique()

{base}

return vector with duplicate elements removed

log10()

{base}

compute base 10 logarithm

scale_color_gradient()

{ggplot2}

scale color aesthetic to continuous color gradient

slice_head()

{dplyr}

select the first (specified) number of rows

scale_x_continuous()

{ggplot2}

scale x axis to be continuous

filter()

{dplyr}

keep rows based on values of columns

geom_hex()

{ggplot2}

create heatmap of bin counts using hexagons

geom_boxplot()

{ggplot2}

add layer of boxplots to plot

scale_color_manual()

{ggplot2}

map colors to data manually

scale_x_log10()

{ggplot2}

scale x axis to be log base 10

scale_y_continuous()

{ggplot2}

scale y axis to be continuous

n()

{dplyr}

return current group size

aes()

{ggplot2}

create aesthetic mappings between data and plot

row_number()

{dplyr}

rank vector elements with ties set to first

quote()

{base}

returns quoted expression

The end!