Home > Blockchain >  How to subset in R deleting specific date range?
How to subset in R deleting specific date range?

Time:09-11

I need to subset all the rows that aren't included between certain date range.

I know that if I want to subset between dates, I can use this code:

data <- subset(data, DATE1 >= "2021-06-08" & DATE2 <= "2021-07-07")

But how can I subset all the rows that aren't in this date range?

CodePudding user response:

Use !

data <- subset(data, !(DATE1 >= "2021-06-08" & DATE2 <= "2021-07-07"))
  • Related