Questions tagged [ggmap]

A package for plotting maps in R with ggplot2

is an package that allows for the easy visualization of spatial data and models on top of Google Maps, OpenStreetMaps, or Stamen Maps using .

Resources:

1005 questions
0
votes
1 answer

ggmap / ggplot error when plotting points on a ggmap: [arguments imply differing number of rows]

The following code works fine: library(ggmap) mp2 <- ggmap::get_map(location="South America", zoom = 4, source="google") ggmap(mp2) + geom_point(aes(c(-60), c(-1)), size=15) # plot one single point on map generating this: Though the following…
Dan
  • 1,711
  • 2
  • 24
  • 39
0
votes
1 answer

Formatting the legend on map created with ggmap

I am using ggmap to create a map with points. The size of the point reflects the value of the variable. mapPoints <- ggmap(map) + geom_point(aes(x = Lat, y = Lon, size = KaskoAntal), data = mydata, alpha = .7, colour =…
hgaronfolo
  • 331
  • 1
  • 3
  • 9
0
votes
1 answer

Large white border when plotting maps using ggmap

I can plot a UK map with ggmap with a point like this: library(ggmap) UK_map <- get_map(location = c(-2.65, 53.7), zoom = 5, maptype = "hybrid") UK_map <- ggmap(ggmap=UK_map, extent = "device", legend = "right") UK_map <- UK_map + geom_point(data =…
luciano
  • 13,158
  • 36
  • 90
  • 130
0
votes
1 answer

Adding a legend to the ggplot map with shape

I have used two layers geom_point, with shape 24 and default. I would like to represent shapes and respective description in the legend. Can any one guide me how to do it. total_map<-ggmap(Map)+ geom_point(data =…
user2934433
  • 343
  • 1
  • 5
  • 20
0
votes
1 answer

avoid overlap of geom points in R

I am plotting points on a map, with the following code crime_poss_drugs$colorbucket<- as.numeric(cut(crime_poss_drugs$count,c(0,100,200,300,400,500,600,700,800,900,1100,Inf))) crime_prod_drugs$colorbucket<-…
user2934433
  • 343
  • 1
  • 5
  • 20
0
votes
1 answer

Error: Discrete value supplied to continuous scale issue

I am trying to plot a heat Map in R using ggmap. In this regard, i have followed this example. Density2d Plot using another variable for the fill (similar to geom_tile)? But when i execute the final line . i.e. print(pred.stat.map.final) in the…
Mangesh Kaslikar
  • 591
  • 3
  • 13
  • 23
0
votes
1 answer

ggmap running slowly while plotting multiple paths

I obtained many different GPS traces and am trying to plot all the paths onto one map using ggmap. I am trying to produce something similar to the work done by Flowing Data, where that author used plotkml instead of ggmap (which I prefer).…
stackoverflowuser2010
  • 38,621
  • 48
  • 169
  • 217
0
votes
1 answer

is it possible to clip a polygon to the bounding box of a base map?

I have a a polygon overlay of some adjoining government districts, I want to show data in the districts on separate maps, but as the bounding box for the basemap is smaller than the polygon the latter is is distorted: map output The code I've used…
Dave
  • 21
  • 1
  • 5
0
votes
2 answers

ggmap package plot filled polygon on map

For days i'm searching on the web the most simple way to plot a shaded polygone above a map generated with the get_map command. For the polygone I have a few (latitudes, longitudes) points. I know how to do this with *.shp files must it's too much…
Vincent ISOZ
  • 173
  • 1
  • 7
0
votes
1 answer

How to use Seq_along for multiple dates from a list in a loop

I have been fiddling around with a R project and have hit a roadblock. Ill explain what the goal is, It is to make a set of plots that show points plotted on a map based on their measurement time (water_level_date) and plot accordingly over a…
Cam.f
  • 105
  • 2
  • 9
0
votes
0 answers

change color gradient for ggmap in r

I am trying to visualize a track on a map using ggmap + geom_path. This works fine with my coordinate dataset. Now I just want to change the color of the path using another parameter's values, which vary from -0.4 to 1. I am using the following part…
ArmMiner
  • 215
  • 3
  • 5
  • 15
0
votes
1 answer

ggmap not plotting all points on map from dataframe

The problem I am having is that every time I try to plot my points onto a map it seems to remove them. #getmap library(ggplot2) library(ggmap) testmap <- get_googlemap(c(lon=135,lat=-32) ,zoom=6, xlim=c(127,142), ylim=c(-23,-34)) save(testmap,…
Cam.f
  • 105
  • 2
  • 9
0
votes
1 answer

fix minimum and maximum of the colourbar legend in ggmap

This is supposed to be a super easy question, but I am still learning ggplot and can't make it work. I would like to fix the minimum and maximum value of the colourbar in this plot, to compare the plot with others graphically, I mean to have the…
Irene
  • 744
  • 1
  • 12
  • 36
0
votes
1 answer

Custom UTM coordinates to ggmap

On maps obtained from osm/cloudmade etc using get_map, how does one change the projection to a custom UTM coordinate using Proj4/CRS? Can something like pc0.1<- spTransform(pc0,CRS("+proj=utm +zone=32 +datum=WGS84 +units=m…
mindlessgreen
  • 11,059
  • 16
  • 68
  • 113
0
votes
1 answer

How can I suppress Google's messages when using ggmap with knitr?

How can I suppress Google's messages in an output .pdf when using ggmap with a knitr .Rnw file? MWE code for .Rnw file used to generate a .pdf illustrating the issue: \documentclass{article} \begin{document} <<>>= library(ggmap) qmap("empire state…
Adam Smith
  • 2,584
  • 2
  • 20
  • 34
1 2 3
66
67