psyteachr_dsrr Ch. 10

geom_col()

{ggplot2}

create bar chart based on values in data

read_excel()

{readxl}

import either xls or xlsx Excel files

scale_x_continuous()

{ggplot2}

scale x axis to be continuous

library()

{base}

load R packages

geom_smooth()

{ggplot2}

create smoothed lines to plot

paste0()

{base}

concatenate character vectors with no space between elements

count()

{dplyr}

count unique values of variables

tribble()

{tibble}

create row-wise tibble

seq()

{base}

create sequences of numbers

geom_bar()

{ggplot2}

create bar chart based on counts in data

is.na()

{base}

determine whether elements of vector are missing

n()

{dplyr}

return current group size

as.numeric()

{base}

coerce object to numeric

c()

{base}

create vector of numbers, characters, etc.

ifelse()

{base}

conditionally set values

round()

{base}

round values to specified number of digits

ggplot()

{ggplot2}

create a plotting area

annotate()

{ggplot2}

annotate plot independent of data

pivot_longer()

{tidyr}

pivot data frame to be longer

arrange()

{dplyr}

change order of rows based on values of columns

ungroup()

{dplyr}

remove grouping

arrow()

{grid}

plot arrows

geom_text()

{ggplot2}

adds text to plot

tibble()

{tibble}

create tibble

theme()

{ggplot2}

customize non-data components of plot

labs()

{ggplot2}

modify axis, legend, and plot labels

year()

{lubridate}

return or set year component of a date-time

rank()

{base}

return sample ranks of the values in a vector

bind_rows()

{dplyr}

bind rows in dplyr

read_csv()

{readr}

read comma delimited files

geom_point()

{ggplot2}

add layer of points to plot

filter()

{dplyr}

keep rows based on values of columns

select()

{dplyr}

keep specified columns

str_replace()

{stringr}

replace first matched pattern in a string

as.integer()

{base}

coerce to integer

list()

{base}

create recursive vector (list)

aes()

{ggplot2}

create aesthetic mappings between data and plot

scale_y_continuous()

{ggplot2}

scale y axis to be continuous

group_by()

{dplyr}

group data by levels of column

anti_join()

{dplyr}

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

left_join()

{dplyr}

join two data sets keeping the observations in the left one

lm()

{stats}

fit linear model

mutate()

{dplyr}

create or modify data columns

The end!