[R] Code in Rd help files other than in \examples{}

Frank E Harrell Jr fharrell at virginia.edu
Tue Feb 12 14:50:05 CET 2002


Thank you very much for the note Friedrich.  May I ask two follow-up questions to make sure I understand all the possibilities in Rd files?  (1) Is there a pure verbatim environment for Rd files?  (2) Is there a way to put newlines inside \code{} text?  Thanks -Frank

On Tue, 12 Feb 2002 13:33:21 +0100
Friedrich.Leisch at ci.tuwien.ac.at wrote:

> >>>>> On Mon, 11 Feb 2002 15:39:23 -0500,
> >>>>> Frank E Harrell (FEH) wrote:
> 
>   > I am stumped in determining the proper syntax for including displayed S code within an R .Rd documentation file, in places other than \examples{}. I have tried
>   > \code{
>   >    line 1
>   >    line 2
>   > }
> 
>   > but the lines get run together.  When I terminate the lines by \cr, the "\cr" actually appears in the resulting html file.   This is all inside a customized \section{}.
> 
>   > On a related note, what is there a way to include large blocks of text within \examples{} that is not part of S comments?  I want such text to appear in the html help file, optimally with auto-wrapping of lines.  \dontrun{} does not appear to be exactly what I need.  I actually need multiple sub-\examples{} with intervening text but no new headings.
> 
>   > I am using R 1.4.0 on RedHat Linux 7.1.  Thanks in advance for pointers.
> 
> Sorry, we currently only support one code section per .Rd file, namely
> the examples section. .Rd was designed to write man pages in a rather
> strict format (such that all pages look "similar" and hence are easy
> to use).
> 
> We are currently investigating new ways for writing documentation,
> which will eventually result in new formats for writing function
> documentation. 
> 
> E.g., the current development version of R has Sweave() and friends
> which allows integrating S code in latex documents using the noweb
> syntax. http://www.ci.tuwien.ac.at/~leisch/Sweave has some details.
> This is meant for writing manuals, reports, etc.
> 
> A much more interactive approach is to use XML via Xalan, see Duncan
> Temple Lang's SXalan package and related info on
> http://www.omegahat.org/SXalan 
> This route is more likely to lead to new ways for object documentation
> (because computation on the documents is easier).
> 
> Of course this doesn't help you with your current problem, it is just
> meant as an excuse why we currently do not want to add new features to
> .Rd (and have not done so for quite some time).
> 
> best,
> 
> -- 
> -------------------------------------------------------------------
>                         Friedrich  Leisch 
> Institut für Statistik                     Tel: (+43 1) 58801 10715
> Technische Universität Wien                Fax: (+43 1) 58801 10798
> Wiedner Hauptstraße 8-10/1071      Friedrich.Leisch at ci.tuwien.ac.at
> A-1040 Wien, Austria             http://www.ci.tuwien.ac.at/~leisch
> -------------------------------------------------------------------
> 


-- 
Frank E Harrell Jr              Prof. of Biostatistics & Statistics
Div. of Biostatistics & Epidem. Dept. of Health Evaluation Sciences
U. Virginia School of Medicine  http://hesweb1.med.virginia.edu/biostat
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-help-request at stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._



More information about the R-help mailing list