Not able to filter on logical columns below. Wanted to check if there is way to filter. If I filter based on false, NA row becomes all NA. I need rows with NA but with values in other column?
asd <- data.frame(Cat = c("A","B","B","A","B","A"), Start_num = c(2, 5, 1, 6, 6, 4), End_num = c(3, 7, 4, 7, 8, 5))
new <- asd %>% arrange(Cat,Start_num) %>%
group_by(Cat) %>%
mutate(Var=lead(Start_num)>End_num)
new <- as.data.frame(new)
new[new$Var != FALSE,]
Cat Start_num End_num Var
1 A 2 3 TRUE
2 A 4 5 TRUE
NA <NA> NA NA NA
4 B 1 4 TRUE
NA.1 <NA> NA NA NA
```
question from:
https://stackoverflow.com/questions/65936682/filter-logical-columns 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…