Is there an R function that automatically writes all input and output to a file? I would at least like it to log all the commands I enter, and to preferably also write the standard output to the file as well as to the screen. (The ideal would be to write the input to one file and both the input and output to another file.) I tried R2HTML for this, but I could not get it to work consistently. I am using a UNIX version of R:> version_ platform powerpc-apple-darwin6.6 arch powerpc os darwin6.6 system powerpc, darwin6.6 status Patched major 1 minor 7.1 year 2003 month 06 day 21 language R Thanks, David _______________________________________ http://www.mcg.edu/research/biostat/bickel.html David R. Bickel, Assistant Professor Medical College of Georgia Office of Biostatistics and Bioinformatics (706) 721-4697, 721-3785; Fax: 721-6294 dbickel at mcg.edu or bickel at prueba.info
All commands are logged in the history file, if your `UNIX' (is that really a certified UNIX?) version of R supports history files. See e.g. ?savehistory. On Thu, 21 Aug 2003, David R. Bickel wrote:> Is there an R function that automatically writes all input and output to a > file? I would at least like it to log all the commands I enter, and to > preferably also write the standard output to the file as well as to the > screen. (The ideal would be to write the input to one file and both the > input and output to another file.) I tried R2HTML for this, but I could not > get it to work consistently. > > I am using a UNIX version of R: > > version > _ > platform powerpc-apple-darwin6.6 > arch powerpc > os darwin6.6 > system powerpc, darwin6.6 > status Patched > major 1 > minor 7.1 > year 2003 > month 06 > day 21 > language R-- Brian D. Ripley, ripley at stats.ox.ac.uk Professor of Applied Statistics, http://www.stats.ox.ac.uk/~ripley/ University of Oxford, Tel: +44 1865 272861 (self) 1 South Parks Road, +44 1865 272866 (PA) Oxford OX1 3TG, UK Fax: +44 1865 272595
>>>>> "BDR" == Prof Brian Ripley <ripley at stats.ox.ac.uk> >>>>> on Thu, 21 Aug 2003 20:36:24 +0100 (BST) writes:BDR> On Thu, 21 Aug 2003, David R. Bickel wrote: >> The piping UNIX command that I just suggested is better >> than nothing, but writes backspaces or other invisible >> characters to the file, sometimes in place of characters >> that were visible on the screen. BDR> Under actual UNIX, that is not so: the characters in BDR> the file are those sent to the terminal. Perhaps your BDR> terminal does things you do not expect. BDR> Many decent UNIX terminal windows allow you to save BDR> their contents, BTW. >> Some kind of R command that writes everything that >> appears on the screen to a file would be better. BDR> You can always contribute one (see the R startup BDR> banner). Not that I think this is the job of a BDR> statistics package under UNIX, when other tools exist: BDR> you might also like to investigate ESS under Emacs, BDR> which can I believe do what you want. Definitely. Just write the *R* buffer to a file (C-x C-w) even continuing using it. "Use ESS!" would have been my answer to the original question. Martin Maechler <maechler at stat.math.ethz.ch> http://stat.ethz.ch/~maechler/ Seminar fuer Statistik, ETH-Zentrum LEO C16 Leonhardstr. 27 ETH (Federal Inst. Technology) 8092 Zurich SWITZERLAND phone: x-41-1-632-3408 fax: ...-1228 <><