Re: [R] writing/appending a text file

From: jim holtman <jholtman_at_gmail.com>
Date: Fri, 22 Apr 2011 11:09:40 -0400

Collect the results in an object via 'cbind' and then write out the results at the end of the test. You did not mention how large these vectors were. You can 'append' to the end of the file, but you can not add more columns to an existing file without reading it in, 'cbind'ing and the writing it out. So it depends on how large your result will be and if you have to use a relational database if it is going to be several millions of rows. A little more specificity would be good; numbers always make it easier to understand the problem you are trying to solve.

On Fri, Apr 22, 2011 at 8:40 AM, PBFrance <peter.banton_at_univmed.fr> wrote:
> Hello
>
> I'm fairly new to R. I have a script which produces a 1-column vector
> (numeric). I can write it to a text file using the write command. What I
> want to do is to run the script a number of times on different input files,
> producing a different 1-column vector each time and save all the vectors to
> a text file so that each vector is one separate column in the text file. I
> had thought of appending each new vector as a new column in the unique text
> file, but I don't know if this is possible.
>
> At the moment, it looks like I will have to create a separate text file each
> time I run the script.
>
> --
> View this message in context: http://r.789695.n4.nabble.com/writing-appending-a-text-file-tp3467882p3467882.html
> Sent from the R help mailing list archive at Nabble.com.
>
> ______________________________________________
> R-help_at_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.
>

-- 
Jim Holtman
Data Munger Guru

What is the problem that you are trying to solve?

______________________________________________
R-help_at_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.
Received on Fri 22 Apr 2011 - 15:12:07 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Fri 22 Apr 2011 - 16:20:32 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.

list of date sections of archive