On 19/06/2014, 3:10 PM, Christian Hoffmann wrote: > Hi, > > 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 > .... > \name{pasteInfix} > \alias{pasteInfix} > \alias{\%&\% > } > \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. >
Since % is a comment marker in .Rd files, you need to be quite careful how you enter them. I would look at examples in the R sources, e.g. http://svn.r-project.org/R/trunk/src/library/base/man/match.Rd Duncan Murdoch > What is wrong in my .Rd file? > > PS: The placement of the closing } and the escaping of "%" seem also > critical. > > TIA Christian > ______________________________________________ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.