Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I convert Rd files to pdf for a package that I am creating in R?

Tags:

r

I am writing a package in R and I would appreciate some example bash code to process the Rd files to latex and then to pdf.

It is in the directory ~/mypkg/dev/. I have generated the file structure and Rd templates.

from ~/mypkg/dev/man, I have tried

R CMD Rdconv -o mypkg-package.tex --type=latex mypkg-package.Rd

mypkg-package.tex file is generated, but

pdflatex mypkg-package.tex

generates tex without any preamble.

I have read the documentation in "Writing R extensions" and "R CMD Rdconv --help" on this subject, but no examples are provided.

Thank you

like image 706
David LeBauer Avatar asked Sep 23 '10 15:09

David LeBauer


1 Answers

There are two issues here:

First, the Rdconv command only transforms one Rd file at a time; your question suggests that you want the full manual.

Second, the Rd2dvi command is your friend. I just ran the following on a local package:

R CMD Rd2dvi --pdf --title='Test of foo' -o /tmp/foo.pdf man/*.Rd

That should be what you asked for.

like image 150
Dirk Eddelbuettel Avatar answered Oct 18 '22 16:10

Dirk Eddelbuettel