Created
September 11, 2014 13:22
-
-
Save wrathematics/94be9aa5fc47b37f42f5 to your computer and use it in GitHub Desktop.
String addition
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
"+" <- function(e1, e2){ | |
if (typeof(e1) == "character" && typeof(e2) == "character") | |
return(paste0(e1, e2)) | |
else | |
return(base::`+`(e1, e2)) | |
} | |
"a" + "b" | |
1 + 2 | |
"1" + 2 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment