Last active
January 17, 2017 21:48
-
-
Save BillPetti/fc4fc5af30029fee3604 to your computer and use it in GitHub Desktop.
A function to check on how long until opening day
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
is_it_opening_day <- function(x) { | |
openingday <- as.Date("2017-04-03") | |
if ((openingday - Sys.Date()) > 1) {print(paste0("Nope. We've still got ", (openingday - Sys.Date()), " days to go. Stay strong."))} else | |
if ((openingday - Sys.Date()) == 1) {print(paste0("Nope, opening night is not the same thing as opening day. We've still got 1 day to go. But there are a few games on tonight."))} | |
else | |
if ((Sys.Date() - openingday) > 1) {print(paste0("Seriously? The season started ", (Sys.Date() - openingday), " days ago. Go watch some baseball!"))} | |
else | |
if ((Sys.Date() - openingday) == 1) {print(paste0("The season started yesterday. Go watch some baseball!"))} | |
else {print("Yes! Rejoice! It's Opening Day, All's right with the world.")} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment