Mutate_geocode (ggmap) | Error "Results must be all atomic or all data frames"

Problem

I am trying mutate_geocodeto geocode a set of 48K addresses. The actual geocoding function works very well, but as soon as the geocoding completes, I get an error:

Error in list_to_dataframe (res, attr (.data, "split_labels") ,. id, id_as_factor): the results should be all atomic or all data frames

I'm not sure why I came across this, as I tried to use the same code to geocode a smaller subset of the full 48K file and no errors were returned. Can someone point me in the right direction in troubleshooting? Below is the code that I run, the corresponding details of setting R.

Code used

# load up the ggmap library
library(ggmap)
library(qdap)
library(plyr)
# get the input data
infile <- "DistinctAddressesAlleg_20170906_1"
data <- read.csv(paste0(infile, '.csv'))
data$address <- as.character(data$FullAddress)
register_google(key = "removed",
                account_type = "premium",
                day_limit = 150000)
data_geocoded <-
  data %>% mutate_geocode(address,
                          output = "more",
                          override_limit = TRUE,
                          key = key)

R Setting

  • R v3.4.1
  • RStudio v1.0.153
  • ggmap v2.7
+4
source share
1 answer

I used to encounter the same problem with the geocoding function, and I solved the problem by forcing a data file:

data_geocoded <- as.data.frame(geocode(data$address,
                               output = "more"))
0
source

Source: https://habr.com/ru/post/1685307/


All Articles