Hi,
This is what I did: library(TeachingDemos) txtStart("foo1.txt",commands=TRUE,results=TRUE,append=FALSE) Output being copied to text file, use txtStop to end txt> ave(dta$Range,dta$Lat1,FUN=mean) [1] 616.440 714.360 616.440 690.770 714.360 714.360 690.770 766.155 851.550 [10] 851.550 766.155 txt> txtStop() #Output in "foo1.txt" > ave(dta$Range, dta$Lat1, FUN = mean) [1] 616.440 714.360 616.440 690.770 714.360 714.360 690.770 766.155 851.550 [10] 851.550 766.155 A.K. ________________________________ From: Felipe Carrillo <mazatlanmex...@yahoo.com> To: arun <smartpink...@yahoo.com> Sent: Sunday, December 16, 2012 9:28 PM Subject: Re: [R] save to file My text file is created but its empty. Did you start library(TeachingDemos) txtStart("foo.txt",commands=TRUE,results=TRUE,append=FALSE) on you R.profile to capture the R statement? Felipe D. Carrillo Supervisory Fishery Biologist Department of the Interior US Fish & Wildlife Service California, USA http://www.fws.gov/redbluff/rbdd_jsmp.aspx From: arun <smartpink...@yahoo.com> >To: Felipe Carrillo <mazatlanmex...@yahoo.com> >Sent: Sunday, December 16, 2012 6:16 PM >Subject: Re: [R] save to file > > > >Hi, >If there are comments in your code, you need to ?txtComment() from >library(TeachingDemos). I did a trial run and was able to get the snapshot in >the output file. > >A.K. > > >________________________________ >From: Felipe Carrillo <mazatlanmex...@yahoo.com> >To: arun <smartpink...@yahoo.com> >Sent: Sunday, December 16, 2012 9:13 PM >Subject: Re: [R] save to file > > >I know about sink() and capture.output() but these functions don't capture the >entire console. I basically >want a snapshot of all the text on the R console saved to a file. I am the >users to send me the file so that I can >see where the R crashed. I will check the Teaching Demos. Thanks > >Felipe D. Carrillo >Supervisory Fishery Biologist >Department of the Interior >US Fish & Wildlife Service >California, USA >http://www.fws.gov/redbluff/rbdd_jsmp.aspx > > > >From: arun <smartpink...@yahoo.com> >>To: Felipe Carrillo <mazatlanmex...@yahoo.com> >>Cc: R help <r-help@r-project.org> >>Sent: Sunday, December 16, 2012 6:07 PM >>Subject: Re: [R] save to file >> >>HI, >> >>I guess ?sink() may not work for you as you need the whole R console. >> >>Have you tried library(TeachingDemos) ?txtStart(), ?txtStop() >? >> >>txtStart("foo.txt",commands=TRUE,results=TRUE,append=FALSE) >><codes> >>txtStop() >> >>A.K. >> >> >> >>----- Original Message ----- >>From: Felipe Carrillo <mazatlanmex...@yahoo.com> >>To: "r-h...@stat.math.ethz.ch" <r-h...@stat.math.ethz.ch> >>Cc: >>Sent: Sunday, December 16, 2012 8:30 PM >>Subject: [R] save to file >> >> Hi, >>What's the equivalent of "Save to File" from the R console File menu on an R >>routine? Just trying >>to capture the whole R console into a text file when my code fails. >> >> >> >> >>Felipe D. Carrillo >>Supervisory Fishery Biologist >>Department of the Interior >>US Fish & Wildlife Service >>California, >USA >>http://www.fws.gov/redbluff/rbdd_jsmp.aspx >> >> [[alternative HTML version deleted]] >> >> >>______________________________________________ >>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.