This repository holds exercise and solutions files related to the First Steps in R and RStudio Skills Series offered by Arcus Education.
Here is a breakdown of some of the topics covered in each exercise:
- Source and Visual buttons in the RStudio IDE
- The green "play" button that executes code chunks in the RStudio IDE
- Loading the
tidyverse
package usinglibrary
- Verbose output that can happen from loading packages
- Loading a library allows you to use its functions
- Using the
read_csv
function to ingest a csv file - Working with the Environment tab in the RStudio IDE
- Blue triangle beside data frames
- Clicking on the names of data frames
- Good names for objects (variables, columns) in R
head
,tail
,summary
as ways to examine an object in R- R often has multiple ways to do the same thing
- Help in R and reading help documentation
- Rendering a Quarto document
- Using chunk options like warning=FALSE and message=FALSE
- The grammar of graphics in ggplot2:
- Start with a tidy data frame
- Add a geometric representation
- Add aesthetic mappings
- Working with histogram binwidth "error" message
- You don't necessarily have to pass labels for every argument
- "color" (0-1D) vs "fill" (2D) in ggplot2
- Mapping color vs setting color
- Adding labels using
labs
- Using palettes (in particular,
scale_color_brewer
) - Specifying exact colors (in particular,
scale_fill_manual
) - Using
position
(stacking vs side-by-side) - Using
alpha
(transparency) - Faceting
- Naming code chunks
- Using the code chunk navigator in the RStudio IDE
- Data types in R
str()
to look at data types (mirrored with blue triangle in Environment tab)View()
to look within data frame (mirrored with clicking name in Environment tab)- Factors in R
- Using
mutate
to transform variables to factors (including ordered) - Using
select
andfilter
to subset data
- Hands on work!