问题描述
我正在使用R中的google map中的places API。在以下示例中,我注意到返回了一些意外的place_types。
在该示例中,我只希望获得类型为establishment
的位置,但第一个和最后一个记录不是establishment
。为什么会这样?仅establishment
会发生这种情况吗?我检查了page中的表2,但没有显示任何内容。
> google_places(location = c(50.116921,8.665373),+ place_type = "establishment",+ radius = 10,+ key = api_key)$results%>%select(c("name","types"))
The radar argument is Now deprecated
name types
1 Frankfurt locality,political
2 World Bank Group bank,finance,point_of_interest,establishment
3 Dulce Chocolate & Ice Cream food,store,establishment
4 Salädchen Frankfurt Westend restaurant,food,establishment
5 MFS International (UK) Ltd. finance,establishment
6 Occidens point_of_interest,establishment
7 OBM Baumaschinen-Handels-GmbH point_of_interest,establishment
8 International Finance Corporation finance,establishment
9 BANCO ITAU BBA INTERNATIONAL,S.A. bank,establishment
10 Innenstadt II sublocality_level_1,sublocality,political
会话信息如下:
> sessionInfo()
R version 3.6.1 (2019-07-05)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows >= 8 x64 (build 9200)
Matrix products: default
locale:
[1] LC_COLLATE=German_Germany.1252 LC_CTYPE=German_Germany.1252 LC_MONETARY=German_Germany.1252 LC_NUMERIC=C LC_TIME=German_Germany.1252
attached base packages:
[1] stats graphics Grdevices datasets parallel utils methods base
other attached packages:
[1] googleway_2.7.1 tfdatasets_2.2.0 keras_2.3.0.0 tensorflow_2.2.0 wesanderson_0.3.6 RPostgres_1.2.0 doParallel_1.0.15 iterators_1.0.12 foreach_1.5.0 logging_0.10-108 fastDummies_1.6.1
[12] MCI_1.3.3 data.table_1.13.0 DBI_1.1.0 forcats_0.5.0 stringr_1.4.0 dplyr_1.0.1 purrr_0.3.4 readr_1.3.1 tidyr_1.1.1 tibble_3.0.3 ggplot2_3.3.2
[23] tidyverse_1.3.0
loaded via a namespace (and not attached):
[1] httr_1.4.2 bit64_4.0.2 jsonlite_1.7.0 modelr_0.1.8 shiny_1.5.0 assertthat_0.2.1 blob_1.2.1 cellranger_1.1.0 yaml_2.2.0 pillar_1.4.6
[11] backports_1.1.4 lattice_0.20-38 glue_1.4.1 reticulate_1.16 digest_0.6.25 promises_1.1.1 rvest_0.3.6 colorspace_1.4-1 httpuv_1.5.4 htmltools_0.5.0
[21] Matrix_1.2-18 pkgconfig_2.0.3 broom_0.7.0 haven_2.3.1 xtable_1.8-4 scales_1.0.0 whisker_0.4 later_1.1.0.1 tfestimators_1.9.1 generics_0.0.2
[31] ellipsis_0.3.1 withr_2.2.0 cli_2.0.2 mime_0.9 magrittr_1.5 Crayon_1.3.4 readxl_1.3.1 fs_1.5.0 fansi_0.4.1 xml2_1.3.2
[41] tools_3.6.1 hms_0.5.3 lifecycle_0.2.0 munsell_0.5.0 reprex_0.3.0 compiler_3.6.1 forge_0.2.0 rlang_0.4.7 grid_3.6.1 rstudioapi_0.11
[51] htmlwidgets_1.5.1 base64enc_0.1-3 gtable_0.3.0 codetools_0.2-16 curl_4.3 R6_2.4.1 tfruns_1.4 lubridate_1.7.4 fastmap_1.0.1 bit_4.0.4
[61] zeallot_0.1.0 stringi_1.4.3 Rcpp_1.0.1 vctrs_0.3.2 dbplyr_1.4.4 tidyselect_1.1.0
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)