[6387] in s-news-athena

home help back first fref pref prev next nref lref last post

signif()

daemon@ATHENA.MIT.EDU (Greg Unrau)
Fri Feb 3 16:21:24 1995

From: Greg Unrau <gregu@ocgy.ubc.ca>
To: S-news@stat.wisc.edu (spluslist)
Date: Fri, 3 Feb 1995 13:00:46 -0800 (PST)

I wish to figure out how to include zeros when using signif() and round().
Here's what I mean. Let's say I have vector fish_c(11.02,32.34,46.78,45.44) and
I want to plot these values on a figure using text(). So this is what I
supply to the function:

text(x,y,labels=signif(round(fish,1),3))

This *should* result in the following values plotted:

"11.0","32.3","46.8","45.4"

However Splus thinks I don't care about the .0 on the 11.0 and cuts it off
so that I get:

"11","32.3","46.8","45.4"

Isn't signif() supposed to retain the number of sigfigs you give it regardless
of zeros. Help!
-- 
|~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|    
|  Greg Unrau                           |     |\  (__)                    | 
|  Atmospheric Science Programme,       |     | \ (oo)  "What sea-cows    |
|  University of British Columbia       |  /-------\/   really look like" |
|  CANADA                               | / |     ||                      | 
|  e-mail INTERNET: gregu@ocgy.ubc.ca   |*  ||W---||                      | 
|                                       |   ^^    ^^                      | 
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~  
                                              
  

home help back first fref pref prev next nref lref last post