Figures below show the frequency of hours in weekdays and weekends on the number of trips. As with the previous illustrations, the start (blue) and end (red) stations with highest frequency of trips are labelled.
ggplot(data=weekdayhour,aes(y=freq,x=time,group=1))+geom_line()+
geom_label_repel(label=weekdayhour$StartStation.Name,size=4, nudge_y = 1500000,alpha=0.5,col="blue",
arrow = arrow(length = unit(0.2,"cm")))+
ylim(-25000,1800000)+scale_x_discrete(limits=seq(0,23))+xlab("Hour")+ylab("Number of trips in weekdays")+
geom_label_repel(label=weekdayhour$EndStation.Name,size=4, nudge_y = 600000,alpha=0.5,col="red",
arrow = arrow(length = unit(0.2,"cm")))+
labs(caption= "Blue and red labels are the most frequently visited start stations and end stations individually within given hour")+
theme(plot.caption = element_text(size = 12.5,hjust = 0.5))+
theme(axis.text=element_text(size=12),
axis.title=element_text(size=14,face="bold"))+
geom_text(data=weekdayhour,aes(y=-25000,x=time),label=weekdayhour$perc)
During weekdays, the total trips are low from 00:00 to 05:00 and increase up to the first peak at 08:00 then the trips level off again and stay roughly constant until 15:00. The second peak where bicycle use rises is reached at 17:00 and then continues to drop all the way down to around 50000 at 23:00. The most frequently used start stations (blue) for bicycle trips between 6:00-10:00 are Waterloo and Belgrove. Similarly, these stations are the most frequently used end stations (red) at 16:00- 19:00. These stations are located in the centre of London on busy commuter pathways. This potentially suggests cyclists use public bicycles to go to work roughly at 08:00 then cycle back from work at around 17:00 during the week. In the afternoon the most popular start stations and end station is Hyde park. Throughout the evening and later at night bicycle stations near Shoreditch are the most popular start stations with sporadic destinations.
ggplot(data=weekendhour,aes(y=freq,x= weekendhour$time,group=1))+geom_line()+
geom_label_repel(label=weekendhour$StartStation.Name,size=4, nudge_y = 300000,alpha=0.5,col="red",
arrow = arrow(length = unit(0.2,"cm")))+
ylim(-10000,500000)+scale_x_discrete(limits=seq(0,23))+xlab("Hour")+ylab("Number of trips in weekend")+
geom_label_repel(label=weekendhour$EndStation.Name,size=4, nudge_y = 130000,alpha=0.5,col="blue",
arrow = arrow(length = unit(0.2,"cm")))+
labs(caption= "Blue and red labels represent the most frequent visited start and end stations,respectively")+
theme(plot.caption = element_text(size = 12.5,hjust = 0.5))+
theme(axis.text=element_text(size=12),
axis.title=element_text(size=14,face="bold"))+
geom_text(data=weekendhour,aes(y=-10000,x=weekendhour$time),label=weekendhour$perc)
A curve can be seen in weekends bicycle trips. The trips start to grow when the sun rises, and falls off in the evening. Areas surrounding Hyde Park convincingly take over day time cycle route use between 10:00 - 22:00. Between 0:00 - 6:00, and similar to weekdays analysed above, cyclists prefer to get their bikes near Shoreditch, and the most popular end stations are Haggerston or Liverpool street.
map<- get_map(location = c(lon =mean(weekdayhour$s.lon),lat = mean(weekdayhour$s.lat)),
source="google",maptype="roadmap",zoom=11)
## Map from URL : http://maps.googleapis.com/maps/api/staticmap?center=51.512247,-0.119165&zoom=11&size=640x640&scale=2&maptype=roadmap&language=en-EN&sensor=false
ggmap(map)+
theme(plot.title = element_text(hjust = 0.5,size = 13))+
geom_point(data=weekdayhour,aes(x=s.lon,y=s.lat))+
geom_point(data=weekdayhour,aes(x=e.lon,y=e.lat))+
geom_label_repel(data=weekdayhour, aes(x=s.lon,y=s.lat,label=weekdayhour$starttimeandhour),
color="blue",nudge_y = 0.015,nudge_x = -0.1,label.size = 0.07,
size=5,alpha=0.8
)+
xlim(range(coor$s.lon))+
ylim(range(coor$s.lat))+
# arrow =arrow(length =unit(0.5,"cm")))+
geom_label_repel(data=weekdayhour, aes(x=e.lon,y=e.lat,label=weekdayhour$endtimeandhour),
color="red",segment.size = 0.5,segment.colour = "red",
#arrow = arrow(length = unit(0.5,"cm")),
nudge_y = -0.03,nudge_x = 0.15,size=5,alpha=0.8,label.size = 0.07,segment.alpha = 0.5)
## Scale for 'x' is already present. Adding another scale for 'x', which
## will replace the existing scale.
## Scale for 'y' is already present. Adding another scale for 'y', which
## will replace the existing scale.
ggmap(map)+
theme(plot.title = element_text(hjust = 0.5,size = 13))+
geom_point(data=weekendhour,aes(x=s.lon,y=s.lat))+
geom_point(data=weekendhour,aes(x=e.lon,y=e.lat))+
geom_label_repel(data=weekendhour, aes(x=s.lon,y=s.lat,label=weekendhour$starttimeandhour),
color="blue",nudge_y = 0.015,nudge_x = -0.1,label.size = 0.07,
size=5,alpha=0.8
)+
xlim(range(coor$s.lon))+
ylim(range(coor$s.lat))+
# arrow =arrow(length =unit(0.5,"cm")))+
geom_label_repel(data=weekendhour, aes(x=e.lon,y=e.lat,label=weekendhour$endtimeandhour),
color="red",segment.size = 0.5,segment.colour = "red",
#arrow = arrow(length = unit(0.5,"cm")),
nudge_y = -0.03,nudge_x = 0.15,size=5,alpha=0.8,label.size = 0.07,segment.alpha = 0.5)+
geom_point(data=weekendhour,aes(x=-0.17027955,y=51.50645),cex=110,alpha=0.025,col="yellow")+
geom_point(data=weekendhour,aes(x=-0.07813092,y=51.52638),cex=130,alpha=0.025,col="green")
## Scale for 'x' is already present. Adding another scale for 'x', which
## will replace the existing scale.
## Scale for 'y' is already present. Adding another scale for 'y', which
## will replace the existing scale.
For weekdays, the locations of stations are quite spread out, and the stations around Waterloo and regions around Belgrove occupy the most percentage of trips.
Two major clusters shown in the weekends are highlighted in yellow and green, one around Hyde Park, and one centred in Shoreditch. The stations represent day time around Hyde Park have much greater percentage of trips per hour than Shoreditch.