我有一个带地址的data.frame(df)。我想对它们进行地理编码。我的代码:
for(i in 1:nrow(df))
{
# Print("Working...")
result <- geocode(df$address[i], output = "latlona", source = "google")
df$lon[i] <- as.numeric(result[1])
df$lat[i] <- as.numeric(result[2])
}
输出和错误如下:
Error in chartr(" ", "+", location) :
invalid input 'Joaquín Requena esquina Charrúa 1111' in 'utf8towcs'
In addition: Warning messages:
1: geocode failed with status ZERO_RESULTS, location = "a pasos de OSE 0000"
2: geocode failed with status ZERO_RESULTS, location = "Luis Galvani 1111"
有帮助吗?
谢谢!