<TeXmacs|1.0.7.11>

<style|<tuple|tmdoc|maxima>>

<\body>
  <\tmdoc-title>
    Example <name|R> session
  </tmdoc-title>

  In order to launch an <name|R> session inside <TeXmacs>, use
  <menu|Insert|Session|R>. The <verbatim|v()> function can be used in order
  to include the contents of the <name|R> graphics window inside your
  worksheet.

  <\session|r|default>
    <\output>
      \<gtr\> Welcome to the TeXmacs interface to R.

      To put the current graph in the TeXmacs buffer as an eps use v().

      The functions plotv(), linesv(), and pointsv() are provided as a
      convenience.

      They do the regular function, and then insert the graph.

      \;

      To change the size of the graph that is inserted to TeXmacs,just adjust
      the size of the X11 window.
    </output>

    <\unfolded-io|<\with|color|red>
      \<gtr\>\ 
    </with>>
      qnorm(1/2,mean=0,sd=1)
    <|unfolded-io>
      [1] 0
    </unfolded-io>

    <\input|<\with|color|red>
      \<gtr\>\ 
    </with>>
      x\<less\>-1:100
    </input>

    <\input|<\with|color|red>
      \<gtr\>\ 
    </with>>
      y\<less\>-rnorm(x)
    </input>

    <\input|<\with|color|red>
      \<gtr\>\ 
    </with>>
      plot(x,y)
    </input>

    <\unfolded-io|<\with|color|red>
      \<gtr\>\ 
    </with>>
      v()
    <|unfolded-io>
      <image|<tuple|<#[encoded data, 11948 characters]>|ps>|0.5w|0.5h||>
    </unfolded-io>

    <\input|<\with|color|red>
      \<gtr\>\ 
    </with>>
      plot(x)
    </input>

    <\unfolded-io|<\with|color|red>
      \<gtr\>\ 
    </with>>
      v()
    <|unfolded-io>
      <image|<tuple|<#[encoded data, 11956 characters]>|ps>|0.5w|0.5h||>
    </unfolded-io>

    <\input|<\with|color|red>
      \<gtr\>\ 
    </with>>
      z\<less\>-sort(y)
    </input>

    <\input|<\with|color|red>
      \<gtr\>\ 
    </with>>
      plot(z)
    </input>

    <\unfolded-io|<\with|color|red>
      \<gtr\>\ 
    </with>>
      v()
    <|unfolded-io>
      <image|<tuple|<#[encoded data, 11956 characters]>|ps>|0.5w|0.5h||>
    </unfolded-io>

    <\input|<\with|color|red>
      \<gtr\>\ 
    </with>>
      plot(z,sort(y))
    </input>

    <\unfolded-io|<\with|color|red>
      \<gtr\>\ 
    </with>>
      v()
    <|unfolded-io>
      <image|<tuple|<#[encoded data, 11976 characters]>|ps>|0.5w|0.5h||>
    </unfolded-io>

    <\input|<\with|color|red>
      \<gtr\>\ 
    </with>>
      hist(z)
    </input>

    <\unfolded-io|<\with|color|red>
      \<gtr\>\ 
    </with>>
      v()
    <|unfolded-io>
      <image|<tuple|<#[encoded data, 7588 characters]>|ps>|0.5w|0.5h||>
    </unfolded-io>

    <\unfolded-io|<\with|color|red>
      \<gtr\>\ 
    </with>>
      summary(z)
    <|unfolded-io>
      \ \ \ \ \ Min. \ \ 1st Qu. \ \ \ Median \ \ \ \ \ Mean \ \ 3rd Qu.
      \ \ \ \ \ Max.\ 

      -2.802000 -1.003000 \ 0.007691 -0.040620 \ 0.840500 \ 2.447000\ 
    </unfolded-io>

    <\input|<\with|color|red>
      \<gtr\>\ 
    </with>>
      hist(y,seq(-4,3.5,0.2),prob=TRUE)
    </input>

    <\unfolded-io|<\with|color|red>
      \<gtr\>\ 
    </with>>
      v()
    <|unfolded-io>
      <image|<tuple|<#[encoded data, 9032 characters]>|ps>|0.5w|0.5h||>
    </unfolded-io>

    <\input|<\with|color|red>
      \<gtr\>\ 
    </with>>
      \;
    </input>
  </session>

  <tmdoc-copyright|2003|Chu-Ching Huang|Joris van der Hoeven>

  <tmdoc-license|Permission is granted to copy, distribute and/or modify this
  document under the terms of the GNU Free Documentation License, Version 1.1
  or any later version published by the Free Software Foundation; with no
  Invariant Sections, with no Front-Cover Texts, and with no Back-Cover
  Texts. A copy of the license is included in the section entitled "GNU Free
  Documentation License".>
</body>

<\initial>
  <\collection>
    <associate|language|english>
  </collection>
</initial>