[inlinedocs] Enquiry related to the formatting of the usage tag

Mark Thyer mthyer at civeng.adelaide.edu.au
Fri Jan 13 13:36:57 CET 2012


Toby,

Thanks for the quick reply. It is much appreciated.

Your solution worked well, almost...... :) 

It fixed the problem of the usage being broken over so many lines, it looks
much better now, thank you. 

However if I have a character vector as a default value for an argument and
that character vector has a "%" character  (see attached script as an
example), then the parsing done in package.skeleton.dx produces this error 

Error: '\%' is an unrecognized escape in character string starting "50\%"

This is not a major problem because a simple workaround, is to replace the
"%" character in default character vectors with something else. It just took
me awhile to work out what was going on, and if its easily fixed, then
great. 

Cheers,
Mark


  





-----Original Message-----
From: Toby Dylan Hocking [mailto:Toby.Hocking at inria.fr] 
Sent: Friday, 13 January 2012 7:59 PM
To: mthyer at civeng.adelaide.edu.au
Cc: inlinedocs-support at r-forge.wu-wien.ac.at
Subject: Re: [inlinedocs] Enquiry related to the formatting of the usage tag

Hi Mark, how's it going? Thanks for your interest in inlinedocs.

I understand your concern with the formatting of the usage tag. We
added the returns after every comma in the usage section because the
default format section generated using the regular package.skeleton()
leaves really long lines which run off the page and are unreadable in
the PDF version of the manual.

But your concern is valid and I guess we should have more intelligent
or perhaps configurable line breaks. At this stage of inlinedocs
development the code that processes the usage section is not very
configurable, but if you want to have a look at it, search for the
comment "Fix usage" in inlinedocs/R/package.skeleton.dx.R. The best
solution I could come up with is to use R to parse() the expression in
the \format{} tag, then use the automatic line breaks provided by
using format() on the parsed R code. This new code has been checked
into SVN, so you can try the new version immediately by downloading 

svn checkout svn://svn.r-forge.r-project.org/svnroot/inlinedocs

and installing

R CMD INSTALL inlinedocs/pkg/inlinedocs

Tell us if this works out for you.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: A_test.R
Type: application/octet-stream
Size: 287 bytes
Desc: not available
URL: <http://lists.r-forge.r-project.org/pipermail/inlinedocs-support/attachments/20120113/cf5fe523/attachment.obj>


More information about the Inlinedocs-support mailing list