Skip to content

Instantly share code, notes, and snippets.

@k5cents
Last active June 1, 2021 21:50
Show Gist options
  • Save k5cents/0af08219f44e17a43d1c87eba6f1e855 to your computer and use it in GitHub Desktop.
Save k5cents/0af08219f44e17a43d1c87eba6f1e855 to your computer and use it in GitHub Desktop.
Determine certain dates in a sequence
library(lubridate)
x <- seq(from = mdy("January 23, 1845"), to = today(), by = "1 day")
x[year(x) %% 4 == 0 & month(x) == 11 & day(x) <= 7 & wday(x) == 2] + 1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment