There is also trunc(). When using any of these watch out for how they deal
with negative numbers. This can be non-intuitive at first.
-----Original Message-----
From: gov2001-l-bounces at
lists.fas.harvard.edu [mailto:gov2001-l-
bounces at
lists.fas.harvard.edu] On Behalf Of Gary King
Sent: Saturday, March 01, 2008 5:59 PM
To: gov2001-l at
lists.fas.harvard.edu
Subject: Re: [gov2001-l] Default round() setting
try these:
ceiling(1.5)
[1] 2
floor(1.5)
[1] 1
On Sat, 1 Mar 2008, Oliver Craig Bevan wrote:
> Hi all,
> does anyone know how to change the
default setting for the round()
command? At
the moment, it is set to round to an even number,
so round(0.5) goes
to 0, and
round(-1.5) goes to -2. I'd like to change
it such that .5 always
rounds up to
> the next digit.
> Cheers,
> Oliver
>
_______________________________________________
> gov2001-l mailing list
> gov2001-l at
lists.fas.harvard.edu
>
http://lists.fas.harvard.edu/mailman/listinfo/gov2001-l
_______________________________________________
gov2001-l mailing list
gov2001-l at
lists.fas.harvard.edu
http://lists.fas.harvard.edu/mailman/listinfo/gov2001-l