This is the question:
Using a single pipe function, create a new variable called
year_season
that pastes together year and season (paste(year, season, sep="-")).
Then, summarize the average, minimum, and maximum number of bikes
and construct a plot with year_season
on the x-axis and number
of bikes on the y-axis. Show three lines (geom_line): one for the
minimum, one for the maximum, and one for the average value.
Somehow differentiate the max/min from the average value (you can use
linetype, color, or line size to do this; completely up to you).
Note: In order for this to work, the first line of your plot needs to be this (without the quotes): 'ggplot(aes(year_season, count_avg, group=1)) +'
This is the code i've done but I'm not sure why this is wrong and why i'm not getting a plot:
bikes %>%
mutate(year_season = paste(year,season, sep="-")) %>%
summarize (avg_bikes=mean(count), min_bikes=min(count),
max_bikes=max(count)) %>%
ggplot(aes(year_season,avg_bikes,group=1))+
geom_line(aes(avg_bikes, group=avg_bikes))+
geom_line(aes(min_bikes, group=min_bikes))+
geom_line(aes(max_bikes, group=max_bikes))