From c68c3a7338a3f457ca84e24ab0c4e6446ab822c9 Mon Sep 17 00:00:00 2001 From: Zhirui Wang <576572949@qq.com> Date: Fri, 18 May 2018 15:02:30 -0400 Subject: [PATCH] Modify return of failedGeocodeReturn() function failedGeocodeReturn() function returns a named vector, this will cause problem in the line 121 when combining named vector and data.frame together, i.e. try running code `geocode(c("CASIRATE D\u0092ADDA Italy","Shanghai"),output = "more")` Transform the named vector to a dataframe will resolve the problem --- R/geocode.R | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/R/geocode.R b/R/geocode.R index 27b7a01..5bc4871 100644 --- a/R/geocode.R +++ b/R/geocode.R @@ -441,12 +441,12 @@ failedGeocodeReturn <- function(output){ } else if(output == "latlona"){ return(c(lon = NA_real_, lat = NA_real_, address = NA_character_)) } else if(output == "more") { - return(c( + return(data.frame(list( lon = NA_real_, lat = NA_real_, type = NA_character_, loctype = NA_character_, address = NA_character_, north = NA_real_, south = NA_real_, east = NA_real_, west = NA_real_, locality = NA_character_, country = NA_character_ - )) + ))) } else { return(NA_real_) }