I have a problem with the export of a simulated matrix (nrow=1000, ncol=492). I want to obtain a .txt file with fixed format data (five character for example). I've tried to use the instructions: options(digits=5) followed by write.table(...), but the .txt file reports always the data with different lenght, whereas the matrix in R gives right result (i.e. the elements have the same lenght). Could you help me? Thanks Andrea Toreti [[alternative HTML version deleted]]
One way is to use the sprintf-function which returns strings, and then write these strings in a file. But it is kludgy and there must be better ways... Best S?ren> -----Oprindelig meddelelse----- > Fra: r-help-bounces at stat.math.ethz.ch > [mailto:r-help-bounces at stat.math.ethz.ch] P? vegne af Andrea Toreti > Sendt: 8. maj 2006 12:26 > Til: R > Emne: [R] export > > I have a problem with the export of a simulated matrix > (nrow=1000, ncol=492). I want to obtain a .txt file with > fixed format data (five character for example). > I've tried to use the instructions: options(digits=5) > followed by write.table(...), but the .txt file reports > always the data with different lenght, whereas the matrix in > R gives right result (i.e. the elements have the same lenght). > > Could you help me? > > Thanks > > Andrea Toreti > [[alternative HTML version deleted]] > > ______________________________________________ > R-help at stat.math.ethz.ch mailing list > stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide! > R-project.org/posting-guide.html >