ggmap

Plotting google map with ggplot in R

拈花ヽ惹草 提交于 2019-12-02 15:18:18
I am trying to plot Google map that is queried using RgoogleMaps package and combine it with ggplot. Ultimately, I want to show total population using geom_point , somewhat similar to the picture below however I am trying to concentrate on Montgomery region because of over-plotting. I am frustrated because I cannot plot my queried map in R. I tried a couple of packages such as read.jpeg and png but it didn't quite work out. R codes: #query google map al1 <- GetMap(center=c(32.362563,-86.304474), zoom=11, destfile = "al2.jpeg", format="jpg",maptype="roadmap") #load only specific states alabama

Is something wrong with the ggmap and mapview packages in R?

跟風遠走 提交于 2019-12-02 07:08:04
问题 This past summer I was working on a code in R where I used the packages mapview and ggmap . During the summer the code was working fine. This past week I ran the code without any changes and I get the following message when I use mapview : mapview(as(tr10, "Spatial"), zcol = "utc_timestamp", lwd = 5, legend = TRUE) Error in htmlwidgets::sizingPolicy(defaultWidth = defaultWidth, defaultHeight = defaultHeight, : unused argument (browser.external = FALSE) I did not made any changes to my code

Is something wrong with the ggmap and mapview packages in R?

我只是一个虾纸丫 提交于 2019-12-02 06:37:57
This past summer I was working on a code in R where I used the packages mapview and ggmap . During the summer the code was working fine. This past week I ran the code without any changes and I get the following message when I use mapview : mapview(as(tr10, "Spatial"), zcol = "utc_timestamp", lwd = 5, legend = TRUE) Error in htmlwidgets::sizingPolicy(defaultWidth = defaultWidth, defaultHeight = defaultHeight, : unused argument (browser.external = FALSE) I did not made any changes to my code and I upgrade the package just in case but still does not work. And with ggmap I get the following:

Sort legend order in ggmap

橙三吉。 提交于 2019-12-02 03:14:35
问题 How can I sort the legend order in a ggmap? I have the following code: mymap <- ggmap(map) + geom_point(data = mypoints, aes(x =lon, y= lat,colour = month), alpha=0.5, size=5) I would like the months to appear in order (i.e. Jan, Feb, Mar, Apr... etc.) 回答1: Edit As stated by Tyler Rinker, one way is to use the function factor to order factor levels (in this case, months ). I created some data to use with ggplot, but you can adapt to your data and use the logic with ggmap. library(ggplot) x =

400 bad request with ggmap

眉间皱痕 提交于 2019-12-02 00:35:43
问题 I have used this before, and it has worked all the times: library("ggmap") newmap2<-get_openstreetmap(bbox = c(left = -71.2612362452596, bottom = 42.3308503846824, right = -71.0475647202879, top = 42.4560226746649), scale=80000) Now, all I can get is the following error message: In download.file(url, destfile = destfile, quiet = !messaging, mode = "wb") : URL 'http://tile.openstreetmap.org/cgi-bin/export?bbox=-71.2612362452596,42.3308503846824,-71.0475647202879,42.4560226746649&scale=80000

400 bad request with ggmap

ぃ、小莉子 提交于 2019-12-01 22:37:06
I have used this before, and it has worked all the times: library("ggmap") newmap2<-get_openstreetmap(bbox = c(left = -71.2612362452596, bottom = 42.3308503846824, right = -71.0475647202879, top = 42.4560226746649), scale=80000) Now, all I can get is the following error message: In download.file(url, destfile = destfile, quiet = !messaging, mode = "wb") : URL ' http://tile.openstreetmap.org/cgi-bin/export?bbox=-71.2612362452596,42.3308503846824,-71.0475647202879,42.4560226746649&scale=80000&format=png ': status was '400 Bad Request' I have used both the package ggmap v. 2.6.1 (from CRAN) and 2

R Message: Error - replacement has x rows, data has y

假装没事ソ 提交于 2019-12-01 09:38:50
问题 I am trying to use the package ggmap to caculate the distance for a target address with a list of addresse. My data in a csv looks like below: Order ID Address 1652049 435 E 70TH ST,10021 1652123 1365 YORK AVE,10021 1652053 530 E 72ND ST,10021 so I try to get the distance from my input address to all those address for example: 400 Hudson St,10013, and I have following code in R: library(ggmap) mydata<-read.csv("address.csv") mydata$Address<-as.character(mydata$Address) mydata$Distance<-NA a<

is time in mapdist function real-time travel time or static?

假装没事ソ 提交于 2019-12-01 09:30:11
问题 I am interested in driving distance and time using the mapdist function in ggmap . Is this travel time timely updated (real-time traffic information) or constant (travel time is always the same whenever we use "mapdist" for each OD? Thanks! mapdist(from='18.958011, 72.819789', to='18.958558, 72.831462', mode="driving", output="simple") I got the information like time: from to m km miles seconds minutes hours 1 18.958011, 72.819789 18.958558, 72.831462 1304 1.304 0.8103056 241 4.016667 0

In R how to convert Longitude and Latitude to a format that can be used in ggplot2 or ggmap [closed]

白昼怎懂夜的黑 提交于 2019-12-01 06:12:15
I got a raw Longitude/Latitude data whose format cannot be processed by R map. So I wonder if there are some R functions or algorithms to help me to convert those raw data into a readable format. (Maybe UTM) Here is the raw data I had: Latitude: "32-14-23 N" "31-04-27 N" "33-45-28 N" Longitude: "121-22-38 W" "119-30-05 W" "122-47-52 W" I wish to convert the format as(the sample below is mock data): Longitude: -2.748 Latitude: 53.39 Looks like you have data in degree / minute / second format and you want it in decimal format. You can use the char2dms function in the sp package to go from

In R how to convert Longitude and Latitude to a format that can be used in ggplot2 or ggmap [closed]

拜拜、爱过 提交于 2019-12-01 05:44:54
问题 Closed . This question needs details or clarity. It is not currently accepting answers. Want to improve this question? Add details and clarify the problem by editing this post. Closed 4 years ago . I got a raw Longitude/Latitude data whose format cannot be processed by R map. So I wonder if there are some R functions or algorithms to help me to convert those raw data into a readable format. (Maybe UTM) Here is the raw data I had: Latitude: "32-14-23 N" "31-04-27 N" "33-45-28 N" Longitude: