My dataset:
> as_tibble(wq4)
# A tibble: 58,538 x 4
Date Site Analyte Value2
<date> <fct> <fct> <dbl>
1 2014-01-10 N2 Ammonia NH3-N 0.01
2 2014-01-10 N2 Chlorophyll - a 1.5
3 2014-01-10 N2 Filtered Total Phosphorus 0.005
4 2014-01-10 N2 Oxidised Nitrogen 0.1
5 2014-01-10 N2 Total Nitrogen 0.3
6 2014-01-10 N2 Total Phosphorus 0.008
7 2014-01-10 N2 Ammonia NH3-N 0.02
8 2014-01-10 N2 Chlorophyll - a 1.4
9 2014-01-10 N2 Conductivity 191
10 2014-01-10 N2 Enterococci 19
# … with 58,528 more rows
I want to filter out a certain set of values based on multiple conditions using dplyr. What I've got so far is:
filter(wq4, Site != "N1" & !Date %in% c("2019-04-17", "2019-04-18", "2019-04-19"))
I essentially want to remove any data from the 17th to 19th Apr 2019, only at Site N1 (not any of my other sites).
I don't think this line of code is working for me. It is either the "&" or perhaps dplyr is struggling with the date format?
Any suggestions? Thanks.