[R] round() and negative digits

Carl Witthoft carl at witthoft.com
Fri Oct 7 23:26:06 CEST 2011


Just wondering here -- I tested and found to my delight that

%  round(325.4,-2)
[1] 300

gave me exactly what I would have expected (and wanted).  Since it's not 
explicitly mentioned in the documentation that negative 'digits' is 
allowed, I just wanted to ask whether this behavior is intentional or a 
happy turn of events.  I'm always paranoid that something not explicitly 
documented might disappear in future revisons.

thanks
Carl

-- 
-----
Sent from my Cray XK6



More information about the R-help mailing list