Re: [R] Output Data Formatting Question

2009-03-13 Thread jim holtman
I don't know why sprintf does not work for you. Here is something close; you will have to work on the spacing but the formating in sprintf lets you specify the field size: > sprintf("%2s %-20s%6d%14.5f", "7", "WORD", 5550, 3.14158) [1] " 7 WORD 5550 3.14158" > On Fri, Mar

[R] Output Data Formatting Question

2009-03-13 Thread Jason Rupert
Within R I need to reformat my data so that the output looks like the following: " 7 WORDS 5550 3.14159 -6. 6." Previous folks were doing this by hand, but I would like to have a formula do it. That is, (a) 7 (place holder) on second column, then a spac