tidygeocoder icon indicating copy to clipboard operation
tidygeocoder copied to clipboard

reverse_geo not working

Open zachasman opened this issue 2 years ago • 7 comments

Hello,

I am trying to reverse geocode. But when I copy the code verbatim from your own documentation I'm met with an error:

options(tidygeocoder.progress_bar = FALSE)
reverse_geo(lat = 38.895865, long = -77.0307713, method = 'osm')
reverse_geo(
  lat = c(38.895865, 43.6534817, 300),
  long = c(-77.0307713, -79.3839347, 600),
  method = 'osm', full_results = TRUE
)

Yields the following error:

Error in `vec_as_location()`:
! `...` must be empty.
✖ Problematic argument:
• call = call
Run `rlang::last_error()` to see where the error occurred.

What's happening?

zachasman avatar Aug 02 '22 19:08 zachasman

Hi @zachasman can you post the results of rlang::last_error() so we can see where the error happened (mentioned in the traceback)? Also please post the results of devtools::session_info() so we can see what package versions are involved.

jessecambon avatar Aug 02 '22 19:08 jessecambon

@jessecambon Sure thing.

rlang::last_error() produces:

Backtrace:
 1. tidygeocoder::reverse_geo(...)
 2. tidygeocoder:::package_inputs(...)
 5. tibble:::`[.tbl_df`(input_unique, !names(input_unique) %in% c(".uid"))
 6. tibble:::vectbl_as_col_location(...)
 9. vctrs::vec_as_location(j, n, names, call = call)

While devtools::session_info() produces:

Session info ──────────────────────────────────────────────────────────────────────────────────────────────────
 setting  value
 version  R version 4.1.0 (2021-05-18)
 os       macOS Big Sur 11.4
 system   x86_64, darwin17.0
 ui       RStudio
 language (EN)
 collate  en_US.UTF-8
 ctype    en_US.UTF-8
 tz       America/New_York
 date     2022-08-02
 rstudio  1.4.1717 Juliet Rose (desktop)
 pandoc   NA

