[Rd] Building R package: make pdf & _masked_by_GlobalEnv

Prof Brian Ripley ripley at stats.ox.ac.uk
Tue Jun 13 08:04:10 CEST 2006


On Mon, 12 Jun 2006, Dan Rabosky wrote:

>
>>>
>>> I am assembling an R package (under Windows XP, R v.2.3) and have a very
>>> basic question.  Running R CMD build does not generate a pdf.  R CMD
>>> check generates a .dvi, but I cannot figure out how to automatically
>>> create the pdf.  I thought from reading the "writing r extensions' manual
>>> that R CMD build was supposed to generate the pdf.  I am having no
>>> success using various permutations of the Rd2dvi and texi2dvi, and I'm a
>>> bit frustrated.  I have miktex 2.4, which should (I thought) have the
>>> necessary pdftex tools to do this.  Maybe it does; I definitely have
>>> various directories named 'dvipdfm', 'pdftex', etc on my computer, but I
>>> have no idea whether there might be a problem.
>>
>> You need to give a bit more detail.  What is the .pdf being created
>> from?  What do things look like when you run a build?  Does install work?
>
> I guess I'm not sure what the .pdf is being created from - I don't know how
> this works.  I assumed that my set of .Rd files from the man dir would
> automatically be converted into .pdf, much like 'check' reads them into a
> dvi document.   When I run a build, I get an archive with all of my .R

[Assuming things which are not in the documentation is not a good idea.]

> source files, the DESCRIPTION, the .Rd files, my datafiles, and any
> documentation I've placed in inst/doc.  When I install this from CMD, the
> html help & chtml files compile, examples are copied from the /man
> directory to their own .Rd files, and everything - to me - appears
> OK.  'Install' from R CMD works with no problem - it warns me that my
> 'examples' directory is empty, but it proceeds to create the examples from
> my .Rd files anyway.
>
> I only get a .dvi manual when running 'check'.

Yes, 'check' only checks that the latex can be compiled.  It is not trying 
to create usable output for you: for that use R CMD Rd2dvi.

E.g. for a PDF manual for package grDevices, use

R CMD Rd2dvi --pdf .../library/grDevices

which works for me.


-- 
Brian D. Ripley,                  ripley at stats.ox.ac.uk
Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
University of Oxford,             Tel:  +44 1865 272861 (self)
1 South Parks Road,                     +44 1865 272866 (PA)
Oxford OX1 3TG, UK                Fax:  +44 1865 272595



More information about the R-devel mailing list