Lab 1E
Directions: Follow along with the slides and answer the questions in red font in your journal.
food
.food
data and make some new multiple variable plots you haven’t created before!sodium
on the y-axis and sugar
on the x-axis.protein
also have more calories
? Why do you think that?protein
and calories
variables in your code? Does the relationship between the variables change?protein
and calories
change when the snack is either Salty
or Sweet
? Write down the code you used to answer this question.groups
argument much like we did for bargraphs (use the search feature in the History pane if you need help).sodium
, sugar
, cost
, salty_sweet
.Create a dotPlot
or histogram
of the calories
variable, but facet the data using:
How does the healthy_level
of a Salty
or Sweet
snack impact the number of calories in the snack?
healthy_level
as a categorical variable, R
recongizes it as a numerical variable.
str
command to confirmhistograms
or dotPlots
do not have labels but rather tick-markshealthy_level
variable into a factor later oningredients
than less healthy snacks?ingredients
of a snack? Describe their relationships.