Look at the txtStart function in the TeachingDemos package. It (and related functions) can be used as a glorified sink that will save both a copy of the command issued (possibly reformatted) and the results (assuming the command runs without error).
Hope this helps, -- Gregory (Greg) L. Snow Ph.D. Statistical Data Center Intermountain Healthcare greg.s...@imail.org 801.408.8111 > -----Original Message----- > From: r-help-boun...@r-project.org [mailto:r-help-boun...@r- > project.org] On Behalf Of Nobuaki Michihata > Sent: Tuesday, September 14, 2010 8:34 AM > To: r-help@r-project.org > Subject: Re: [R] Can I save my console contents automatically? > > Dear All, > I found a following solution from "http://r.789695.n4.nabble.com/". > However this command can save only the result. > Is there any good solution to save both commands themselves and the > results. > Thank you for your help. > > sink("Filename_here.log", type=c("output","message"), split=TRUE) > > # Put commands here > # However this method save only the results. > > sink() > > Nobu > > > Message: 33 > > Date: Fri, 10 Sep 2010 07:07:37 -0700 > > From: Nobuaki Michihata <gha10...@gmail.com> > > To: r-help@r-project.org, r-help@r-project.org > > Subject: [R] Can I save my console contents automatically? > > Message-ID: > > <aanlktimez-igqk6gzeyqerzatg7m+chjbgjmagmel...@mail.gmail.com> > > Content-Type: text/plain; charset=ISO-8859-1 > > > > Dear All, > > > > I'm using R for Mac OS X Cocoa GUI R version 2.11.1. > > I can save contents of my console window by using "command + s", but > I > > would like to do same thing using R commands. > > My question is can I save the contents automatically by using R > editor > > with some R commands. > > > > Thank you. > > Nobu > > ______________________________________________ > R-help@r-project.org mailing list > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide http://www.R-project.org/posting- > guide.html > and provide commented, minimal, self-contained, reproducible code. ______________________________________________ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.