Skip to content

Instantly share code, notes, and snippets.

@nutterb
Created October 20, 2015 17:44
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nutterb/dbf35755a53f45e1f420 to your computer and use it in GitHub Desktop.
Save nutterb/dbf35755a53f45e1f420 to your computer and use it in GitHub Desktop.
pi_birthdays <- function(birthdate, n = 1:30, format = "%Y-%m-%d"){
if (!is.Date(birthdate) | !is.POSIXct(birthdate)){
birthdate <- as.Date(birthdate, format = format)
}
data.frame(n_pi = n,
pi_date = birthdate + 365.2425 * n * pi)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment