[R] write.table & csv help

Uwe Ligges ligges at statistik.uni-dortmund.de
Tue Jun 27 11:33:24 CEST 2006


Sachin J wrote:
> Hi,
>    
>   How can I produce the following output in .csv format using write.table function.
>    
>   for(i in seq(1:2))
>
>  df <- rnorm(4, mean=0, sd=1)
>  write.table(df,"C:/output.csv", append = TRUE, quote = FALSE, sep = ",", row.names = FALSE, col.names = TRUE)
> }


You cannot append columns with write.table().

Uwe Ligges






>   Current O/p:
>               x    0.287816    -0.81803    -0.15231    -0.25849    x    2.26831    0.863174    0.269914    0.181486
>   
> Desired output
>               x1  x2    0.287816  2.26831    -0.81803  0.863174    -0.15231  0.269914    -0.25849  0.181486
>    
>   Thanx in advance
>    
>   Sachin
> 
>  		
> ---------------------------------
> 
> 	[[alternative HTML version deleted]]
> 
> ______________________________________________
> R-help at stat.math.ethz.ch mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html



More information about the R-help mailing list