From d558e7efe11228029bccc2b83ccf1059b8a57590 Mon Sep 17 00:00:00 2001 From: Tobias Schmidt Date: Fri, 31 Mar 2017 13:50:19 -0700 Subject: [PATCH 1/2] rate limit error on geocode() only when source is google --- R/geocode.R | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/R/geocode.R b/R/geocode.R index 27b7a01..5dca7fe 100644 --- a/R/geocode.R +++ b/R/geocode.R @@ -113,8 +113,10 @@ geocode <- function(location, output = c("latlon", "latlona", "more", "all"), } # message/stop as neeeded - s <- sprintf("google restricts requests to %s requests a day for non-premium use.", limit) - if(length(location) > as.numeric(limit)) stop(s, call. = FALSE) + if(source == 'google') { + s <- sprintf("google restricts requests to %s requests a day for non-premium use.", limit) + if(length(location) > as.numeric(limit)) stop(s, call. = FALSE) + } if(length(location) > 200 && messaging) message(paste("Reminder", s, sep = " : ")) # geocode ply and out From fd3c4351aa751aaaa473b1e6c5f01230da246784 Mon Sep 17 00:00:00 2001 From: Tobias Schmidt Date: Thu, 3 Aug 2017 19:45:04 -0700 Subject: [PATCH 2/2] Add contribution to NEWS --- NEWS | 2 ++ 1 file changed, 2 insertions(+) diff --git a/NEWS b/NEWS index 2b29065..8802ed9 100644 --- a/NEWS +++ b/NEWS @@ -40,6 +40,8 @@ FIXES * google functions now better handle special characters. (#104, thanks casa-henrym) * gglocator now properly works again. (#87, thanks @salah31416 and @mvkorpel) +* geocode() throws rate limit errors only when source is google (#150, + thanks @royalts) ggmap 2.6.1