Changes
Jump to navigation
Jump to search
← Older edit
Mapping on R
(view source)
Revision as of 13:34, 21 September 2020
732 bytes added
,
13:34, 21 September 2020
no edit summary
{{Project
|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
:
==
===Mapping with Leaflet===
[[Image:leaflet.
jpg
png
|200px|thumb|right|Interactive map on Leaflet]][[Image:marker.
jpg
png
|200px|thumb|right|Interactive map with Markers]]
Leaflet is one of the most popular open-source JavaScript libraries for interactive maps.
This R package makes it easy to integrate and control Leaflet maps in R.
Introduction: https://rstudio.github.io/leaflet/
<br>
Markers: https://rstudio.github.io/leaflet/markers.html
<br>
Github: https://github.com/rstudio/leaflet
<br>
Features
*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
Ed
Bureaucrats
,
Interface administrators
,
Administrators (Semantic MediaWiki)
,
Administrators
7,612
edits
Navigation menu
Personal tools
Log in
Request account
Namespaces
Page
Discussion
Variants
Views
Read
View source
View history
More
Search
Navigation
Sites
Wiki
Articles
Sections
Projects
Papers in Development
Paper Reviews
Team Members
Legislation
Research Computing
Organizations
Incubator Project
McNair Center
Berkeley's BPP Group
NBER Patent Data
Help
General help
Team help
Administration
Access RDP Server
Batch Upload Files
Tools
Special pages
Printable version