On 14/04/2009 7:28 PM, Vemuri, Aparna wrote:
Is there a way to handle the widths of values being written to a file
using wrtite.fwf() ?

For example, I used read.fwf(file, width.vector) to read a file. After
making the necessary data manipulation, I want to write the data to a
new file in the same width.vector format. Is there a way to specify
this?

There is no write.fwf function, but you can use sprintf() to convert things to strings and writeLines to write those strings. There's a lot of flexibility in the formats allowed; see the man page.

Duncan Murdoch

______________________________________________
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