How can I pass the Bing Maps Services Key #122
-
Hi all, I'd like to test Tidygeocoder with Bing Maps Services. I already have a Bing key to test them, but I can't find a way to pass it using any Tidygeocoder function. Am I missing something? Thank you. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
Hi! API Keys should be set as an environment variable, see https://jessecambon.github.io/tidygeocoder/articles/geocoder_services.html#api-key-retrieval-1. Note that Bing was introduced on v1.0.3, so please check that you have updated your package first: update.packages("tidygeocoder") For your convenience, find a reprex below: Sys.setenv(BINGMAPS_API_KEY = "<YOUR API KEY HERE>")
library(tidygeocoder)
geo("Times Square", method = "bing")
#> # A tibble: 1 x 3
#> address lat long
#> <chr> <dbl> <dbl>
#> 1 Times Square 40.8 -74.0
sessionInfo()
#> R version 4.0.5 (2021-03-31)
#> Platform: x86_64-w64-mingw32/x64 (64-bit)
#> Running under: Windows 10 x64 (build 19041)
#>
#> Matrix products: default
#>
#> locale:
#> [1] LC_COLLATE=Spanish_Spain.1252 LC_CTYPE=Spanish_Spain.1252
#> [3] LC_MONETARY=Spanish_Spain.1252 LC_NUMERIC=C
#> [5] LC_TIME=Spanish_Spain.1252
#>
#> attached base packages:
#> [1] stats graphics grDevices utils datasets methods base
#>
#> other attached packages:
#> [1] tidygeocoder_1.0.3
#>
#> loaded via a namespace (and not attached):
#> [1] pillar_1.6.0 compiler_4.0.5 highr_0.9 tools_4.0.5
#> [5] digest_0.6.27 jsonlite_1.7.2 evaluate_0.14 lifecycle_1.0.0
#> [9] tibble_3.1.1 pkgconfig_2.0.3 rlang_0.4.10 reprex_2.0.0
#> [13] DBI_1.1.1 cli_2.5.0 rstudioapi_0.13 curl_4.3.1
#> [17] yaml_2.2.1 xfun_0.22 withr_2.4.2 styler_1.4.1
#> [21] stringr_1.4.0 httr_1.4.2 dplyr_1.0.5 knitr_1.33
#> [25] generics_0.1.0 fs_1.5.0 vctrs_0.3.7 tidyselect_1.1.1
#> [29] glue_1.4.2 R6_2.5.0 fansi_0.4.2 rmarkdown_2.8
#> [33] purrr_0.3.4 magrittr_2.0.1 ps_1.6.0 backports_1.2.1
#> [37] ellipsis_0.3.1 htmltools_0.5.1.1 assertthat_0.2.1 utf8_1.2.1
#> [41] stringi_1.5.3 crayon_1.4.1.9000 Created on 2021-05-12 by the reprex package (v2.0.0) |
Beta Was this translation helpful? Give feedback.
Hi!
API Keys should be set as an environment variable, see https://jessecambon.github.io/tidygeocoder/articles/geocoder_services.html#api-key-retrieval-1.
Note that Bing was introduced on v1.0.3, so please check that you have updated your package first:
update.packages("tidygeocoder")
For your convenience, find a reprex below: