Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>You write that</p> <blockquote> <p>one of the things that's always frustrated me is that I can't simply copy commands and output from R and paste them into another R session.</p> </blockquote> <p>and I presume you are on Windows with the standard R Windows binary. I fear that what you have in mind may just not be doable. But because what you want to do is actually very desirable, people have done in a different way. From the <a href="http://ess.r-project.org" rel="nofollow noreferrer">ESS</a> manual:</p> <blockquote> <h1>5 Manipulating saved transcript files</h1> <p>Inferior S mode records the transcript (the list of all commands executed, and their output) in the process buffer, which can be saved as a "transcript file", which should normally have the suffix `.St'. The most obvious use for a transcript file is as a static record of the actions you have performed in a particular S session. Sometimes, however, you may wish to re-execute commands recorded in the transcript file by submitting them to a running ESS process. This is what Transcript Mode is for.</p> <p>If you load file a with the suffix `.St' into Emacs, it is placed in S Transcript Mode. [...]</p> </blockquote> <p>Switching to Emacs/ESS may however not be compatible with your students. So for directly copying and pasting, your best bet may just be to wrap expressions into <code>dput()</code> first:</p> <pre><code>R&gt; set.seed(42) R&gt; x &lt;- rnorm(10) R&gt; x [1] 1.37096 -0.56470 0.36313 0.63286 0.40427 -0.10612 1.51152 -0.09466 2.01842 -0.06271 R&gt; dput(x) c(1.37095844714667, -0.564698171396089, 0.363128411337339, 0.63286260496104, 0.404268323140999, -0.106124516091484, 1.51152199743894, -0.0946590384130976, 2.01842371387704, -0.062714099052421) R&gt; </code></pre> <p>The last expression can be cut and pasted back to R.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload