Re: [R] Rounding and printing

2009-10-29 Thread David Winsemius
On Oct 29, 2009, at 12:29 PM, Alan Cohen wrote: Hello, I am trying to print a table with numbers all rounded to the same number of digits (one after the decimal), but R seems to want to not print ".0" for integers. I can go in and fix it one number at a time, but I'd like to understand

Re: [R] Rounding and printing

2009-10-29 Thread Karl Ove Hufthammer
On Thu, 29 Oct 2009 12:29:42 -0400 Alan Cohen wrote: > I am trying to print a table with numbers all rounded to the same > number of digits (one after the decimal), but R seems to want to not > print ".0" for integers. 'round' only rounds numbers; it doesn't format them. Use 'formatC' instead

[R] Rounding and printing

2009-10-29 Thread Alan Cohen
Hello, I am trying to print a table with numbers all rounded to the same number of digits (one after the decimal), but R seems to want to not print ".0" for integers. I can go in and fix it one number at a time, but I'd like to understand the principle. Here's an example of the code. The pro