TransWikia.com

Problem with get_googlemap function

Geographic Information Systems Asked by Saber Aradpour on July 25, 2021

I tried using the get_googlemap function but I have an error that I cannot fix.
I was wondering if anyone could help me in this regard.

ggmap::register_google(key = "xxxxxxxxxxxxx (my API Key)")
d <- function(x=-95.36, y=29.76, n,r,a){
  round(data.frame(
    lon = jitter(rep(x,n), amount = a),
    lat = jitter(rep(y,n), amount = a)
  ), digits = r)
}
df <- d(n=50,r=3,a=.3)
map <- get_googlemap(markers = df, path = df, scale = 2)
ggmap(map)

It is an example provided at https://www.rdocumentation.org/packages/ggmap/versions/3.0.0/topics/get_googlemap
but I encounter this error every time I run this code

Error in aperm.default(map, c(2, 1, 3)) :
invalid first argument, must be an array
In addition: Warning message:
In get_googlemap(markers = df, path = df, scale = 2) : HTTP 400 Bad Reques

even using this code results in the same way.

map <- get_googlemap(c(-97.14667, 31.5493))

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP