[英]Overcome the replacement has length zero Error
我在數據集上運行for循環,以檢索某個經度和緯度值附近的位置,並且只要有NA,for循環就會停止。 是否有可能繼續執行for循環並忽略丟失的信息。
for(i in 1:nrow(top)){
x <- (top[i,c("V3")]) ////latitude value
y <- (top[i,c("V4")]) /// longitude value
res <- GNfindNearby(lat=x, lng=y,radius=0.01) /// near by places
top[i,"Location"] <- res
}
GNfindNearby
? spDists
和spDistsN1
函數。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.