psyteachr_ads Ch. 10

annotate()

{ggplot2}

annotate plot independent of data

c()

{base}

create vector of numbers, characters, etc.

n()

{dplyr}

return current group size

select()

{dplyr}

keep specified columns

geom_bar()

{ggplot2}

create bar chart based on counts in data

arrange()

{dplyr}

change order of rows based on values of columns

as.integer()

{base}

coerce to integer

ggplot()

{ggplot2}

create a plotting area

seq()

{base}

create sequences of numbers

ifelse()

{base}

conditionally set values

filter()

{dplyr}

keep rows based on values of columns

geom_text()

{ggplot2}

adds text to plot

bind_rows()

{dplyr}

bind rows in dplyr

scale_y_continuous()

{ggplot2}

scale y axis to be continuous

count()

{dplyr}

count unique values of variables

rank()

{base}

return sample ranks of the values in a vector

mutate()

{dplyr}

create or modify data columns

labs()

{ggplot2}

modify axis, legend, and plot labels

anti_join()

{dplyr}

join two data sets dropping all observations in x that have a match in y

str_replace()

{stringr}

replace first matched pattern in a string

geom_smooth()

{ggplot2}

create smoothed lines to plot

pivot_longer()

{tidyr}

pivot data frame to be longer

read_csv()

{readr}

read comma delimited files

is.na()

{base}

determine whether elements of vector are missing

round()

{base}

round values to specified number of digits

aes()

{ggplot2}

create aesthetic mappings between data and plot

paste0()

{base}

concatenate character vectors with no space between elements

theme()

{ggplot2}

customize non-data components of plot

as.numeric()

{base}

coerce object to numeric

geom_freqpoly()

{ggplot2}

create frequency polygon

read_excel()

{readxl}

import either xls or xlsx Excel files

ungroup()

{dplyr}

remove grouping

group_by()

{dplyr}

group data by levels of column

list()

{base}

create recursive vector (list)

scale_x_continuous()

{ggplot2}

scale x axis to be continuous

lm()

{stats}

fit linear model

geom_col()

{ggplot2}

create bar chart based on values in data

arrow()

{grid}

plot arrows

tribble()

{tibble}

create row-wise tibble

geom_point()

{ggplot2}

add layer of points to plot

tibble()

{tibble}

create tibble

left_join()

{dplyr}

join two data sets keeping the observations in the left one

year()

{lubridate}

return or set year component of a date-time

library()

{base}

load R packages

geom_histogram()

{ggplot2}

create histogram of counts as bars

The end!