─ Packages ──────────────────────────────────────────────────────────────────────────────────────────────────────
 ! package       * version  date (UTC) lib source
   assertthat      0.2.1    2019-03-21 [1] CRAN (R 4.1.0)
   backports       1.2.1    2020-12-09 [1] CRAN (R 4.1.0)
   bit             4.0.4    2020-08-04 [1] CRAN (R 4.1.0)
   bit64           4.0.5    2020-08-30 [1] CRAN (R 4.1.0)
   bitops          1.0-7    2021-04-24 [1] CRAN (R 4.1.0)
   blob            1.2.1    2020-01-20 [1] CRAN (R 4.1.0)
   broom           1.0.0    2022-07-01 [1] CRAN (R 4.1.2)
   cachem          1.0.5    2021-05-15 [1] CRAN (R 4.1.0)
   callr           3.7.0    2021-04-20 [1] CRAN (R 4.1.0)
   cellranger      1.1.0    2016-07-27 [1] CRAN (R 4.1.0)
   chron           2.3-56   2020-08-18 [1] CRAN (R 4.1.0)
   civis         * 3.0.0    2020-06-22 [1] CRAN (R 4.1.0)
   class           7.3-19   2021-05-03 [1] CRAN (R 4.1.0)
   classInt        0.4-3    2020-04-07 [1] CRAN (R 4.1.0)
   cli             3.3.0    2022-04-25 [1] CRAN (R 4.1.2)
   codetools       0.2-18   2020-11-04 [1] CRAN (R 4.1.0)
   colorspace      2.0-2    2021-06-24 [1] CRAN (R 4.1.0)
   crayon          1.5.1    2022-03-26 [1] CRAN (R 4.1.2)
   curl            4.3.2    2021-06-23 [1] CRAN (R 4.1.0)
   DBI             1.1.1    2021-01-15 [1] CRAN (R 4.1.0)
   dbplyr        * 2.1.1    2021-04-06 [1] CRAN (R 4.1.0)
   desc            1.4.0    2021-09-28 [1] CRAN (R 4.1.0)
   devtools        2.4.3    2021-11-30 [1] CRAN (R 4.1.0)
   digest          0.6.28   2021-09-23 [1] CRAN (R 4.1.0)
   dplyr         * 1.0.7    2021-06-18 [1] CRAN (R 4.1.0)
   e1071           1.7-8    2021-07-28 [1] CRAN (R 4.1.0)
   ellipsis        0.3.2    2021-04-29 [1] CRAN (R 4.1.0)
   fansi           0.5.0    2021-05-25 [1] CRAN (R 4.1.0)
   fastmap         1.1.0    2021-01-25 [1] CRAN (R 4.1.0)
   forcats       * 0.5.1    2021-01-27 [1] CRAN (R 4.1.0)
   foreign         0.8-81   2020-12-22 [1] CRAN (R 4.1.0)
   fs              1.5.0    2020-07-31 [1] CRAN (R 4.1.0)
   future          1.21.0   2020-12-10 [1] CRAN (R 4.1.0)
   gargle          1.2.0    2021-07-02 [1] CRAN (R 4.1.0)
   generics        0.1.1    2021-10-25 [1] CRAN (R 4.1.0)
   ggmap         * 3.0.0    2019-02-05 [1] CRAN (R 4.1.0)
   ggplot2       * 3.3.5    2021-06-25 [1] CRAN (R 4.1.0)
   globals         0.14.0   2020-11-22 [1] CRAN (R 4.1.0)
   glue            1.6.2    2022-02-24 [1] CRAN (R 4.1.2)
   googledrive     2.0.0    2021-07-08 [1] CRAN (R 4.1.0)
   googlesheets4   1.0.0    2021-07-21 [1] CRAN (R 4.1.0)
   gsubfn        * 0.7      2018-03-16 [1] CRAN (R 4.1.0)
   gtable          0.3.0    2019-03-25 [1] CRAN (R 4.1.0)
   haven           2.5.0    2022-04-15 [1] CRAN (R 4.1.2)
   hms             1.1.1    2021-09-26 [1] CRAN (R 4.1.0)
   httr          * 1.4.2    2020-07-20 [1] CRAN (R 4.1.0)
   jpeg            0.1-9    2021-07-24 [1] CRAN (R 4.1.0)
   jsonlite      * 1.7.2    2020-12-09 [1] CRAN (R 4.1.0)
   KernSmooth      2.23-20  2021-05-03 [1] CRAN (R 4.1.0)
   lattice         0.20-44  2021-05-02 [1] CRAN (R 4.1.0)
   lifecycle       1.0.1    2021-09-24 [1] CRAN (R 4.1.0)
   listenv         0.8.0    2019-12-05 [1] CRAN (R 4.1.0)
   lubridate       1.8.0    2021-10-07 [1] CRAN (R 4.1.0)
   magrittr      * 2.0.1    2020-11-17 [1] CRAN (R 4.1.0)
   maps          * 3.4.0    2021-09-25 [1] CRAN (R 4.1.0)
   maptools        1.1-1    2021-03-15 [1] CRAN (R 4.1.0)
   memoise         2.0.0    2021-01-26 [1] CRAN (R 4.1.0)
   mime            0.11     2021-06-23 [1] CRAN (R 4.1.0)
   modelr          0.1.8    2020-05-19 [1] CRAN (R 4.1.0)
   munsell         0.5.0    2018-06-12 [1] CRAN (R 4.1.0)
   parallelly      1.27.0   2021-07-19 [1] CRAN (R 4.1.0)
   parsedate     * 1.2.1    2021-04-20 [1] CRAN (R 4.1.0)
   pillar          1.8.0    2022-07-18 [1] CRAN (R 4.1.2)
   pkgbuild        1.3.1    2021-12-20 [1] CRAN (R 4.1.0)
   pkgconfig       2.0.3    2019-09-22 [1] CRAN (R 4.1.0)
   pkgload         1.2.3    2021-10-13 [1] CRAN (R 4.1.0)
   plyr            1.8.6    2020-03-03 [1] CRAN (R 4.1.0)
   png             0.1-7    2013-12-03 [1] CRAN (R 4.1.0)
   prettyunits     1.1.1    2020-01-24 [1] CRAN (R 4.1.0)
   processx        3.5.2    2021-04-30 [1] CRAN (R 4.1.0)
   proto         * 1.0.0    2016-10-29 [1] CRAN (R 4.1.0)
   proxy           0.4-26   2021-06-07 [1] CRAN (R 4.1.0)
   ps              1.6.0    2021-02-28 [1] CRAN (R 4.1.0)
   purrr         * 0.3.4    2020-04-17 [1] CRAN (R 4.1.0)
   R6              2.5.1    2021-08-19 [1] CRAN (R 4.1.0)
   rappdirs        0.3.3    2021-01-31 [1] CRAN (R 4.1.0)
   Rcpp            1.0.7    2021-07-07 [1] CRAN (R 4.1.0)
   RCurl           1.98-1.5 2021-09-17 [1] CRAN (R 4.1.0)
   readr         * 2.1.2    2022-01-30 [1] CRAN (R 4.1.2)
   readxl          1.3.1    2019-03-13 [1] CRAN (R 4.1.0)
   remotes         2.4.1    2021-09-29 [1] CRAN (R 4.1.0)
   reprex          2.0.1    2021-08-05 [1] CRAN (R 4.1.0)
   revgeo        * 0.15     2017-11-17 [1] CRAN (R 4.1.0)
   rgdal           1.5-23   2021-02-03 [1] CRAN (R 4.1.0)
   rgeos         * 0.5-9    2021-12-15 [1] CRAN (R 4.1.0)
   RgoogleMaps     1.4.5.3  2020-02-12 [1] CRAN (R 4.1.0)
   rjson           0.2.20   2018-06-08 [1] CRAN (R 4.1.0)
   RJSONIO         1.3-1.6  2021-09-16 [1] CRAN (R 4.1.0)
   rlang           1.0.4    2022-07-12 [1] CRAN (R 4.1.0)
   rprojroot       2.0.2    2020-11-15 [1] CRAN (R 4.1.0)
   RSQLite       * 2.2.7    2021-04-22 [1] CRAN (R 4.1.0)
   rstudioapi      0.13     2020-11-12 [1] CRAN (R 4.1.0)
   rvest           1.0.2    2021-10-16 [1] CRAN (R 4.1.0)
   scales          1.1.1    2020-05-11 [1] CRAN (R 4.1.0)
   sessioninfo     1.2.2    2021-12-06 [1] CRAN (R 4.1.0)
   sf            * 1.0-5    2021-12-17 [1] CRAN (R 4.1.0)
   sp            * 1.4-5    2021-01-10 [1] CRAN (R 4.1.0)
   sqldf         * 0.4-11   2017-06-28 [1] CRAN (R 4.1.0)
   stringi         1.7.5    2021-10-04 [1] CRAN (R 4.1.0)
   stringr       * 1.4.0    2019-02-10 [1] CRAN (R 4.1.0)
   testthat        3.1.0    2021-10-04 [1] CRAN (R 4.1.0)
   tibble        * 3.1.8    2022-07-22 [1] CRAN (R 4.1.2)
 V tidygeocoder  * 1.0.5    2022-08-02 [1] Github (jessecambon/tidygeocoder@1aebc36) (on disk 1.0.5.9000)
   tidyr         * 1.1.4    2021-09-27 [1] CRAN (R 4.1.0)
   tidyselect      1.1.1    2021-04-30 [1] CRAN (R 4.1.0)
   tidyverse     * 1.3.2    2022-07-18 [1] CRAN (R 4.1.2)
   tigris        * 1.5      2021-09-23 [1] CRAN (R 4.1.0)
   tzdb            0.1.2    2021-07-20 [1] CRAN (R 4.1.0)
   units           0.7-2    2021-06-08 [1] CRAN (R 4.1.0)
   usethis         2.1.6    2022-05-25 [1] CRAN (R 4.1.2)
   utf8            1.2.2    2021-07-24 [1] CRAN (R 4.1.0)
   uuid            0.1-4    2020-02-26 [1] CRAN (R 4.1.0)
   vctrs           0.3.8    2021-04-29 [1] CRAN (R 4.1.0)
   withr           2.4.2    2021-04-18 [1] CRAN (R 4.1.0)
   xml2            1.3.3    2021-11-30 [1] CRAN (R 4.1.0)

zachasman avatar Aug 02 '22 19:08 zachasman

@jessecambon Do you need any more information?

zachasman avatar Aug 02 '22 22:08 zachasman

No I think that's enough info. I haven't gotten a chance to reproduce it yet, but I'm guessing it's tied to the version of vctrs. What happens if you update that package to the newest version?

jessecambon avatar Aug 02 '22 22:08 jessecambon

@jessecambon I just tried to update using the install.packages function but still am getting the same results. Let me know how to proceed, as this issue is rather urgent.

install.packages("tidygeocoder")

options(tidygeocoder.progress_bar = FALSE)
reverse_geo(lat = 38.895865, long = -77.0307713, method = 'osm')
reverse_geo(
  lat = c(38.895865, 43.6534817, 300),
  long = c(-77.0307713, -79.3839347, 600),
  method = 'osm', full_results = TRUE
)

zachasman avatar Aug 03 '22 14:08 zachasman

@jessecambon Nevermind I updated all the packages and now it seems to be working.

zachasman avatar Aug 03 '22 15:08 zachasman

@zachasman glad to hear it. Would you mind posting your (working) devtools::session_info() ?

When I get some time I want to see what is going on. Maybe there is a certain combination of package versions that creates a problem.

jessecambon avatar Aug 03 '22 15:08 jessecambon