-
Notifications
You must be signed in to change notification settings - Fork 236
Closed
Labels
Description
Sorry for omitting a reproducible example, but I think my problem should be understandable from the code below.
I was wondering why a geocode run for many locations and "urlonly = TRUE" was querying Google anyway. To my understanding, it should not. I found out that the reason for this behavior is in lines 122 and 124 of geocode.R. They are currently:
# geocode ply and out
if(output == "latlon" || output == "latlona" || output == "more"){
return(ldply(as.list(location), geocode, output = output, source = source, messaging = messaging, inject = inject))
} else { # output = all
return(llply(as.list(location), geocode, output = output, source = source, messaging = messaging, inject = inject))
}The ldply call omits the urlonly parameter. Thus, even if the "top-level function" function is called with "urlonly = TRUE", the single-item function call queries the data source.
If I do not understand the urlonly parameter completely wring, I think that section should be:
# geocode ply and out
if(output == "latlon" || output == "latlona" || output == "more"){
return(ldply(as.list(location), geocode, output = output, source = source, messaging = messaging, inject = inject, urlonly = urlonly))
} else { # output = all
return(llply(as.list(location), geocode, output = output, source = source, messaging = messaging, inject = inject, urlonly = urlonly))
}Reactions are currently unavailable