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 with lookup_coords #261

Closed
vicgithub1 opened this issue Jun 21, 2018 · 22 comments
Closed

error with lookup_coords #261

vicgithub1 opened this issue Jun 21, 2018 · 22 comments

Comments

@vicgithub1
Copy link

Hi please help I am having errors trying to search by geo location in rtweet

here is my code

search_tweets("economy", n=100, geocode = lookup_coords("uk"))

the error is
Error in if (interactive) { : argument is not interpretable as logical
however it works if the search location is USA. please help!!!

@sefabey
Copy link

sefabey commented Aug 1, 2018

Seconded.

rtweet::lookup_coords("UK")
#> Error in if (interactive) {: argument is not interpretable as logical
rtweet::lookup_coords("london")
#> Error in if (interactive) {: argument is not interpretable as logical
rtweet::lookup_coords("michigan")
#> Error in if (interactive) {: argument is not interpretable as logical
rtweet::lookup_coords("California")
#> Error in if (interactive) {: argument is not interpretable as logical
rtweet::lookup_coords("California, US")
#> Error in if (interactive) {: argument is not interpretable as logical
#but interestingly
rtweet::lookup_coords("USA")
#> $place
#> [1] "USA"
#> 
#> $box
#>     sw.lng     sw.lat     ne.lng     ne.lat 
#> -124.84897   24.39631  -66.88544   49.38436 
#> 
#> $point
#>     lat     lng 
#>  36.890 -95.867 
#> 
#> attr(,"class")
#> [1] "coords" "list"
```

Created on 2018-08-01 by the [reprex package](http://reprex.tidyverse.org) (v0.2.0.9000).
<details><summary>Session info</summary>

``` r
devtools::session_info()
#> Session info -------------------------------------------------------------
#>  setting  value                       
#>  version  R version 3.4.4 (2018-03-15)
#>  system   x86_64, darwin15.6.0        
#>  ui       X11                         
#>  language (EN)                        
#>  collate  en_GB.UTF-8                 
#>  tz       Europe/London               
#>  date     2018-08-01
#> Packages -----------------------------------------------------------------
#>  package   * version date       source         
#>  backports   1.1.2   2017-12-13 CRAN (R 3.4.3) 
#>  base      * 3.4.4   2018-03-15 local          
#>  compiler    3.4.4   2018-03-15 local          
#>  datasets  * 3.4.4   2018-03-15 local          
#>  devtools    1.13.5  2018-02-18 CRAN (R 3.4.3) 
#>  digest      0.6.15  2018-01-28 CRAN (R 3.4.3) 
#>  evaluate    0.11    2018-07-17 cran (@0.11)   
#>  graphics  * 3.4.4   2018-03-15 local          
#>  grDevices * 3.4.4   2018-03-15 local          
#>  htmltools   0.3.6   2017-04-28 cran (@0.3.6)  
#>  httr        1.3.1   2017-08-20 CRAN (R 3.4.1) 
#>  jsonlite    1.5     2017-06-01 CRAN (R 3.4.0) 
#>  knitr       1.20    2018-02-20 CRAN (R 3.4.3) 
#>  magrittr    1.5     2014-11-22 CRAN (R 3.4.0) 
#>  memoise     1.1.0   2017-04-21 CRAN (R 3.4.0) 
#>  methods   * 3.4.4   2018-03-15 local          
#>  R6          2.2.2   2017-06-17 CRAN (R 3.4.0) 
#>  Rcpp        0.12.17 2018-05-18 cran (@0.12.17)
#>  rmarkdown   1.10    2018-06-11 cran (@1.10)   
#>  rprojroot   1.3-2   2018-01-03 CRAN (R 3.4.2) 
#>  rtweet      0.6.7   2018-06-20 CRAN (R 3.4.4) 
#>  stats     * 3.4.4   2018-03-15 local          
#>  stringi     1.2.4   2018-07-20 cran (@1.2.4)  
#>  stringr     1.3.1   2018-05-10 cran (@1.3.1)  
#>  tools       3.4.4   2018-03-15 local          
#>  utils     * 3.4.4   2018-03-15 local          
#>  withr       2.1.2   2018-03-15 CRAN (R 3.4.4) 
#>  yaml        2.1.19  2018-05-01 cran (@2.1.19)
```

</details>

@mkearney
Copy link
Collaborator

mkearney commented Aug 1, 2018

@sefabey the fix isn't to CRAN yet (tho it will be soon). Try the dev version on Github:

devtools::install_github("mkearney/rtweet")
library(rtweet)
lookup_coords("England, UK")

If you're in an interactive session, it should then ask you for your google maps API key (and it will display some instructions on how to get one).

And, for the record, the US and World coordinates are hardwired in (i was hitting those hard for a while, and it seemed like a waste to hit up the Google maps API each time). So those locations should return coordinates regardless of whether you have a google maps API key saved as an environment variable.

@sefabey
Copy link

sefabey commented Aug 1, 2018

Okay, tried that. After installing GH version and typing in the GMaps API key, I still get this.

library(rtweet)

rtweet::lookup_coords("UK")
#> $place
#> [1] "UK"
#> 
#> $box
#> NULL
#> 
#> $point
#> NULL
#> 
#> attr(,"class")
#> [1] "coords" "list"
rtweet::lookup_coords("london")
#> $place
#> [1] "london"
#> 
#> $box
#> NULL
#> 
#> $point
#> NULL
#> 
#> attr(,"class")
#> [1] "coords" "list"
rtweet::lookup_coords("michigan")
#> $place
#> [1] "michigan"
#> 
#> $box
#> NULL
#> 
#> $point
#> NULL
#> 
#> attr(,"class")
#> [1] "coords" "list"
rtweet::lookup_coords("California")
#> $place
#> [1] "California"
#> 
#> $box
#> NULL
#> 
#> $point
#> NULL
#> 
#> attr(,"class")
#> [1] "coords" "list"
rtweet::lookup_coords("California, US")
#> $place
#> [1] "California, US"
#> 
#> $box
#> NULL
#> 
#> $point
#> NULL
#> 
#> attr(,"class")
#> [1] "coords" "list"

#but as you mentioned
rtweet::lookup_coords("USA")
#> $place
#> [1] "USA"
#> 
#> $box
#>     sw.lng     sw.lat     ne.lng     ne.lat 
#> -124.84897   24.39631  -66.88544   49.38436 
#> 
#> $point
#>     lat     lng 
#>  36.890 -95.867 
#> 
#> attr(,"class")
#> [1] "coords" "list"

#also
lookup_coords("England, UK")
#> $place
#> [1] "England, UK"
#> 
#> $box
#> NULL
#> 
#> $point
#> NULL
#> 
#> attr(,"class")
#> [1] "coords" "list"

#lastly
search_tweets("london", n=50, geocode = lookup_coords("London"))
#> Searching for tweets...
#> Finished collecting tweets!
#> data frame with 0 columns and 0 rows
search_tweets("london", n=50, geocode = lookup_coords("London, UK"))
#> Searching for tweets...
#> Finished collecting tweets!
#> data frame with 0 columns and 0 rows

Created on 2018-08-01 by the reprex package (v0.2.0.9000).

Session info
devtools::session_info()
#> Session info -------------------------------------------------------------
#>  setting  value                       
#>  version  R version 3.4.4 (2018-03-15)
#>  system   x86_64, darwin15.6.0        
#>  ui       X11                         
#>  language (EN)                        
#>  collate  en_GB.UTF-8                 
#>  tz       Europe/London               
#>  date     2018-08-01
#> Packages -----------------------------------------------------------------
#>  package   * version    date       source                          
#>  backports   1.1.2      2017-12-13 CRAN (R 3.4.3)                  
#>  base      * 3.4.4      2018-03-15 local                           
#>  compiler    3.4.4      2018-03-15 local                           
#>  curl        3.2        2018-03-28 CRAN (R 3.4.4)                  
#>  datasets  * 3.4.4      2018-03-15 local                           
#>  devtools    1.13.5     2018-02-18 CRAN (R 3.4.3)                  
#>  digest      0.6.15     2018-01-28 CRAN (R 3.4.3)                  
#>  evaluate    0.11       2018-07-17 cran (@0.11)                    
#>  graphics  * 3.4.4      2018-03-15 local                           
#>  grDevices * 3.4.4      2018-03-15 local                           
#>  htmltools   0.3.6      2017-04-28 cran (@0.3.6)                   
#>  httr        1.3.1      2017-08-20 CRAN (R 3.4.1)                  
#>  jsonlite    1.5        2017-06-01 CRAN (R 3.4.0)                  
#>  knitr       1.20       2018-02-20 CRAN (R 3.4.3)                  
#>  magrittr    1.5        2014-11-22 CRAN (R 3.4.0)                  
#>  memoise     1.1.0      2017-04-21 CRAN (R 3.4.0)                  
#>  methods   * 3.4.4      2018-03-15 local                           
#>  openssl     1.0.1      2018-03-03 CRAN (R 3.4.3)                  
#>  R6          2.2.2      2017-06-17 CRAN (R 3.4.0)                  
#>  Rcpp        0.12.17    2018-05-18 cran (@0.12.17)                 
#>  rmarkdown   1.10       2018-06-11 cran (@1.10)                    
#>  rprojroot   1.3-2      2018-01-03 CRAN (R 3.4.2)                  
#>  rtweet    * 0.6.7.9000 2018-08-01 Github (mkearney/rtweet@9030b46)
#>  stats     * 3.4.4      2018-03-15 local                           
#>  stringi     1.2.4      2018-07-20 cran (@1.2.4)                   
#>  stringr     1.3.1      2018-05-10 cran (@1.3.1)                   
#>  tools       3.4.4      2018-03-15 local                           
#>  utils     * 3.4.4      2018-03-15 local                           
#>  withr       2.1.2      2018-03-15 CRAN (R 3.4.4)                  
#>  yaml        2.1.19     2018-05-01 cran (@2.1.19)

@sefabey
Copy link

sefabey commented Aug 1, 2018

Not directly related to rtweet but may be of interest. I've been using Google API for geocoding using ggmap::geocode and ggmap::mutate_geocode. Although these functions seem to work fine, they are very inconsistent: while querying Google geocoding API, some inputs get ignored arbitrarily, which resulted in ugly replications in this horrible data wrangling code.

Not sure if this is an issue with the ggmap package or a server-side issue, though. If the latter, we might be observing a similar error.

That said, I am not sure if rtweet sends queries to Google geocoding API or not.

@mkearney
Copy link
Collaborator

mkearney commented Aug 1, 2018

It does, but that inconsistency should be fixed by forcing users to supply their own API key.

RE: your code still not working:

Have you tried restarting your session? And what did you label your google maps API key environment variable? Make sure it includes GOOGLE and MAP. And if you fetch the environment variable does it print your key?

Sys.getenv("GOOGLE_MAPS_KEY")

@sefabey
Copy link

sefabey commented Aug 1, 2018

Edit: Not to self: Gotta be more careful before publishing API keys online.

Yes, restarted the session, even Rstudio. I have been working on a new setup so had no Google Maps API key provided previously. When I installed the latest GH version of rtweet, it prompted me to provide one interactively (which is great BTW). It seems rtweet handled saving the key as envir var part correctly as Sys.getenv("GOOGLE_MAPS_KEY") returns the correct key (double checked on Google).

Ultimately, what I still get is:

library(rtweet)

rtweet::lookup_coords("UK")
#> $place
#> [1] "UK"
#> 
#> $box
#> NULL
#> 
#> $point
#> NULL
#> 
#> attr(,"class")
#> [1] "coords" "list"
rtweet::lookup_coords("London")
#> $place
#> [1] "London"
#> 
#> $box
#> NULL
#> 
#> $point
#> NULL
#> 
#> attr(,"class")
#> [1] "coords" "list"
rtweet::lookup_coords("michigan")
#> $place
#> [1] "michigan"
#> 
#> $box
#> NULL
#> 
#> $point
#> NULL
#> 
#> attr(,"class")
#> [1] "coords" "list"
rtweet::lookup_coords("California")
#> $place
#> [1] "California"
#> 
#> $box
#> NULL
#> 
#> $point
#> NULL
#> 
#> attr(,"class")
#> [1] "coords" "list"

lookup_coords("England, UK")
#> $place
#> [1] "England, UK"
#> 
#> $box
#> NULL
#> 
#> $point
#> NULL
#> 
#> attr(,"class")
#> [1] "coords" "list"

search_tweets("london", n=50, geocode = lookup_coords("London"))
#> Searching for tweets...
#> Finished collecting tweets!
#> data frame with 0 columns and 0 rows
search_tweets("london", n=50, geocode = lookup_coords("London, UK"))
#> Searching for tweets...
#> Finished collecting tweets!
#> data frame with 0 columns and 0 rows


ggmap::geocode("houston texas")
#> Information from URL : http://maps.googleapis.com/maps/api/geocode/json?address=houston%20texas&sensor=false
#>        lon      lat
#> 1 -95.3698 29.76043
ggmap::geocode("London")
#> Information from URL : http://maps.googleapis.com/maps/api/geocode/json?address=London&sensor=false
#>          lon      lat
#> 1 -0.1277583 51.50735

Sys.getenv("GOOGLE_MAPS_KEY")
#> [1] "AIzaSyCap9hNxpTXXXXXXXXXXXXXXXXXXX"

Created on 2018-08-01 by the reprex package (v0.2.0.9000).

Session info
devtools::session_info()
#> Session info -------------------------------------------------------------
#>  setting  value                       
#>  version  R version 3.4.4 (2018-03-15)
#>  system   x86_64, darwin15.6.0        
#>  ui       X11                         
#>  language (EN)                        
#>  collate  en_GB.UTF-8                 
#>  tz       Europe/London               
#>  date     2018-08-01
#> Packages -----------------------------------------------------------------
#>  package     * version    date       source                          
#>  assertthat    0.2.0      2017-04-11 CRAN (R 3.4.0)                  
#>  backports     1.1.2      2017-12-13 CRAN (R 3.4.3)                  
#>  base        * 3.4.4      2018-03-15 local                           
#>  bindr         0.1.1      2018-03-13 CRAN (R 3.4.4)                  
#>  bindrcpp      0.2.2      2018-03-29 CRAN (R 3.4.4)                  
#>  colorspace    1.3-2      2016-12-14 CRAN (R 3.4.0)                  
#>  compiler      3.4.4      2018-03-15 local                           
#>  curl          3.2        2018-03-28 CRAN (R 3.4.4)                  
#>  datasets    * 3.4.4      2018-03-15 local                           
#>  devtools      1.13.5     2018-02-18 CRAN (R 3.4.3)                  
#>  digest        0.6.15     2018-01-28 CRAN (R 3.4.3)                  
#>  dplyr         0.7.4      2017-09-28 CRAN (R 3.4.2)                  
#>  evaluate      0.11       2018-07-17 cran (@0.11)                    
#>  geosphere     1.5-7      2017-11-05 CRAN (R 3.4.2)                  
#>  ggmap         2.6.1      2016-01-23 CRAN (R 3.4.0)                  
#>  ggplot2       3.0.0      2018-07-03 CRAN (R 3.4.4)                  
#>  glue          1.3.0      2018-07-17 cran (@1.3.0)                   
#>  graphics    * 3.4.4      2018-03-15 local                           
#>  grDevices   * 3.4.4      2018-03-15 local                           
#>  grid          3.4.4      2018-03-15 local                           
#>  gtable        0.2.0      2016-02-26 CRAN (R 3.4.0)                  
#>  htmltools     0.3.6      2017-04-28 cran (@0.3.6)                   
#>  httr          1.3.1      2017-08-20 CRAN (R 3.4.1)                  
#>  jpeg          0.1-8      2014-01-23 CRAN (R 3.4.0)                  
#>  jsonlite      1.5        2017-06-01 CRAN (R 3.4.0)                  
#>  knitr         1.20       2018-02-20 CRAN (R 3.4.3)                  
#>  lattice       0.20-35    2017-03-25 CRAN (R 3.4.4)                  
#>  lazyeval      0.2.1      2017-10-29 CRAN (R 3.4.2)                  
#>  magrittr      1.5        2014-11-22 CRAN (R 3.4.0)                  
#>  mapproj       1.2.6      2018-03-29 CRAN (R 3.4.4)                  
#>  maps          3.3.0      2018-04-03 CRAN (R 3.4.4)                  
#>  memoise       1.1.0      2017-04-21 CRAN (R 3.4.0)                  
#>  methods     * 3.4.4      2018-03-15 local                           
#>  munsell       0.4.3      2016-02-13 CRAN (R 3.4.0)                  
#>  openssl       1.0.1      2018-03-03 CRAN (R 3.4.3)                  
#>  pillar        1.2.1      2018-02-27 CRAN (R 3.4.3)                  
#>  pkgconfig     2.0.1      2017-03-21 CRAN (R 3.4.0)                  
#>  plyr          1.8.4      2016-06-08 CRAN (R 3.4.0)                  
#>  png           0.1-7      2013-12-03 CRAN (R 3.4.0)                  
#>  proto         1.0.0      2016-10-29 CRAN (R 3.4.0)                  
#>  R6            2.2.2      2017-06-17 CRAN (R 3.4.0)                  
#>  Rcpp          0.12.17    2018-05-18 cran (@0.12.17)                 
#>  reshape2      1.4.3      2017-12-11 CRAN (R 3.4.3)                  
#>  RgoogleMaps   1.4.2      2018-06-08 CRAN (R 3.4.4)                  
#>  rjson         0.2.20     2018-06-08 CRAN (R 3.4.4)                  
#>  rlang         0.2.1      2018-05-30 cran (@0.2.1)                   
#>  rmarkdown     1.10       2018-06-11 cran (@1.10)                    
#>  rprojroot     1.3-2      2018-01-03 CRAN (R 3.4.2)                  
#>  rtweet      * 0.6.7.9000 2018-08-01 Github (mkearney/rtweet@9030b46)
#>  scales        0.5.0      2017-08-24 CRAN (R 3.4.1)                  
#>  sp            1.2-7      2018-01-19 CRAN (R 3.4.3)                  
#>  stats       * 3.4.4      2018-03-15 local                           
#>  stringi       1.2.4      2018-07-20 cran (@1.2.4)                   
#>  stringr       1.3.1      2018-05-10 cran (@1.3.1)                   
#>  tibble        1.4.2      2018-01-22 CRAN (R 3.4.3)                  
#>  tools         3.4.4      2018-03-15 local                           
#>  utils       * 3.4.4      2018-03-15 local                           
#>  withr         2.1.2      2018-03-15 CRAN (R 3.4.4)                  
#>  yaml          2.1.19     2018-05-01 cran (@2.1.19)

@mkearney
Copy link
Collaborator

mkearney commented Aug 1, 2018

Well that's a tough one. Can you try this and see if the output matches your key:

rtweet:::find_google_geocode_key()

@mkearney
Copy link
Collaborator

mkearney commented Aug 1, 2018

Otherwise I'm at a loss. The rtweet internal uses https instead of http but I don't think that should matter...

@sefabey
Copy link

sefabey commented Aug 1, 2018

Aye, matches. See the reprex below.

Are rtweet geocoding functions or above calls working on your end? If yes, I'll try to replicate this on a docker container tomorrow to eliminate a possible local setup issue.

I can't imagine https being the problem. Could this be an issue on the server side? I find google maps APIS quite confusing. For instance, even though the recent change in google maps API re billing (no more free accounts, forcing users to set up billing accounts), ggmap somehow works and has a rate limit of 2500 requests per day WITHOUT an API key.

identical(Sys.getenv("GOOGLE_MAPS_KEY"),rtweet:::find_google_geocode_key())
#> [1] TRUE
identical("AIzaSyCap9hNxpXXXXXXXXXXXXXXXXX",rtweet:::find_google_geocode_key())
#> [1] TRUE

Created on 2018-08-01 by the reprex package (v0.2.0.9000).

Session info
devtools::session_info()
#> Session info -------------------------------------------------------------
#>  setting  value                       
#>  version  R version 3.4.4 (2018-03-15)
#>  system   x86_64, darwin15.6.0        
#>  ui       X11                         
#>  language (EN)                        
#>  collate  en_GB.UTF-8                 
#>  tz       Europe/London               
#>  date     2018-08-01
#> Packages -----------------------------------------------------------------
#>  package   * version    date       source                          
#>  backports   1.1.2      2017-12-13 CRAN (R 3.4.3)                  
#>  base      * 3.4.4      2018-03-15 local                           
#>  compiler    3.4.4      2018-03-15 local                           
#>  datasets  * 3.4.4      2018-03-15 local                           
#>  devtools    1.13.5     2018-02-18 CRAN (R 3.4.3)                  
#>  digest      0.6.15     2018-01-28 CRAN (R 3.4.3)                  
#>  evaluate    0.11       2018-07-17 cran (@0.11)                    
#>  graphics  * 3.4.4      2018-03-15 local                           
#>  grDevices * 3.4.4      2018-03-15 local                           
#>  htmltools   0.3.6      2017-04-28 cran (@0.3.6)                   
#>  httr        1.3.1      2017-08-20 CRAN (R 3.4.1)                  
#>  jsonlite    1.5        2017-06-01 CRAN (R 3.4.0)                  
#>  knitr       1.20       2018-02-20 CRAN (R 3.4.3)                  
#>  magrittr    1.5        2014-11-22 CRAN (R 3.4.0)                  
#>  memoise     1.1.0      2017-04-21 CRAN (R 3.4.0)                  
#>  methods   * 3.4.4      2018-03-15 local                           
#>  R6          2.2.2      2017-06-17 CRAN (R 3.4.0)                  
#>  Rcpp        0.12.17    2018-05-18 cran (@0.12.17)                 
#>  rmarkdown   1.10       2018-06-11 cran (@1.10)                    
#>  rprojroot   1.3-2      2018-01-03 CRAN (R 3.4.2)                  
#>  rtweet      0.6.7.9000 2018-08-01 Github (mkearney/rtweet@9030b46)
#>  stats     * 3.4.4      2018-03-15 local                           
#>  stringi     1.2.4      2018-07-20 cran (@1.2.4)                   
#>  stringr     1.3.1      2018-05-10 cran (@1.3.1)                   
#>  tools       3.4.4      2018-03-15 local                           
#>  utils     * 3.4.4      2018-03-15 local                           
#>  withr       2.1.2      2018-03-15 CRAN (R 3.4.4)                  
#>  yaml        2.1.19     2018-05-01 cran (@2.1.19)

@mkearney
Copy link
Collaborator

mkearney commented Aug 3, 2018

It's working like a charm for me on my Mac, PC, and Linux. Try updating jsonlite, httr, and if it's still not working then updating R (I think the current release is 3.5).

@sefabey
Copy link

sefabey commented Oct 2, 2018

Ok, you can close this issue now. I'm not sure why but this is working fine on my local Rstudio. Might be a Docker related issue.

@vicgithub1
Copy link
Author

vicgithub1 commented Oct 2, 2018 via email

@sefabey
Copy link

sefabey commented Oct 2, 2018

Follow the suggestions in the thread, I'd say.

Also, have you checked

Sys.getenv("GOOGLE_MAPS_KEY")
and
identical(Sys.getenv("GOOGLE_MAPS_KEY"),rtweet:::find_google_geocode_key())?

If you see an API key and the latter return TRUE, it should work.

@vicgithub1
Copy link
Author

vicgithub1 commented Oct 2, 2018 via email

@sefabey
Copy link

sefabey commented Oct 2, 2018

What does Sys.getenv("GOOGLE_MAPS_KEY") return?

@rmoor
Copy link

rmoor commented Oct 14, 2018

I have the same issue with vic. Got my google maps API from sys.getenv and a "true" from identical command. But still:

rtweet::lookup_coords("UK")
$place
[1] "UK"

$box
NULL

$point
NULL

attr(,"class")
[1] "coords" "list"

@aminadibi
Copy link

I have the same problem. API identical, all locations are returned as NULL except US ones.

@ghost
Copy link

ghost commented Nov 24, 2018

I had the same problem, this is the way I solved it: When you are creating your API Key, make sure you select "places" and activate "Geocoding API", then just simply run "system("./.Renviron")" in Rstudio and update your API Key. Reset the session and everything should work perfectly. Hope this solves your problem.

@matthewryansisco
Copy link

Had the same issue, and enabling the Geocoding API fixed it for me as well. Thanks!

@rish19
Copy link

rish19 commented Jan 31, 2019

After changing the key to geocoding API key, lookup_coords() worked for a single time. But when I tried adding components="country:India" it again doesn't retrieves any tweets. And neither does it works for the code that worked initially.
I've tried all the measures mentioned above, any idea what could be the problem?

re=lookup_coords("india", components="country:India")
ra <- search_tweets(
searchString, n=1000, type='recent',geocode=re , retryonratelimit = FALSE, include_rts = FALSE, lang='en'
)

re
$place
[1] "india"

$box
NULL

$point
NULL

attr(,"class")
[1] "coords" "list"

identical(Sys.getenv("GOOGLE_MAPS_KEY"),rtweet:::find_google_geocode_key())
[1] TRUE

@guzmart
Copy link

guzmart commented Dec 13, 2019

Geocoding API must be enable from Google Cloud Platform; billing must be enable too.

@AbhishekSingl
Copy link

AbhishekSingl commented Aug 20, 2020

Despite Geocoding API was enable, it didn't work for me. Then after setting the R system environment as mentioned below worked for me.

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

10 participants