Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error in zero_range(from) : x must be length 1 or 2 #126

Closed
matteomanca opened this issue Nov 17, 2016 · 4 comments
Closed

Error in zero_range(from) : x must be length 1 or 2 #126

matteomanca opened this issue Nov 17, 2016 · 4 comments

Comments

@matteomanca
Copy link

Hi all,

I'm trying the following code:

library(ggmap) barcelona <- get_map(location = 'barcelona', zoom = 13) ggmap(barcelona)

but I get the following error:

"Error in zero_range(from) : x must be length 1 or 2"

Any suggestion? Thanks in advance.

@mvkorpel
Copy link
Contributor

The map plots fine for me. Does the error occur when running the final command, ggmap(barcelona)? Can you report the output of str(barcelona)? For example:

> str(barcelona)
 'ggmap' chr [1:1280, 1:1280] "#DAE7CF" "#DAE7CF" "#DAE7CF" "#E1E1DD" ...
 - attr(*, "bb")='data.frame':  1 obs. of  4 variables:
  ..$ ll.lat: num 41.3
  ..$ ll.lon: num 2.12
  ..$ ur.lat: num 41.4
  ..$ ur.lon: num 2.23
 - attr(*, "source")= chr "google"
 - attr(*, "maptype")= chr "terrain"
 - attr(*, "zoom")= num 13

Also, at least the versions of ggmap and ggplot2 are good to know for the sake of reproducibility:

> packageVersion("ggplot2")
[1] ‘2.2.0’
> packageVersion("ggmap")
[1] ‘2.6.1’

@mvkorpel
Copy link
Contributor

This seems to be a duplicate of issue #113 .

@matteomanca
Copy link
Author

matteomanca commented Nov 17, 2016

I solved by reinstalling "ggplot2" and "ggmap". Probably it was due to the version of ggmap.
Currently I'm using:

 packageVersion("ggplot2")
[1] ‘2.2.0’
> packageVersion("ggmap")
[1] ‘2.6.1’

Sorry to duplicate an existing issue.

Bests,

@mvkorpel
Copy link
Contributor

I'm not bothered by the duplication. I think it's difficult to find duplicates if the original issue report has a somewhat poorly chosen title. Good that it works for you now!

@dkahle dkahle closed this as completed Nov 17, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants