A simple Leaflet wrapper which enables users to plot the data retrieved from the LTA APIs on an interactive map of Singapore. Some basic options are provided for ease of use. Note that this function only works automatically with outputs from getTaxiAvail, getCarparkAvail, getTrafficIncidents, getVMS, and getTrafficImages from this package. For all others, please obtain data for the coordinates and rename the respective columns to 'Latitude' and 'Longitude'.
exploreSGMap(dataframe, popup = NA, cluster = FALSE, colour = "red", size = 5, alpha = 0.5)
dataframe | The dataframe containing the latitude/longitude data |
---|---|
popup | Variable to be displayed when a marker is clicked on - default is NA, needs to be a string of the variable name |
cluster | Whether to cluster the markers or not - default is FALSE |
colour | Colour of the markers - default is 'red' |
size | Size of the markers - default is 5 |
alpha | Opacity of the markers - default is 0.5 |
An interactive map of Singapore with the coordinates plotted as circular markers on the map
# NOT RUN { mydata <- getTrafficImages(mykey) exploreSGMap(mydata, cluster = FALSE, colour = 'black', size = 7, alpha = 0.7) # }