Questions tagged [rmaps]

An R package to create, customize and publish interactive maps from R.

rMaps is an R package to create, customize and publish interactive maps from R. It supports multiple mapping libraries, including leaflet, datamaps and crosslet.

References:

34 questions
4
votes
2 answers

Using a projection with xlim/ylim in R with the "maps" package results in a bigger map

I'm using R with the maps/mapproject/maptools packages to plot some maps and noticed a behavior which seems counter-intuitive to me and actually limits what I can do. Drawing a map of Europe (with the limits taken from the ETRS89 / ETRS-LCC, so…
fsmunoz
  • 75
  • 1
  • 5
4
votes
1 answer

Shading counties using FIPS code in R map

I am looking for a way to shade counties on the US maps in R. I have list of numeric/char county FIPS code that I can input as parameter. I just need to highlight these counties -- so would just need to shade them and there are no values or…
rajvijay
  • 1,641
  • 4
  • 23
  • 28
3
votes
1 answer

rMaps in Shiny: Legend and labels are not getting displayed in US choropleth in shiny app

Legend and Labels (state abbreviations) are not getting displayed in US choropleth in shiny app. However, when I run the code in global.R functions in RStudio console, both labels and legend are displayed fine. Please help! Here is the…
3
votes
0 answers

rMaps library for interactive maps doesn't seem to work

I tried to reproduce example from here, I copied the code for you : require(devtools) install_github('ramnathv/rCharts@dev') install_github('ramnathv/rMaps') library(rMaps) crosslet( x = "country", y = c("web_index", "universal_access",…
Stéphanie C
  • 809
  • 8
  • 31
2
votes
2 answers

Why does my plot of a raster in R blur in saved file?

I'm hoping to export a map with a raster plotted on it as a .pdf or some other vector file. For some reason, when I save it as a .pdf or .ps file, the raster is blurry/fuzzy/smeared and unusable. Any tips for fixing this? A .png saves with the…
druryj
  • 41
  • 3
2
votes
1 answer

Shiny renders a responsive rCharts leaflet map once, but is blank if you change the input variable

I am producing a Shiny App that produces a leaflet (rCharts) map depending on which bus route you pick. Everything renders perfectly at first glimpse, but if you change the route number, an empty map appears (not even a tilelayer). This isn't…
cnmillar
  • 327
  • 2
  • 13
1
vote
1 answer

How to calculate geographic centroids by group?

I need to calculate the geographic centroid of different polygons grouped by category. Let me give an example. Let's say we have this sf dataset library("sf") nc <- st_read(system.file("/shape/nc.shp", package="sf")) Let's say we group the…
rctoni
  • 111
  • 6
1
vote
1 answer

R: creating a route map with multiple filters

~~EDIT~~~ The answer below worked, please see my code to be complete and question answered for anyone who needs the help in the future. ~~~~~~~~ I am trying to create a dashboard in R (first one!) that will create a map that shows thousands of…
Kevin
  • 1,974
  • 1
  • 19
  • 51
1
vote
0 answers

us.cities from maps package in r not working

I am trying to add US cities to my map in R. When I add world cities: ggplot(data = usa) + geom_polygon(aes(x = longitude, y = latitude, group = group, fill = id)) + coord_quickmap() + guides(fill = FALSE) + theme(axis.text =…
zanahorias
  • 140
  • 12
1
vote
0 answers

Function to calculate the area in hectares of a class in raster?

I have been working in R-GIS for some time and now I start to need a function to calculate the area of pixels in hectares, but with the raster in lat/lon coordinates and in degree resolution. It works, but if someone could improve some parts to use…
1
vote
1 answer

How to save a leaflet map (created with rMaps) as a html widget?

Question 1 I try to save a leaflet map created with rMaps here, into a html file. L2 <- Leaflet$new() L2$setView(c(29.7632836, -95.3632715), 10) L2$tileLayer(provider = "MapQuestOpen.OSM") L2 library(htmlwidgets) saveWidget(L2,"t.html") But I got…
John Smith
  • 1,604
  • 4
  • 18
  • 45
1
vote
0 answers

Intensity plot in map using googleVis in R

I have a long list (around 900 thousand) of latitude and longitude (please note that these coordinates vary up to 13th decimal places) with category of crime done in this coordinates. This is snapshot of data Problem: I want to plot a heat map…
Rajan
  • 453
  • 4
  • 22
1
vote
0 answers

Plotting points onto a JPG raster map in R

I have a fictional map and want to plot points onto it. The map is a fictional map from a fantasy book, so has no spatial reference. The points will show where events from the book have taken place. I essentially wish to create an interactive map,…
user3200293
  • 181
  • 5
  • 18
1
vote
2 answers

R, rMaps, datamaps: Moving the legend of a choropleth map

I'm attempting to center the legend below a choropleth map of the United States (an example of a generic map similar to what I've created). I'm not very familiar with JS or CSS, but I poked around in the datamaps.all.min.js file located in the…
mcjudd
  • 1,520
  • 2
  • 18
  • 33
1
vote
1 answer

Not displaying route using rMaps and leaflet routing machine plugin

I am following this example: https://gist.github.com/ramnathv/9998388 My goal is to plot a route. Using RStudio it is working properly but when I want to use the R Console it is only plotting the map but not the route. Anyone has a solution for…
aruizga
  • 644
  • 1
  • 4
  • 19
1
2 3