thx a lot Jim. sprintf solved my problem.

Ray


On Mon, Jan 3, 2011 at 3:40 PM, jim holtman <[email protected]> wrote:
> 'sprintf' if your friend:
>
>> dummy3 = c(1.1, 2.2, 3.3)
>> dummy4 = c(4.4, 5.5, 6.6, 7.7)
>> dummy2 = c(8.8, 9.9)
>>
>> cat(sprintf("%5.1f%6.2f%7.3f\n", dummy3[1], dummy3[2], dummy3[3]))
>  1.1  2.20  3.300
>> cat(sprintf("%5.2f%6.3f%7.4f%8.5f\n", dummy4[1], dummy4[2], dummy4[3], 
>> dummy4[4]))
>  4.40 5.500 6.6000 7.70000
>> cat(sprintf("%5.3f%6.4f\n", dummy2[1], dummy2[2]))
> 8.8009.9000
>>
>>
>

______________________________________________
[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
and provide commented, minimal, self-contained, reproducible code.

Reply via email to