Zooming Through Data

Lab 1D

Directions: Follow along with the slides, completing the questions in blue on your computer, and answering the questions in red in your journal.

Space, Click, Right Arrow or swipe left to move to the next slide.

Data with Clarity

Another plotting function

More options

Splitting datasets

Altering the layout

layout = c(1,2)

Subsetting

The filter function

food_salty <- filter(food, salty_sweet == "Salty")

So what’s really going on?

food_salty <- filter(food, salty_sweet == "Salty")

3 parts of defining rules

More on ==

head(~salty_sweet == "Salty", data = food)

Saving values

food_salty <- filter(food, salty_sweet == "Salty")

Saving our subset

food_salty <- filter(food, salty_sweet == "Salty")

Including more filters

my_sub <- filter(food, salty_sweet == "Salty", calories < 200)

Put it all together

main = "Distribution of sugar in sweet snacks"