cis-ds / Discussion

Public discussion
10 stars 15 forks source link

Warning message on Question 5: Ignoring unknown parameters: fill #173

Closed akerah closed 3 years ago

akerah commented 3 years ago

Hello,

I am getting this error message when I try to graph my months

month_month<-mass_shootings %>%group_by(month)%>% count()

ggplot(data=month_month, mapping = aes(x=month,y=n)) + geom_freqpoly(stat = "identity",)+ labs(title = "Number of mass shootings by Month", x = "Month", y= "Number of shootings" )

fdicera commented 3 years ago

It looks like you have an extra comma after "identity" which might be causing the warning message. I would try removing it, and seeing if that helps.

akerah commented 3 years ago

Did not help. Am I approaching this correctly?

fdicera commented 3 years ago

For Question 5, it asks for a bar chart of the shootings per month, so geom_bar() is the function you want to use. Since geom_bar() uses the "count" stat by default, you don't need to do your first step of grouping the months and counting them (as the counts for each month will automatically go on the y-axis). You'll want to adjust your inputs into ggplot() accordingly (remember that geom_bar() only needs an x-variable). You'll also need to think about how to order the months chronologically on your plot (this resource may help).

akerah commented 3 years ago

Thank you, I fixed my issue.