Changes

Jump to navigation Jump to search
648 bytes added ,  13:34, 21 September 2020
no edit summary
[[Category:Internal]]{{Project[[Internal Classification::Internal Resources| ]]Has project output=|Has sponsor=McNair Center|Has title=Mapping on R|Has owner=Albert Nabiullin,|Has keywords=Tool|Has project status=Complete}}
== Interactive Maps==
*Use map bounds and mouse events to drive Shiny logic
*Sample Code:
SBDE <- read.csv("SBDE.csv") #Import the CSV file with your data set
library(leaflet) #Use the leaflet library
#data(SBDE)
m <- leaflet(data = SBDE) %>% #Define your map with the data you specified earlier
addTiles() %>% # Add default OpenStreetMap map tiles. Make sure to use the %>% symbol!
addMarkers(~longitude, ~latitude, popup = ~as.character(link)) %>% #Add points on your map
addLegend("bottomright", colors= "#1878cd", labels="Resources", title="Houston Small Biz Guide") #Add a legend
m # Print map
Helpful links: http://www.r-bloggers.com/interactive-maps-for-the-web-in-r/<br>
To find HEX codes for RGB colors: http://www.javascripter.net/faq/rgbtohex.htm

Navigation menu