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

From: Henrique Dallazuanna <wwwhsd_at_gmail.com>
Date: Tue, 26 Feb 2008 10:52:42 -0300

You can use '\include' also:

\documentclass{article}
\begin{document}

\include{/usr/local/lib/R/library/graphics/latex/plot} %file.path(system.file(package="graphics"), "latex", "plot")

\end{document}

I don't know if there is a way of input file.path in include by Sweave.

On 25/02/2008, Jean lobry <lobry_at_biomserv.univ-lyon1.fr> wrote:
> 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
> file:
>
> -------- tmp.rnw --------
> \documentclass{article}
> \begin{document}
> <<>>=
> ?plot
> @
> \end{document}
> -------- tmp.rnw --------
>
> yields the following LaTeX file on my platform (session info at the end):
>
> -------- tmp.tex --------
> \documentclass{article}
> \usepackage{/Library/Frameworks/R.framework/Resources/share/texmf/Sweave}
> \begin{document}
> \begin{Schunk}
> \begin{Sinput}

> > `?`(plot)
> \end{Sinput}

> \end{Schunk}

> \end{document}
> -------- 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?
>
> Best,
>
> Jean
>
> > sessionInfo()
> R version 2.6.2 (2008-02-08)
> i386-apple-darwin8.10.1
>
> locale:
> C
>
> 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
> http://pbil.univ-lyon1.fr/members/lobry/
>
> ______________________________________________
> R-help_at_r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
>

-- 
Henrique Dallazuanna
Curitiba-Paraná-Brasil
25° 25' 40" S 49° 16' 22" O

______________________________________________
R-help_at_r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.
Received on Tue 26 Feb 2008 - 13:57:21 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Tue 26 Feb 2008 - 14:00:17 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.

list of date sections of archive