[Rd] Reordering entries in package manual PDF's

Duncan Murdoch murdoch.duncan at gmail.com
Wed Dec 1 19:38:46 CET 2010

On 01/12/2010 12:25 PM, Aleksi Kallio wrote:
> Hi again,
> And sorry for the spam.
> >  So now the output I'm getting is "good enough". I would still like to reorder functions so that they appear in a more logical order, so if anyone has ideas, please share!
> Newer R versions also add an index page at the end. In my case it is obsolete, so ideas on how to get rid of it are appreciated.
> A pointer to an in-depth technical description of the manual generation process would help, as hacking these kinds of things would be probably quite easy. So far I have not been able to Google anything relevant.

You could look at R Internals for such a thing, but you wouldn't find 
it.  (That manual tends to cover lower level issues.)

Generally in a case like this you need to go to the source code.  First, 
get a copy, then figure out what happens.  Here are the steps:

1. Download the full source from 
http://cran.r-project.org/src/base/R-2/R-2.12.0.tar.gz (or from a 
mirror), and untar it.

2. We use R CMD Rd2dvi to get the output we want.  Looking in 
src/scripts, you can see that the Rd2dvi script does some argument
cleaning, then runs tools:::..Rd2dvi().

3.  Look in src/library/tools/R for the file containing the source to 
..Rd2dvi(); you'll find it in Rd2dvi.R.

You can also see deparsed versions just by printing the tools:::..Rd2dvi 
function, but they may not be as useful as the original source.

I hope that helps.

Duncan Murdoch

More information about the R-devel mailing list