3 ms·
But if you know R, you can change the behavior of operators. > oldPlus <- `+` > `+` <- function(e1, e2) { + if (is.character(e1) && is.characte
by scottmmjackson 9y ago
But if you know R, you can change the behavior of operators.
> oldPlus <- `+`
> `+` <- function(e1, e2) {
+ if (is.character(e1) && is.character(e2))
+ paste(e1,e2,sep="")
+ else
+ oldPlus(e1,e2)
+ }
> "hello" + "world"
[1] "helloworld"