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)
}
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]]
______________________________________________
[email protected] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html