Skip to content

Instantly share code, notes, and snippets.

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 ajdamico/488879 to your computer and use it in GitHub Desktop.
Save ajdamico/488879 to your computer and use it in GitHub Desktop.
calculate your ten thousandth day on earth with R
#replace my birthday with yours
birthday <- strptime(c("8.18.1982"), format = "%m.%d.%Y", tz="EST")
#r counts everything in seconds, so this code multiplies by 60 seconds in a minute, 60 minutes in an hour, 24 hours in a day.
days <- function(u) {
x <- u * 60 * 60 * 24
return(x)
}
#change these numbers to whichever days you'd like to see, separated by commas
birthday + days( c( 10000 , 15000 , 20000 ) ) - 1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment