Skip to content

Instantly share code, notes, and snippets.

@wrathematics
Created September 11, 2014 13:22
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 wrathematics/94be9aa5fc47b37f42f5 to your computer and use it in GitHub Desktop.
Save wrathematics/94be9aa5fc47b37f42f5 to your computer and use it in GitHub Desktop.
String addition
"+" <- 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