Hi S-news readers,
I've been trying to use the round() function along the key() function to
display regression coefficients in the legend for a plot. I'd like to
make sure that all the numbers are formatted to 3 decimal places so that
the numbers all line up in the legend columns. Unfortunately, the
round() function does not do what I thought it would do (or at least not
what I'd like it to do). For example:
> round(2,3)
[1] 2 # what I'd like is 2.000
> round(2.0202,3)
[1] 2.02 # what I'd like printed is 2.020
I've also tried usin the format() function -- also without success. How
do I force the S-PLUS to print the numbers with the 3 decimal places
(including a trailing zero if need be) so that my number will line up in
my legend?
Thanks.
-Paul
Paul Schwarz
Department of Natural Resources
Cornell University
Fernow Hall
Ithaca, New York 14853-3001
-----------------------------------------------------------------------
This message was distributed by s-news@wubios.wustl.edu. To unsubscribe
send e-mail to s-news-request@wubios.wustl.edu with the BODY of the
message: unsubscribe s-news
|