Re: [R] running a .r script and saving the output to a file

2009-07-26 Thread Andrej Kastrin
Check out: http://akastrin.wordpress.com/category/r/ David Riebel wrote: Hello, I am running R under Ubuntu 8.04. I am trying to do numerous linear fits to various subsets of my data set. I am having trouble convincing R to send the output from these fits to text files from within a script. W

Re: [R] running a .r script and saving the output to a file

2009-07-26 Thread jim holtman
You have to explicitly 'print' the output. At the command line there is an implicit 'print'. Try: sink(file="x_seq2_fit.dat") print(summary(x_seq2_fit)) sink() sink(file="x_seq1_fit.dat") print(summary(x_seq1_fit)) sink() On Sun, Jul 26, 2009 at 4:47 PM, David Riebel wrote: > Hello, > > I am ru

Re: [R] running a .r script and saving the output to a file

2009-07-26 Thread Sarah Goslee
Hi Dave, I don't know about using sink(), but if you run your script in batch mode all the output will be saved to a text file foryou. R CMD BATCH infile outfile (at the linux prompt, not from within R). Sarah On Sun, Jul 26, 2009 at 4:47 PM, David Riebel wrote: > Hello, > > I am running R und

Re: [R] running a .r script and saving the output to a file

2009-07-26 Thread David Riebel
Hello, I am running R under Ubuntu 8.04. I am trying to do numerous linear fits to various subsets of my data set. I am having trouble convincing R to send the output from these fits to text files from within a script. When I run my script, all the plots are created as postscript files in the co

Re: [R] running a .r script and saving the output to a file

2009-04-09 Thread David Winsemius
On Apr 9, 2009, at 2:21 PM, Gagan Pabla wrote: I first I saved the following commands in a whatever.r file. data<-read.csv(file="whatever.csv", head=TRUE, sep=",") #this is where you put the first sink: sink("comm.docx") # but it is not going to be in .docx format, but in text format.

[R] running a .r script and saving the output to a file

2009-04-09 Thread Gagan Pabla
I first I saved the following commands in a whatever.r file. data<-read.csv(file="whatever.csv", head=TRUE, sep=",") summary(data$SQFT) hist(data$STAMP) hist(data$STAMP, col='blue') hist(data$SHIP, col='blue') then I clicked File Menu-> source and chose whatever.r, it runs the commands and prod

Re: [R] running a .r script and saving the output to a file

2009-04-09 Thread David Winsemius
If you just entered sink(), it would turn *off* sink-ing. You need to tell R where to write the output that would otherwise go to the console. (Or if you did something like that then you need to tell us exactly what you did try.) ?sink # e.g. sink(file="... /test.txt") with correct path

[R] running a .r script and saving the output to a file

2009-04-09 Thread Gagan Pabla
Hello, I want to run the following commands as a script(.r or .bat) and save the output in an external file through Windows OS. data<-read.csv(file="wgatever.csv", head=TRUE, sep=",") summary(data$SQFT) hist(data$STAMP) hist(data$STAMP, col='blue') hist(data$SHIP, col='blue') How could