Skip to content
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

Viola Nawrocka - Homework 2 #49

Open
wants to merge 16 commits into
base: master
Choose a base branch
from

Conversation

violecule
Copy link

No description provided.

@violecule violecule changed the title Homework 2 Viola Nawrocka - Homework 2 Jul 17, 2020
@@ -0,0 +1,178 @@
---

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So in order for the graphs you made to be viewable on github you need to just quickly go back into RStudio and "knit" your .Rmd files that you already edited. That will create an .md file with the same name "HW02_B_Mimic_starter - Viola graphs.md" that you should commit, push and pull to the main repo. Then when I go to look at it on here I'll be able to see your code and your graphs at the same time :)

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah! Thank you! I'll try fixing it!

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No problem! I think a lot of people don't know this so it's hard to comment on each other's graphs lol

geom_point(data=(mpg %>% filter(model=="corvette")), aes(x=displ, y=hwy), color = "blue") +
xlim(1,8) +

#Initially tried to use: geom_text(data=(a %>% filter(model=="Corvette")), aes(label=paste(model, "," , year)), color = "black", nudge_x=0.2, nudge_y=-2), but that would only let me move the labels by the same amount in x and y directions, so I decided to switch to annotate, since there were only 5 labels to add (not that much work really).
Copy link

@abockhughes abockhughes Jul 19, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ahhh see this is what I was having trouble with for a long time until I realized that he'd given us the answer at the beginning by making us load "ggrepel" which allows you to use "geom_text_repel" which makes the plot points stagger in a way that makes all the text visible. It seems to be the only way to move the data points all together without moving them all in the same direction, which is the problem you and I were running into :) But the "paste" function would have worked if you'd done it that way.

ggplot(mapping = aes(x = Sepal.Length, y = Petal.Length, color = Species)) +
geom_point() +
geom_smooth(method= lm, se = F, color = "black") +
facet_wrap(~ Species, scales = "free_y")

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice job finding facet_wrap, that took me a while and I don't think a lot of other people figure it out ;)

@@ -0,0 +1,129 @@
What went wrong?

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can see the graphs now! I have to go to the top right corner of this file with the "...", click the dots and then say "see file" and it brings me to a github page with the graphs on them. Nice job!

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cool! Thank you for pointing it out. It makes it much easier to review!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants