[R] .Rd vs. .R, matrix multiplication

Duncan Murdoch murdoch.duncan at gmail.com
Tue Dec 4 00:17:52 CET 2012


On 12-12-03 5:00 PM, Christian Hoffmann wrote:
> Hi,
>
> I find it cumbersomesome the I have to use \%*\% in .Rd files vs. %*% in
> .R files. R CMD check will refuse %*% in .Rd files. I would like to have
> %*% in .Rd files to be able to execute expressions with matrix
> multiplication from .Rd files directly, but ESS (version 5.13) would
> refuse to execute this execution.
>
> What can be done here?
>

That sounds like a problem that ESS could solve.  The rules for what 
needs escaping in .Rd files are well defined, and ESS should know what 
kind of file it is editing, so it should be fixable.

Allowing raw %*% in a .Rd code block would mean that invisible comments 
were impossible (since Rd comments start with %).  They are not 
extremely common, but common enough that it would inconvenience a lot of 
package writers to make that change.  Seems like a small ESS fix is easier.

Duncan Murdoch




More information about the R-help mailing list