On 08.02.2012 20:14, Ron Michael wrote:
Dear all, let say I want to write a vector to a CSV file. So I can have 
following syntax:

write.csv(rnorm(10), "dat.csv")

Now I want to add one more column into that existing file. If I use the same 
code then existing file will be destroyed. Is there any functionality to add 
without destroying the existing file? I have tries with 'append = TRUE' however 
it is not working!

Any suggestion will be highly appreciated.

Since these text files are written line by line, you cannot add a column afterwards, you can just append rows.

Hence read the first column and write a two column data.frame afterwards.

Uwe Ligges


______________________________________________
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.

Reply via email to