Skip to content

Output from examples in help files

1 message · Warnes, Gregory R

#
I would also find it usefult to be able to easily include the output of
commands in the example section by using a markup command.

Something like:

\examples{
     x <- rnorm(1000)
     quants <- quantcut( x )
     table(quants)     y _ rnorm(100)
     \output{
     quants
       [-3.64,-0.651] (-0.651,-0.0353]  (-0.0353,0.615]     (0.615,2.69] 
                  250              250              250              250 
     }
}

Which might be rendered something like

     y _ rnorm(100)
     x _  cut(rnorm(100, mean=y, sd=0.25),c(-4,-1.5,0,1.5,4))
     table(x)
     # Output: 
     #      quants
     #       [-3.64,-0.651] (-0.651,-0.0353]  (-0.0353,0.615]
(0.615,2.69] 
     #                  250              250              250
250 
     #

In plain text, or with suitable font/highlighting changes in HTML / LaTeX.  

-Greg
LEGAL NOTICE
Unless expressly stated otherwise, this message is confidential and may be privileged. It is intended for the addressee(s) only. Access to this E-mail by anyone else is unauthorized. If you are not an addressee, any disclosure or copying of the contents of this E-mail or any action taken (or not taken) in reliance on it is unauthorized and may be unlawful. If you are not an addressee, please inform the sender immediately.
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
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
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._