@Procrastinatusは、google_places()
機能を使用してRでこれを行うには、私のgooglewayパッケージを使用できることを指摘しています。また、有効なGoogle APIキーが必要です。
Googleマップに表示されるものは、必ずしもPlaces APIから返されるものではありません。
library(googleway)
## your valid api key
# api_key <- read.dcf("~/Documents/.googleAPI", fields = "GOOGLE_API_KEY")
search_res <- google_places(search_string = "Olympus Avenue, Warwick, UK",
key = api_key)
search_res$results$name
# [1] "Holiday Inn Leamington Spa - Warwick"
search_res <- google_places(search_string = "Assured Property Group, UK",
key = api_key)
search_res$results$name
# [1] "Assured Property"
search_res$results$formatted_address
# [1] "77 Market St, Droylsden, Manchester M43 6DD, United Kingdom"
geo <- google_geocode(address = "Assured Property Group, Olympus Avenue, Warwick, UK",
key = api_key)
search_res <- google_places(location = c(geo$results$geometry$location$lat,
geo$results$geometry$location$lng),
radius = 1000,
key = api_key)
search_res$results$name
# [1] "Holiday Inn Leamington Spa - Warwick" "McDonald's"
# [3] "Pure Offices Leamington Spa" "Canute Group"
# [5] "Local Taxis" "Timpson Locksmith's & Safe Engineers"
# [7] "mplcontact" "Roast Coffee Weight Loss"
# [9] "We Buy Your Tyres" "Diamond Taxis"
# [11] "NS Line Cars" "Costa Coffee Drive Thru"
あなたは入力として何を持っていますか?アドレス?会社名は? –
Rについては、[googlewayパッケージ](https://github.com/SymbolixAU/googleway)を試すことができます。おかげさまで – Jaap