Skip to content

Save/Display R Work

3 messages · Ko-Kang Kevin Wang, Brian Ripley, Michael A. Miller

#
Hi,

I was tutoring in the lab when a student asked me this question.

Is it possible to save the work done in R, then source it back in AND
display all the work within R later?  I know that one can save the history
(i.e. all the codes in a session) in *.R format, then source it back in at
a later stage.  However the historical codes will not be displayed within
R, only the line source(...) is displayed.

I suggested the student to use notepad (or equivalent) to do the
codes.  However I'm interested to know if there are ways to display the
history (method other than Display File under the File menu) in R (Windows
version).

Thanks,

Ko-Kang Wang

------------------------------------------------------------------------------
Ko-Kang Kevin Wang
Statistical Analysis Division Leader
Software Developers' Klub (SDK)
University of Auckland
New Zealand

-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
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
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
#
On Wed, 19 Sep 2001, Ko-Kang Kevin Wang wrote:

            
Effectively the same thing is done by the history() command (all versions
which can save the history, which is all but Unix without readline, AFAIK).
#
> Is it possible to save the work done in R, then source it
    > back in AND display all the work within R later?  I know
    > that one can save the history (i.e. all the codes in a
    > session) in *.R format, then source it back in at a later
    > stage.  However the historical codes will not be displayed
    > within R, only the line source(...) is displayed.

If you give source the argument echo=T, the source'd code will be
displayed.
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
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
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._