Accounting for that embarrassing mistake, the code I ran is below.
Start <- structure(list(Date = structure(c(1620345600, 1621123200, 1624752000,
1625184000, NA, 1625356800, 1627084800, 1628035200, 1628985600,
1631404800, 1631577600, 1627344000, 1632182400, 1627430400, 1628985600,
1632441600, 1632441600, 1631145600, 1634083200, 1632441600, 1630195200
), class = c("POSIXct", "POSIXt"), tzone = "UTC")), class = c("tbl_df",
"tbl", "data.frame"), row.names = c(NA, -21L))
current_date <- Sys.Date()
Start%>%
mutate(Date=ifelse(Date < current_date, Date, NA))
as.Date(Start$Date)
View(Start)
Running this code, I get the following output which unfortunately still does not replace the desired values with NA. I would like any date before today to have the value "NA".
structure(list(Date = structure(c(1620345600, 1621123200, 1624752000,
1625184000, NA, 1625356800, 1627084800, 1628035200, 1628985600,
1631404800, 1631577600, 1627344000, 1632182400, 1627430400, 1628985600,
1632441600, 1632441600, 1631145600, 1634083200, 1632441600, 1630195200
), class = c("POSIXct", "POSIXt"), tzone = "UTC")), class = c("tbl_df",
"tbl", "data.frame"), row.names = c(NA, -21L))
Thank you for your help!