I like to overload my ampersand operator with paste. So that way I can paste stuff easily. Like this:
R> \"Hello\" & \" World\"
[1] \"Hello World\"
You'll need to use the S3 object system in R:
`&` <- function(e1, e2) UseMethod("&", c(e1, e2))
`&.default` <- function(e1, e2) paste(e1, e2)
`&.logical` <- function(e1, e2) .Primitive("&")(e1, e2)
Now you can use &
as you would expect:
> 1 & 2
[1] "1 2"
> TRUE & FALSE
[1] FALSE
> "Hello" & "World"
[1] "Hello World"
>