Qi Shao
2015/01/25
Bike sharing systems are a means of renting bicycles where the process of obtaining membership, rental, and bike return is automated via a network of kiosk locations throughout a city. Using these systems, people are able rent a bike from a one location and return it to a different place on an as-needed basis. Currently, there are over 500 bike-sharing programs around the world.
Related website: https://www.citibikenyc.com
This application is reading from http://www.citibikenyc.com/stations/json to fetch location, status and current availability for all stations in the New York City bike sharing imitative.
citibike <- fromJSON("http://citibikenyc.com/stations/json")
stations <- citibike$stationBeanList
colnames(stations)
[1] "id" "stationName"
[3] "availableDocks" "totalDocks"
[5] "latitude" "longitude"
[7] "statusValue" "statusKey"
[9] "availableBikes" "stAddress1"
[11] "stAddress2" "city"
[13] "postalCode" "location"
[15] "altitude" "testStation"
[17] "lastCommunicationTime" "landMark"
library(googleVis)
stations$loc=paste(stations$latitude, stations$longitude, sep=":")
M1 <- gvisMap(stations, "loc" , "stationName",
options=list(showTip=TRUE, enableScrollWheel=TRUE,
mapType='normal', useMapTypeControl=TRUE,
width=600,height=600))