I would like to use not in statement with a data.frame in dplyr but it is not working. I would like to exclude values from a data.frame since I do have huge week numbers. Below is an example
df1 = data.frame(week=c(1,2,3,4,5,6),sales=c(10,24,23,54,65,45))
week_e=data.frame(week=c(2,5))
so I would like to exclude weeks in week_e data frame from df1 and below is code and it is not working. Please help! Thank you.
df1 %>%
filter(!week %in% week_e)
week sales
1 1 10
2 2 24
3 3 23
4 4 54
5 5 65
6 6 45