Open ChadFibke opened 5 years ago
Hi @ChadFibke
Thanks for your awesome comments. I will apply the advice in my following assignments. Some areas are still not clear.
When you said "There are still many nested objects with uninformative names. p1,p2,p3 won't help you if you are trying to troubleshoot issues when using plot_grid." Did you mean I should use more elaborative names in the example below š ? Say instead of p1
I should use plot_1
?
p1 <- mean_lifeExp_cont %>%
ggplot(aes(year, mean_lifeExp,color=continent))+
geom_line(size=0.5)+
scale_color_manual(values=continent_colors)+ #I am using colors provided by the gapminder package
geom_point(shape=3,stat='summary', fun.y=sum) +
stat_summary(fun.y=sum, geom="line")+
theme_bw()+
scale_x_continuous(breaks=mean_lifeExp_cont$year)
p2<- mean_lifeExp_cont %>%
ggplot(aes(year, continent, fill = mean_lifeExp)) +
geom_tile(color = "gray40") +
scale_x_continuous(expand=c(0,0)) +
scale_fill_gradient(low = "red", high = "midnightblue")+
theme_classic()
p3<-mean_lifeExp_cont %>%
ggplot(aes(reorder(continent, mean_lifeExp), mean_lifeExp))+
geom_col(aes(fill = mean_lifeExp), size=0.1)+
coord_flip()+#flip the axes for a horizontal representation - I prefered horizontal bars
scale_fill_gradient2(low = "white", mid="red", high = "midnightblue")+theme_light()+labs(y="Mean Life Expectancy", x="Continent") #because of coord flip, the labels change too!
plot_grid(p1, p2, p3, labels = "AUTO", nrow=3)
I removed y-axis labels because I thought it redundant to have the y axis labels repeated on plots that appear side by side - it may look like the plots are overlapping - I removed labels as seen in my code š .
I also tried to show other representations of selecting outliers and elaborated on why it's not helpful to plot the way I did in option 2 of section4. Maybe I should avoid walking my readers through other variations out there and what to avoid. I think its a lot of work for me š as well yet not all visitors will take the time to read everything. Thanks for pointing that out.
Thanks for the helpful comments. Thanks for the helpful links as well. Many thanks
Hey,
Yes you should use more specific names even when you are using the plots to plot in a more complex grid!
You are right it would be redundant to keep both y axis; however, I'm talking about the very first table plot combo. All of the P's look like they are slightly cut off. Your heat maps where fine!
There was a lot to unpack in your assignment, and I missed that. I look at it again and yes you are right, but your Europe line graph is still a bit messy when it comes to labels and colors! For next time can you try to only label/color country lines with values higher than X (mission impossible), and even explaining your output, and reasoning with point form?
Other than that you did really good!
@ChadFibke
Thanks for the clarity. I will do as advised.
Many thanks Rebecca
Coding Style
The good :thumbsup:
Simple effect code!
Good name choice for some of your created objects! They are informative!
Needs work :thumbsdown:
There are still many nested objects with uninformative names. p1,p2,p3 wont help you if you are trying to trouble shoot issues when using plot_grid.
Try to break up some of your ggplot code for better readability: