[R] "a"+"b"

From: Matthew Dowle <mdowle_at_concordiafunds.com>
Date: Tue 02 May 2006 - 20:43:43 EST


Is there a way to define "+" so that "a"+"b" returns "ab" ?

> setMethod("+",c("character","character"),paste)
Error in setMethod("+", c("character", "character"), paste) :

        the method for function '+' and signature e1="character", e2="character" is sealed and cannot be re-defined
> "a"+"b"

Error in "a" + "b" : non-numeric argument to binary operator


        [[alternative HTML version deleted]]

R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html Received on Tue May 02 20:48:18 2006

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.1.8, at Tue 02 May 2006 - 22:09:57 EST.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.