Lecture 10
Duke University
STA 199 - Fall 2022
9/29/22
Open your ae-07
project in RStudio, render your document, and commit and push.
Exam 1 is released on today at noon and is due at 2pm on Monday.
No TA OH during the exam.
I will have OH 4-5pm on Friday on Zoom: bit.ly/minezoom
Any clarification questions must be emailed to me only.
No Slack use during the exam, even about non-exam related questions.
ae-07
ae-07
project.Pull.
Once again, render, commit, and push.
Yes! However, you should be striving the solve the questions in the style that we learned. For example, ggplot2 is not the only plotting package in R. But we expect you to use ggplot2 when making plots, not another system.
Yes, will be posted Friday at midnight.
Yes, though you shouldn’t worry about matching it exactly. More that it should be legible and if the plot you’re replicating is wider than taller, the plot you’re submitting should be as well.
<-
vs. =
<-
: assignment=
: equals=
vs. ==
vs. %in%
==
: is equal to%in%
: inx = c(1, 2, 3)
y = c(3, 4, 5)
# do elements in x equal those in y?
# check if each element in x is equal to the
# corresponding element in y
x == y
[1] FALSE FALSE FALSE
%in%
vs ==
%in%
vs ==
|>
vs. %>%
|>
: pipe operator (newer – what we’ve been using in class)%>%
: pipe operator (older – what you see in the videos)Provide a 1-2 sentence interpretation of the relationship between city and highway mileage of cars.
Provide a 1-2 sentence interpretation of the relationship between city and highway mileage of cars, taking into consideration whether they’re 4 wheel drive, front wheel drive, or rear wheel drive.
geom_jitter()
vs. geom_point()
The same dataset is plotted with geom_jitter()
and geom_point()
below. Why do the two plots look different?
distinct()
fct_relevel()
Reorder levels based on an order you provide
fct_reorder()
Reorder levels based on another variable
fct_other()
Lump some levels to “Other”
Let’s visit https://www.garrickadenbuie.com/project/tidyexplain!