R-Users I know sink("filename") will export my results to a file but how do I export both commands and results in R? Jeff [[alternative HTML version deleted]]
Perhaps knitr (http://yihui.name/knitr/)? John Kane Kingston ON Canada> -----Original Message----- > From: reichmanj at sbcglobal.net > Sent: Fri, 18 Mar 2016 17:00:00 -0500 > To: r-help at r-project.org > Subject: [R] Exporting Commands and Results > > R-Users > > > > I know sink("filename") will export my results to a file but how do I > export > both commands and results in R? > > > > Jeff > > > [[alternative HTML version deleted]] > > ______________________________________________ > R-help at r-project.org mailing list -- To UNSUBSCRIBE and more, see > 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.____________________________________________________________ FREE 3D EARTH SCREENSAVER - Watch the Earth right on your desktop!
?savehistory may also be relevant, depending on what you wish to do and how hard you want to work. Cheers, Bert Bert Gunter "The trouble with having an open mind is that people keep coming along and sticking things into it." -- Opus (aka Berkeley Breathed in his "Bloom County" comic strip ) On Fri, Mar 18, 2016 at 3:00 PM, Jeff Reichman <reichmanj at sbcglobal.net> wrote:> R-Users > > > > I know sink("filename") will export my results to a file but how do I export > both commands and results in R? > > > > Jeff > > > [[alternative HTML version deleted]] > > ______________________________________________ > R-help at r-project.org mailing list -- To UNSUBSCRIBE and more, see > 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.
You may want to try sink(filename, split=TRUE). If you have particularly lengthy commands that you wish to save, you can run your syntax file using source(filename, echo=TRUE, max.deparse.length=Inf) to keep R from truncating the commands. On Mar 19, 2016 10:59 AM, "Bert Gunter" <bgunter.4567 at gmail.com> wrote:> ?savehistory > > may also be relevant, depending on what you wish to do and how hard > you want to work. > > Cheers, > Bert > > > Bert Gunter > > "The trouble with having an open mind is that people keep coming along > and sticking things into it." > -- Opus (aka Berkeley Breathed in his "Bloom County" comic strip ) > > > On Fri, Mar 18, 2016 at 3:00 PM, Jeff Reichman <reichmanj at sbcglobal.net> > wrote: > > R-Users > > > > > > > > I know sink("filename") will export my results to a file but how do I > export > > both commands and results in R? > > > > > > > > Jeff > > > > > > [[alternative HTML version deleted]] > > > > ______________________________________________ > > R-help at r-project.org mailing list -- To UNSUBSCRIBE and more, see > > 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 at r-project.org mailing list -- To UNSUBSCRIBE and more, see > 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. >[[alternative HTML version deleted]]