Вот одно из решений.
Вход
tribble(~light, ~date,
"0","20190314",
"0","20190317",
"1","20190314",
"0","20190318",
"1","20190316",
"1","20190318",
"1","20190314"
) ->d
Код
library(dplyr)
d %>% group_by(date) %>% # group by date
mutate(is_keep = if_else("0" %in% light & "1" %in% light, 1,0)) %>% # create a temporary column to keep track if date has both 0 and 1.
filter(is_keep==1) %>% # filter out rows to keep
select(-is_keep) %>% # remove temp column
ungroup() #ungroup df
Выход
light date
<chr> <chr>
1 0 20190314
2 1 20190314
3 0 20190318
4 1 20190318
5 1 20190314