Re: [R] save to file
I actually got it to do what I want running my R routine through a batch file. It saves to a file everything on the console. Thanks for your suggestions. 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: Vivek Singh vksingh.ii...@gmail.com To: David Winsemius dwinsem...@comcast.net Cc: Felipe Carrillo mazatlanmex...@yahoo.com; r-help help r-h...@stat.math.ethz.ch Sent: Sunday, December 16, 2012 11:35 PM Subject: Re: [R] save to file try the following. it works for linux: $ R|tee log.txt I stored the log for a small period. R version 2.15.1 (2012-06-22) -- Roasted Marshmallows Copyright (C) 2012 The R Foundation for Statistical Computing ISBN 3-900051-07-0 Platform: x86_64-pc-linux-gnu (64-bit) R is free software and comes with ABSOLUTELY NO WARRANTY. You are welcome to redistribute it under certain conditions. Type 'license()' or 'licence()' for distribution details. Natural language support but running in an English locale R is a collaborative project with many contributors. Type 'contributors()' for more information and 'citation()' on how to cite R or R packages in publications. Type 'demo()' for some demos, 'help()' for on-line help, or 'help.start()' for an HTML browser interface to help. Type 'q()' to quit R. q() Save workspace image? [y/n/c]: n On Mon, Dec 17, 2012 at 3:23 PM, David Winsemius dwinsem...@comcast.net wrote: On Dec 16, 2012, at 7:35 PM, Felipe Carrillo wrote: Well, I am going to give copies of an application to different offices and want to be able to generate an output file in the event that an error would ocurr while running the different R routines. By saving the entire R console along with the R version, I should be able to see where the error ocurred. I've seen text files with every single text from the R console but can't find the way to capture that. Most consoles will accept cmd-A or similar to select all text in a console session. Figure out what that keystroke combo is for your OS and then ctl- or cmd-C and paste into text editor. -- David Winsemius Alameda, CA, USA __ 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. -- Thanks and Regards, Vivek Kumar Singh Alcatel-Lucent, Bangalore (91)9886317184, 8123951698 [[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] 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.
Re: [R] save to file
I did check that link but it doesn't do what I want..thanks for trying though. 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:55 PM Subject: Re: [R] save to file Hi, sink() gives only the output to be saved in the foo.txt, but txtStart(), txtStop() gets the codes and the output. Sorry, I misunderstood your question. You can also check this link (if you haven't already seen) http://r.789695.n4.nabble.com/Capturing-R-console-output-into-a-file-sink-savehistory-td2227013.html A.K. From: Felipe Carrillo mazatlanmex...@yahoo.com To: arun smartpink...@yahoo.com Sent: Sunday, December 16, 2012 9:47 PM Subject: Re: [R] save to file What you did That's what sink() does but I mean the entire R console screen including the R statement below I just want to be able to capture everything during the R session R version 2.15.0 (2012-03-30) Copyright (C) 2012 The R Foundation for Statistical Computing ISBN 3-900051-07-0 Platform: i386-pc-mingw32/i386 (32-bit) R is free software and comes with ABSOLUTELY NO WARRANTY. You are welcome to redistribute it under certain conditions. Type 'license()' or 'licence()' for distribution details. Natural language support but running in an English locale R is a collaborative project with many contributors. Type 'contributors()' for more information and 'citation()' on how to cite R or R packages in publications. Type 'demo()' for some demos, 'help()' for on-line help, or 'help.start()' for an HTML browser interface to help. Type 'q()' to quit R. 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:37 PM Subject: Re: [R] save to file Hi, I am using Ubuntu 12.04. My sessionInfo() if that helps: sessionInfo() R version 2.15.0 (2012-03-30) Platform: x86_64-pc-linux-gnu (64-bit) locale: [1] LC_CTYPE=en_US.UTF-8 LC_NUMERIC=C [3] LC_TIME=en_US.UTF-8 LC_COLLATE=en_US.UTF-8 [5] LC_MONETARY=en_US.UTF-8 LC_MESSAGES=en_US.UTF-8 [7] LC_PAPER=C LC_NAME=C [9] LC_ADDRESS=C LC_TELEPHONE=C [11] LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C attached base packages: [1] stats graphics grDevices utils datasets methods base other attached packages: [1] TeachingDemos_2.8 stringr_0.6 reshape_0.8.4 plyr_1.7.1 loaded via a namespace (and not attached): [1] tcltk_2.15.0 tools_2.15.0 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
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.
Re: [R] save to file
On 17/12/2012 11:03, Felipe Carrillo wrote: I did check that link but it doesn't do what I want..thanks for trying though. 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:55 PM Subject: Re: [R] save to file Hi, sink() gives only the output to be saved in the foo.txt, but txtStart(), txtStop() gets the codes and the output. Sorry, I misunderstood your question. You can also check this link (if you haven't already seen) http://r.789695.n4.nabble.com/Capturing-R-console-output-into-a-file-sink-savehistory-td2227013.html A.K. From: Felipe Carrillo mazatlanmex...@yahoo.com To: arun smartpink...@yahoo.com Sent: Sunday, December 16, 2012 9:47 PM Subject: Re: [R] save to file What you did That's what sink() does but I mean the entire R console screen including the R statement below I just want to be able to capture everything during the R session R version 2.15.0 (2012-03-30) Copyright (C) 2012 The R Foundation for Statistical Computing ISBN 3-900051-07-0 Platform: i386-pc-mingw32/i386 (32-bit) R is free software and comes with ABSOLUTELY NO WARRANTY. You are welcome to redistribute it under certain conditions. Type 'license()' or 'licence()' for distribution details. Natural language support but running in an English locale R is a collaborative project with many contributors. Type 'contributors()' for more information and 'citation()' on how to cite R or R packages in publications. Type 'demo()' for some demos, 'help()' for on-line help, or 'help.start()' for an HTML browser interface to help. Type 'q()' to quit R. 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:37 PM Subject: Re: [R] save to file Hi, I am using Ubuntu 12.04. My sessionInfo() if that helps: sessionInfo() R version 2.15.0 (2012-03-30) Platform: x86_64-pc-linux-gnu (64-bit) locale: [1] LC_CTYPE=en_US.UTF-8 LC_NUMERIC=C [3] LC_TIME=en_US.UTF-8LC_COLLATE=en_US.UTF-8 [5] LC_MONETARY=en_US.UTF-8LC_MESSAGES=en_US.UTF-8 [7] LC_PAPER=C LC_NAME=C [9] LC_ADDRESS=C LC_TELEPHONE=C [11] LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C attached base packages: [1] stats graphics grDevices utils datasets methods base other attached packages: [1] TeachingDemos_2.8 stringr_0.6 reshape_0.8.4 plyr_1.7.1 loaded via a namespace (and not attached): [1] tcltk_2.15.0 tools_2.15.0 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
Re: [R] save to file
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.
Re: [R] save to file
Well, I am going to give copies of an application to different offices and want to be able to generate an output file in the event that an error would ocurr while running the different R routines. By saving the entire R console along with the R version, I should be able to see where the error ocurred. I've seen text files with every single text from the R console but can't find the way to capture that. 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 7:13 PM Subject: Re: [R] save to file As a workaround, you could copy manually the R statements R version 2.15.0 (2012-03-30)--- Type 'q()' to quit R. and then use txtStart()..txtStop(). Would it work? The reason I am saying is that with 1000s of lines of code, this will be still easier. A.K. From: Felipe Carrillo mazatlanmex...@yahoo.com To: arun smartpink...@yahoo.com; r-h...@stat.math.ethz.ch r-h...@stat.math.ethz.ch Sent: Sunday, December 16, 2012 10:03 PM Subject: Re: [R] save to file I did check that link but it doesn't do what I want..thanks for trying though. 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:55 PM Subject: Re: [R] save to file Hi, sink() gives only the output to be saved in the foo.txt, but txtStart(), txtStop() gets the codes and the output. Sorry, I misunderstood your question. You can also check this link (if you haven't already seen) http://r.789695.n4.nabble.com/Capturing-R-console-output-into-a-file-sink-savehistory-td2227013.html A.K. From: Felipe Carrillo mazatlanmex...@yahoo.com To: arun smartpink...@yahoo.com Sent: Sunday, December 16, 2012 9:47 PM Subject: Re: [R] save to file What you did That's what sink() does but I mean the entire R console screen including the R statement below I just want to be able to capture everything during the R session R version 2.15.0 (2012-03-30) Copyright (C) 2012 The R Foundation for Statistical Computing ISBN 3-900051-07-0 Platform: i386-pc-mingw32/i386 (32-bit) R is free software and comes with ABSOLUTELY NO WARRANTY. You are welcome to redistribute it under certain conditions. Type 'license()' or 'licence()' for distribution details. Natural language support but running in an English locale R is a collaborative project with many contributors. Type 'contributors()' for more information and 'citation()' on how to cite R or R packages in publications. Type 'demo()' for some demos, 'help()' for on-line help, or 'help.start()' for an HTML browser interface to help. Type 'q()' to quit R. 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:37 PM Subject: Re: [R] save to file Hi, I am using Ubuntu 12.04. My sessionInfo() if that helps: sessionInfo() R version 2.15.0 (2012-03-30) Platform: x86_64-pc-linux-gnu (64-bit) locale: [1] LC_CTYPE=en_US.UTF-8 LC_NUMERIC=C [3] LC_TIME=en_US.UTF-8 LC_COLLATE=en_US.UTF-8 [5] LC_MONETARY=en_US.UTF-8 LC_MESSAGES=en_US.UTF-8 [7] LC_PAPER=C LC_NAME=C [9] LC_ADDRESS=C LC_TELEPHONE=C [11] LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C attached base packages: [1] stats graphics grDevices utils datasets methods base other attached packages: [1] TeachingDemos_2.8 stringr_0.6 reshape_0.8.4 plyr_1.7.1 loaded via a namespace (and not attached): [1] tcltk_2.15.0 tools_2.15.0 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
Re: [R] save to file
On Dec 16, 2012, at 7:35 PM, Felipe Carrillo wrote: Well, I am going to give copies of an application to different offices and want to be able to generate an output file in the event that an error would ocurr while running the different R routines. By saving the entire R console along with the R version, I should be able to see where the error ocurred. I've seen text files with every single text from the R console but can't find the way to capture that. Most consoles will accept cmd-A or similar to select all text in a console session. Figure out what that keystroke combo is for your OS and then ctl- or cmd-C and paste into text editor. -- David Winsemius Alameda, CA, USA __ 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.
Re: [R] save to file
try the following. it works for linux: $ R|tee log.txt I stored the log for a small period. *R version 2.15.1 (2012-06-22) -- Roasted Marshmallows Copyright (C) 2012 The R Foundation for Statistical Computing ISBN 3-900051-07-0 Platform: x86_64-pc-linux-gnu (64-bit) R is free software and comes with ABSOLUTELY NO WARRANTY. You are welcome to redistribute it under certain conditions. Type 'license()' or 'licence()' for distribution details. Natural language support but running in an English locale R is a collaborative project with many contributors. Type 'contributors()' for more information and 'citation()' on how to cite R or R packages in publications. Type 'demo()' for some demos, 'help()' for on-line help, or 'help.start()' for an HTML browser interface to help. Type 'q()' to quit R. q() Save workspace image? [y/n/c]: n* On Mon, Dec 17, 2012 at 3:23 PM, David Winsemius dwinsem...@comcast.netwrote: On Dec 16, 2012, at 7:35 PM, Felipe Carrillo wrote: Well, I am going to give copies of an application to different offices and want to be able to generate an output file in the event that an error would ocurr while running the different R routines. By saving the entire R console along with the R version, I should be able to see where the error ocurred. I've seen text files with every single text from the R console but can't find the way to capture that. Most consoles will accept cmd-A or similar to select all text in a console session. Figure out what that keystroke combo is for your OS and then ctl- or cmd-C and paste into text editor. -- David Winsemius Alameda, CA, USA __ 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. -- Thanks and Regards, Vivek Kumar Singh Alcatel-Lucent, Bangalore (91)9886317184, 8123951698 [[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.
Re: [R] save-d file format forward compatibility
Godfrey van der Linden wrote: G'day, All. I've recently started writing up my dissertation and need to consider how to store the research results. I'd like to use the binary compressed save() format as it is considerably smaller than the raw data. However, will a future R be able to read it into the indefinite future or would I be better off just compressing the text data files? The doc says: All R platforms use the XDR (bigendian) representation of C ints and doubles in binary save-d files, and these are portable across all R platforms. (ASCII saves used to be useful for moving data between platforms but are now mainly of historical interest.) The format is well known and platform agnostic, both excellent properties, but will I be able to read the data into a more modern version of R into the foreseeable future? Yes, that's the intention. It can sometimes go wrong: e.g. if you have an S4 object you'll likely need to have a compatible version of the package installed when you load the object again. But for simple data types there will be no problem. Duncan Murdoch __ 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] save-d file format forward compatibility
G'day, All. I've recently started writing up my dissertation and need to consider how to store the research results. I'd like to use the binary compressed save() format as it is considerably smaller than the raw data. However, will a future R be able to read it into the indefinite future or would I be better off just compressing the text data files? The doc says: All R platforms use the XDR (bigendian) representation of C ints and doubles in binary save-d files, and these are portable across all R platforms. (ASCII saves used to be useful for moving data between platforms but are now mainly of historical interest.) The format is well known and platform agnostic, both excellent properties, but will I be able to read the data into a more modern version of R into the foreseeable future? Thanks Godfrey __ 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] save txt file
Hi, I have 2 questions: Question 1: I define 2 variables: a, b: a-rbinom(4,10,0.8) output: [1] 9 7 8 8 b-rbinom(2,6,0.7) output: [1] 4 5 if I write: write.table(a, file = filename, etc. etc. ) it save only the values of variable a. There is a way to save in a .txt file the values a and b as consecutive data? (but I would use many variables..) ..like this: 9 7 8 8 4 5 Question 2: is possible save data as rows? (9 7 8 8 4 5) thank's Eiger -- View this message in context: http://www.nabble.com/save-txt-file-tp25531307p25531307.html Sent from the R help mailing list archive at Nabble.com. __ 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.
Re: [R] save txt file
any r manual helps here, and there are many easy ways to do it. ?cbind ?matrix ?data.frame If you need it in rows, matrix transposition helps, or add the byrow argument when using the matrix function (or by.row; I don't remember from the top of my head). ?dim could also do the job if you make one vector out of a and b. Best, Daniel - cuncta stricte discussurus - -Ursprüngliche Nachricht- Von: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] Im Auftrag von Eiger Gesendet: Wednesday, September 23, 2009 5:37 PM An: r-help@r-project.org Betreff: [R] save txt file Hi, I have 2 questions: Question 1: I define 2 variables: a, b: a-rbinom(4,10,0.8) output: [1] 9 7 8 8 b-rbinom(2,6,0.7) output: [1] 4 5 if I write: write.table(a, file = filename, etc. etc. ) it save only the values of variable a. There is a way to save in a .txt file the values a and b as consecutive data? (but I would use many variables..) ..like this: 9 7 8 8 4 5 Question 2: is possible save data as rows? (9 7 8 8 4 5) thank's Eiger -- View this message in context: http://www.nabble.com/save-txt-file-tp25531307p25531307.html Sent from the R help mailing list archive at Nabble.com. __ 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.
Re: [R] save txt file
cls59 wrote: Hope this helps! -Charlie Thanks!!! :) -- View this message in context: http://www.nabble.com/save-data-in-a-txt-file-tp25531307p25554140.html Sent from the R help mailing list archive at Nabble.com. __ 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.
Re: [R] save txt file
a-rbinom(4,10,0.8) b-rbinom(2,6,0.7) # See ?write.table for many options write.table(t(a), file=D:/myfile.txt) # t() to give row of data. write.table(t(b), file=D:/myfile.txt, append=TRUE) --- On Wed, 9/23/09, Eiger c...@hotmail.it wrote: From: Eiger c...@hotmail.it Subject: [R] save txt file To: r-help@r-project.org Received: Wednesday, September 23, 2009, 5:37 PM Hi, I have 2 questions: Question 1: I define 2 variables: a, b: a-rbinom(4,10,0.8) output: [1] 9 7 8 8 b-rbinom(2,6,0.7) output: [1] 4 5 if I write: write.table(a, file = filename, etc. etc. ) it save only the values of variable a. There is a way to save in a .txt file the values a and b as consecutive data? (but I would use many variables..) ..like this: 9 7 8 8 4 5 Question 2: is possible save data as rows? (9 7 8 8 4 5) thank's Eiger -- View this message in context: http://www.nabble.com/save-txt-file-tp25531307p25531307.html Sent from the R help mailing list archive at Nabble.com. __ 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. __ The new Internet Explorer® 8 - Faster, safer, easier. Optimized for Yahoo! __ 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.
Re: [R] save txt file
Eiger wrote: Hi, I have 2 questions: Question 1: I define 2 variables: a, b: a-rbinom(4,10,0.8) output: [1] 9 7 8 8 b-rbinom(2,6,0.7) output: [1] 4 5 if I write: write.table(a, file = filename, etc. etc. ) it save only the values of variable a. There is a way to save in a .txt file the values a and b as consecutive data? (but I would use many variables..) ..like this: 9 7 8 8 4 5 Question 2: is possible save data as rows? (9 7 8 8 4 5) thank's Eiger Assuming you are dealing with vectors of numbers, you can form a row of data using the append function to stick b onto the end of a: append( a, b ) [1] 9 7 8 8 4 5 This can be dumped to a file using write.table: write.table( t( append(a,b) ), 'test.txt', row.names=F, col.names=F, append=T ) The transpose function t() is used because write.table() assumes a singleton vector is a column vector and you want row vectors. If you have two matrices instead of vectors, say: matA - matrix( rep(a,4), nrow=4, byrow=T ) matB - matrix( rep(b,4), nrow=4, byrow=T ) Then you would use the cbind() function instead of the append() function to form your rows and drop the transpose function: write.table( cbind(a,b), 'test.txt', row.names=F, col.names=F, append=T ) If you want to overwrite (i.e. start a new file) when you use write.table, then drop the append=T. Hope this helps! -Charlie - Charlie Sharpsteen Undergraduate Environmental Resources Engineering Humboldt State University -- View this message in context: http://www.nabble.com/save-txt-file-tp25531307p25531324.html Sent from the R help mailing list archive at Nabble.com. __ 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] save to file
Hi, I am new to R. I am using spatstat package to generate some sample points but don't know how to save the result to file. Could anyone please give me some instructions? Thanks I generate some random point data by using: pp-runifpoint(100) I can plot it out with plot(pp) I suppose that pp contains x and y. How can I save these x, y pairs to file that has following format? x1,y1 x2,y2 ... ... ... Thanks again Steve _ Get Free (PRODUCT) RED Emoticons, Winks and Display Pics. [[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.
Re: [R] save to file
On 09/05/2008 5:55 PM, mtrp mtrp wrote: Hi, I am new to R. I am using spatstat package to generate some sample points but don't know how to save the result to file. Could anyone please give me some instructions? Thanks I generate some random point data by using: pp-runifpoint(100) I can plot it out with plot(pp) I suppose that pp contains x and y. How can I save these x, y pairs to file that has following format? x1,y1 x2,y2 ... write.csv(cbind(pp$x, pp$y), file=my.file) should do it. Duncan Murdoch __ 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] Save to File... option on File menu
Hi. There was an interesting thread about a year ago, called 'Command equivalent of rgui File, Save to File?' (http://tolstoy.newcastle.edu.au/R/e2/help/06/09/0553.html) started by Michael Prager, and contributed to by Duncan Murdoch (I didn't notice anything beyond the four entries they posted). The question was how to replicate programmatically the Save to File... option on the File menu. The closest answers given involved either running in batch or using the sink() command. Perhaps I don't understand the sink() command well enough, but it appears to me that you have to set it up before you run commands, and that it can't be used to save command output from commands that were already run; am I right about this? Whereas the Save to File... command scoops up everything that's still in the console. Here is my problem. I am running R on Linux in a VNC window. I'd like to save my console output, but there doesn't appear to be a File menu available and I didn't start out with the sink() command. Is there any way to replicate Save to File... in this situation? Thanks! -- TMK -- 212-460-5430home 917-656-5351cell __ 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.
Re: [R] Save to File... option on File menu
Hi Talbot, I just had that question a couple of weeks ago. Here's the thread: RSiteSearch(Saving results from Linux command line) Thomas Lumley concluded with: There could still be functions that divert a copy of all the output to a file, for example. And indeed there are. sink(transcript.txt, split=TRUE) And you're right, you do this at the start, or put it in your .Rprofile so you don't have to remember it each time. The UNIX tee command does this as well. Cheers, Bob = Bob Muenchen (pronounced Min'-chen), Manager Statistical Consulting Center U of TN Office of Information Technology 200 Stokely Management Center, Knoxville, TN 37996-0520 Voice: (865) 974-5230 FAX: (865) 974-4810 Email: [EMAIL PROTECTED] Web: http://oit.utk.edu/scc, News: http://listserv.utk.edu/archives/statnews.html = -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] project.org] On Behalf Of Talbot Katz Sent: Wednesday, September 12, 2007 3:05 PM To: [EMAIL PROTECTED] Subject: [R] Save to File... option on File menu Hi. There was an interesting thread about a year ago, called 'Command equivalent of rgui File, Save to File?' (http://tolstoy.newcastle.edu.au/R/e2/help/06/09/0553.html) started by Michael Prager, and contributed to by Duncan Murdoch (I didn't notice anything beyond the four entries they posted). The question was how to replicate programmatically the Save to File... option on the File menu. The closest answers given involved either running in batch or using the sink() command. Perhaps I don't understand the sink() command well enough, but it appears to me that you have to set it up before you run commands, and that it can't be used to save command output from commands that were already run; am I right about this? Whereas the Save to File... command scoops up everything that's still in the console. Here is my problem. I am running R on Linux in a VNC window. I'd like to save my console output, but there doesn't appear to be a File menu available and I didn't start out with the sink() command. Is there any way to replicate Save to File... in this situation? Thanks! -- TMK -- 212-460-5430 home 917-656-5351 cell __ 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.