I need to add a column that marks "1" if the data falls in a certain range.
structure(list(Start = structure(c(1583107200, 1580515200, 1603152000,
1590969600), class = c("POSIXct", "POSIXt"), tzone = "UTC"),
End = structure(c(1589932800, 1585526400, 1605830400, 1593561600
), class = c("POSIXct", "POSIXt"), tzone = "UTC")), row.names = c(NA,
-4L), class = c("tbl_df", "tbl", "data.frame"))
I need to code where if the row has the Start and End dates between April 1, 2020 to October 31, 2020 it adds a Column called Active and puts a "1" for it and "0" otherwise. For example one of my rows has a Start of March 2, 2020 and for the End column it has May 20, 2020. So because the Start and End has days active between April 1, 2020 to October 31, 2020 the new column named Active should be set to 1 for that row. Hope someone can help!