-
Notifications
You must be signed in to change notification settings - Fork 46
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
HW02 - Daniel Krochmal #34
base: master
Are you sure you want to change the base?
Conversation
sn0wscape
commented
Jul 14, 2020
•
edited
Loading
edited
- a complete HW02 assignment passed in this single commit
- Added answers to the questions in part A and corrected the code
- Added comments to the code in part B
+ Added answers to the questions in part A and corrected the code + Added comments to the code in part B
mpg %>% | ||
ggplot(mapping = aes(x = displ, y = hwy)) + | ||
geom_point(mapping = aes(color = drv)) + | ||
geom_smooth(se = F) #se = F makes it so it won't show the error in the line of fit |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was unsure how to create a single smoothing line for all of the data on graph 4. I found that using geom_smooth(se = F) alone created a smoothing line for each drv dataset. However, using the "group" function, shown here: geom_smooth(aes(group = 1), se = F, color = "black", size = 1), I was able to create one single smoothing line for all drv datasets.
) + | ||
|
||
#Rename x and y labels | ||
xlab("Diamond Cut") + |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As you pointed out on my HW02_B, x and y axis labels can be named within a single labs function. However, the xlab and ylab functions you used here seem nice and simple. They would be great for scenarios where everything does not need a complete relabeling.
Thanks! I actually think that the code you cited is a little more elegant, so I appreciate it. |