[R] infix paste and package

Christian Hoffmann christian at echoffmann.ch
Thu Jun 19 15:10:12 CEST 2014


I can successfully define  in .R and in  > R

"%&%" <- function(a,b) { paste(a,b,sep="") }

nd use in R >

  "a" %&% "b"
[1] "ab"

but in a package definition .Rd
\usage{ a  \%&\% b

will fail in R CMD   check --as-cran  saying

"I am" %&%
+  " hungry" # [1] "I am hungry"
Error: could not find function "%&%"
Execution halted.

What is wrong in my .Rd file?

PS:  The placement of the closing } and the escaping of "%" seem also 

TIA  Christian

Christian W. Hoffmann
CH - 8915 Hausen am Albis, Schweiz
Rigiblickstrasse 15 b, Tel.+41-44-7640853
mailto: christian at echoffmann.ch
home: www.echoffmann.ch

More information about the R-help mailing list