[R] round up a number to 10^4
djmuser at gmail.com
Wed Nov 2 00:15:00 CET 2011
Works in the newly released 2.14.0:
> X = c(60593.23, 71631.17, 75320.1)
> round(X, -4)
 60000 70000 80000
On Tue, Nov 1, 2011 at 10:07 AM, Wendy <wendy2.qiao at gmail.com> wrote:
> Hi all,
> I have a list of numbers, e.g., X = c(60593.23, 71631.17, 75320.1), and want
> to round them so the output is Y = c(60000, 80000, 80000). I tried
> Y<-round(X,-4), but it gives me Y = c(60000, 70000, 80000). Do anybody know
> how to round up a number to 10^4?
> Thank you in advance.
> View this message in context: http://r.789695.n4.nabble.com/round-up-a-number-to-10-4-tp3964394p3964394.html
> Sent from the R help mailing list archive at Nabble.com.
> R-help at r-project.org mailing list
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
More information about the R-help