[Roxygen-devel] Allow % in @example files

Daniel Sabanés Bové daniel.sabanesbove at ifspm.uzh.ch
Tue Sep 14 10:08:12 CEST 2010


Sorry, I forgot the attachments... now in this email.


-------- Original-Nachricht --------
Betreff: Allow %' in @example files
Von: Daniel Sabanés Bové <daniel.sabanesbove at ifspm.uzh.ch>
An: roxygen-devel at lists.r-forge.r-project.org
Datum: Mon 13 Sep 2010 15:50:04 CET

> Hi,
> 
> I like the @example roclet very much because it allows for clean
> separation of function documentation and example code. However, today I
> experienced that the percent symbol (%) is interpreted as a comment
> character. (This is at least the case in R 2.11.1, which I am using, and
> presumably since R 2.9.0, as described in a documentation by Duncan
> Murdoch [1].) So we get in trouble when the example.R file contains
> matrix multiplication "a %*% b", because R CMD check will just see "a",
> the rest of the line being a comment.
> 
> Fortunately it is easy to get roxygen to replace all % symbols in the
> @example files with "\%", so that the resulting Rd file is correct: I
> have attached the two necessary patches to Rd.R and Rd2.R, based on the
> release version 0.1-2.
> 
> Hope this is useful,
> 
> best regards
> Daniel
> 
> [1] http://developer.r-project.org/parseRd.pdf
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Rd.R.patch
Type: text/x-patch
Size: 819 bytes
Desc: not available
URL: <http://lists.r-forge.r-project.org/pipermail/roxygen-devel/attachments/20100914/407c2e97/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Rd2.R.patch
Type: text/x-patch
Size: 870 bytes
Desc: not available
URL: <http://lists.r-forge.r-project.org/pipermail/roxygen-devel/attachments/20100914/407c2e97/attachment-0001.bin>


More information about the Roxygen-devel mailing list