-
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
Lucas Dyer HW02 #24
base: master
Are you sure you want to change the base?
Lucas Dyer HW02 #24
Conversation
@@ -1,6 +1,6 @@ | |||
--- | |||
title: "What went wrong?" | |||
author: "Robert Gruener" | |||
author: "Lucas Dyer" |
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.
It's a good practice to keep a record of the author, which I did not notice in my HW.
ggplot(data = mpg) + | ||
geom_point(mapping = aes(x = displ, y = hwy, color = "blue")) | ||
|
||
ggplot(data = mpg, aes(displ, hwy)) + |
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.
For me, I left the aes() function inside the geometries layer, but yeah, putting them inside ggplot() could be tidier.
@@ -42,6 +40,10 @@ data("diamonds") | |||
Using the diamonds dataset, make this graph: | |||
```{r graph1 code, echo=FALSE} |
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 would recommend changing "echo" to TRUE, so that codes will appear right above the graphs in the corresponding .md file, which makes it easier for others to review them!
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.
Thank you! I couldn't really remember what that function did, so I just left it as I saw it in anothe example.
iris$Species2 <-factor(iris$Species, levels=c("versicolor", "setosa", "virginica")) | ||
ggplot(iris, aes(Sepal.Length, Petal.Length))+ | ||
geom_point(aes(color=Species, shape=Species))+ | ||
facet_wrap(~Species2, scales = "free_y")+ |
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.
Thanks, this line has been really helpful, since I did not know that the axes of faceted figures can be synced in only one dimension.
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.
By the way, it might be a good idea to keep it coherent in how spaces are added, e.g., comparing to line 60, I would recommend "=" to be wrapped with spaces also in line 59.
|
||
scale_color_brewer(palette="Set2")+ | ||
scale_fill_brewer(palette="Set2")+ | ||
geom_dotplot(binaxis='y', dotsize=0.5, stackdir='center', aes( fill=class, color=class))+ |
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.
This is an interesting implementation, which creates well-aligned dots in y-direction comparing to the random style using jittering.
No description provided.