[R] write out data in format

From: Yuandan Zhang <yzhang4_at_une.edu.au>
Date: Thu 05 Jan 2006 - 09:07:09 EST


Hi,
how to write out data frame in format? for examples, I wrote out a data using 'write.table(siredata, file='siredata.txt', row.names=F, quote=F)'.

it produced data alike this:

2882 1 0 0 0 0 L1600481991910012 L1600011988880196

2883 0.79 0.21 0 0 21 L1622881993930001 L1600481991910012
2884 0.84 0.16 0 0 23 L1622881993930005 L1600481991910012
2885 0.9 0.1 0 0 23 L1622881993930027 L1600481991910012
2886 0.87 0.13 0 0 23 L1622881993930038 L1600481991910012
2887 0.9 0.1 0 0 27 L1622881993930111 L1600481991910012
2888 0.81 0.19 0 0 22 L1622881993930113 L1600481991910012

In fact i want it formated as

2882 1.00 0.00 0.00 0.00  0 L1600481991910012 L1600011988880196
2883 0.79 0.21 0.00 0.00 21 L1622881993930001 L1600481991910012
2884 0.84 0.16 0.00 0.00 23 L1622881993930005 L1600481991910012
2885 0.90 0.10 0.00 0.00 23 L1622881993930027 L1600481991910012
2886 0.87 0.13 0.00 0.00 23 L1622881993930038 L1600481991910012
2887 0.90 0.10 0.00 0.00 27 L1622881993930111 L1600481991910012
2888 0.81 0.19 0.00 0.00 22 L1622881993930113 L1600481991910012

Thanks for your help

Yuandan



R-help@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 Received on Thu Jan 05 09:44:23 2006

This archive was generated by hypermail 2.1.8 : Fri 03 Mar 2006 - 03:41:50 EST