dkahle / ggmap

A package for plotting maps in R with ggplot2
768 stars 231 forks source link

Error in ggmap #309

Open zainabnajeh opened 4 years ago

zainabnajeh commented 4 years ago

Hello Dkahle, I am trying to use ggmap, I tried the solutions you mentioned before but I am still getting this error

la_county<-get_map('los angeles county') Source : https://maps.googleapis.com/maps/api/staticmap?center=los%20angeles%20county&zoom=10&size=640x640&scale=2&maptype=terrain&language=en-EN&key=[AIzaSqDEtMrsaWkpzc9SL5ODOG4e4_odVSEzOTRE4] Error in aperm.default(map, c(2, 1, 3)) : invalid first argument, must be an array In addition: Warning message: In get_googlemap(center = location, zoom = zoom, maptype = maptype, : HTTP 400 Bad Request

I downloaded the ggmap from CRAN because I tried Github and I am keep getting this error

Error: Failed to install 'ggmap' from GitHub: (converted from warning) installation of package ‘C:/Users/zaina/AppData/Local/Temp/Rtmp2fPVHw/file3da85c997774/ggmap_3.0.0.902.tar.gz’ had non-zero exit status

Thanks a lot! Zeinab

dkahle commented 4 years ago

Hi @zainabnajeh!

A few things:

  1. You posted your API key to the forum. I imagine now you've gotten an email from Google's crawler, but you should immediately get on Google's console and rotate (change) your API key or deactivate it so that others cannot use it.
  2. If I remember correctly, this is fixed in the dev version. Can you elaborate on the error you're getting while trying to install from GitHub? Thanks, sorry for the pain!
dkahle commented 4 years ago

Oh, also, the key should not be inside hard braces. It should just be a raw string of gibberish.

zainabnajeh commented 4 years ago

Thanks a lot for your your advice,I deactivated the key. and the code run once I removed the hard brackets.

Thanks again for your help, this the first time I tried to plot a map in R and I was struggling a lot.

Regards, Zeinab


From: david kahle notifications@github.com Sent: Thursday, June 18, 2020 9:57 PM To: dkahle/ggmap ggmap@noreply.github.com Cc: Zeinab Mohamed zeinab.mohamed@huskers.unl.edu; Mention mention@noreply.github.com Subject: Re: [dkahle/ggmap] Error in ggmap (#309)

Hi @zainabnajehhttps://urldefense.proofpoint.com/v2/url?u=https-3A__github.com_zainabnajeh&d=DwMCaQ&c=Cu5g146wZdoqVuKpTNsYHeFX_rg6kWhlkLF8Eft-wwo&r=BkM-yi9dlVQJTtynM3H_RYR073jYsS5u_RNUOkQUrZI&m=6LBmEyO-qMYaXDKZ6Jf0QSxOGtDa6gc31rRq5zzPZh8&s=7yB-TYd4IqnhBGSwj1RGHCB29B3J0vaxhcvtvCQwmr0&e=!

A few things:

  1. You posted your API key to the forum. I imagine now you've gotten an email from Google's crawler, but you should immediately get on Google's console and rotate (change) your API key or deactivate it so that others cannot use it.
  2. If I remember correctly, this is fixed in the dev version. Can you elaborate on the error you're getting while trying to install from GitHub? Thanks, sorry for the pain!

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHubhttps://urldefense.proofpoint.com/v2/url?u=https-3A__github.com_dkahle_ggmap_issues_309-23issuecomment-2D646407010&d=DwMCaQ&c=Cu5g146wZdoqVuKpTNsYHeFX_rg6kWhlkLF8Eft-wwo&r=BkM-yi9dlVQJTtynM3H_RYR073jYsS5u_RNUOkQUrZI&m=6LBmEyO-qMYaXDKZ6Jf0QSxOGtDa6gc31rRq5zzPZh8&s=wkKzkm_V65EiQM_la2UoTcdbG-YjJp4GJmBXQiJ0QWs&e=, or unsubscribehttps://urldefense.proofpoint.com/v2/url?u=https-3A__github.com_notifications_unsubscribe-2Dauth_AOJJJXAMUG56F3CAUHIV34DRXLHYFANCNFSM4OCCUAXA&d=DwMCaQ&c=Cu5g146wZdoqVuKpTNsYHeFX_rg6kWhlkLF8Eft-wwo&r=BkM-yi9dlVQJTtynM3H_RYR073jYsS5u_RNUOkQUrZI&m=6LBmEyO-qMYaXDKZ6Jf0QSxOGtDa6gc31rRq5zzPZh8&s=atSG3eY7HO59Yw854jTYE5wyYN6ysoscsH1YjI9lEuI&e=.