Hi all,
I am calling the call_geolocator_latlon function from the tigris package in order to convert latitude and longitude points into census tracts.
I have a dataset with 350,000 rows. Initially, the code runs for first 3,000 rows:
## dummy variable
FY23seekingAssist$tracts <- 0
FY23seekingAssist[1:3000,]$tracts <- apply(FY23seekingAssist[1:3000,], 1,
function(row) call_geolocator_latlon(row['Latitude'], row['Longitude'], ))
However, for the next 3,000 rows, as shown below, I get this error:
## dummy variable
FY23seekingAssist$tracts <- 0
FY23seekingAssist[3001:6000,]$tracts <- apply(FY23seekingAssist[3001:6000,], 1,
function(row) call_geolocator_latlon(row['Latitude'], row['Longitude'], ))
Error in curl::curl_fetch_memory(url, handle = handle) :
URL using bad/illegal format or missing URL
Does anyone have any insight into what is causing this error? Another question I have is how do I most effectively run this code for 350,000 rows? I don't want to have to change the rows within the function for every row but will do so if that is what it takes....
Thank you so much in advance.
PS I would post a snippet of the dataset but the information is confidential.