Can anyone please help me to solve the error. I want to check in IF statement that, if there is no Null then insert the value.
while (i < 33 )
{
library(jsonlite)
library(httr)
get_reply2 <- my_get(staypoints$Stayplon[i],staypoints$staypLat[i], 2)
get_replyFF2 <- append(get_replyFF2, get_reply2$value$id)
get_replyFG2 <- append(get_replyFG2, get_reply2$value$title)
if (get_replyFF2[i] != 0)
{
LONGG <- append(LONGG, staypoints$Stayplon[i])
LATT <- append(LATT, staypoints$Stayplon[i])
}
i <- i + 1
};
Error: Error in if (get_replyFF2[i] != 0) { :
missing value where TRUE/FALSE needed