[R] How to include the documentation of a function in a Sweave document?

Jean lobry lobry at biomserv.univ-lyon1.fr
Mon Feb 25 18:16:02 CET 2008

Dear R-help,

I would like to include the documentation of an R function in an
*.rnw document processed by Sweave. Because I'm sharing my *.rnw
files with colleagues under Linux and Windows (I'm on Mac OS X),
I would like a pure R solution.

The naive approach doesn't work, because Sweaving this *.rnw

-------- tmp.rnw --------
-------- tmp.rnw --------

yields the following LaTeX file on my platform (session info at the end):

-------- tmp.tex --------
>  `?`(plot)
-------- tmp.tex --------

in which no Soutput has been generated. Is it possible to redirect the
help output, in a platform-independent way, so that it is included in
the Soutput environment of the LaTeX file?



>  sessionInfo()
R version 2.6.2 (2008-02-08)


attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base

loaded via a namespace (and not attached):
[1] rcompgen_0.1-17

Jean R. Lobry            (lobry at biomserv.univ-lyon1.fr)
Laboratoire BBE-CNRS-UMR-5558, Univ. C. Bernard - LYON I,
43 Bd 11/11/1918, F-69622 VILLEURBANNE CEDEX, FRANCE
allo  : +33 472 43 27 56     fax    : +33 472 43 13 88

More information about the R-help mailing list