[R] Rounding to the nearest 5

Bill.Venables at csiro.au Bill.Venables at csiro.au
Wed Sep 16 08:23:06 CEST 2009


x5 <-  5*round(x/5)
________________________________________
From: r-help-bounces at r-project.org [r-help-bounces at r-project.org] On Behalf Of Chris Li [chrisli at austwaterenv.com.au]
Sent: 16 September 2009 09:15
To: r-help at r-project.org
Subject: [R]  Rounding to the nearest 5

Hi all,

I want to round my values to the nearest 5.

For example, if I have a value of 11, I want R to round it to 10.

I have been searching for this command on the web and in the help file, but
I couldn't find anything useful.

Any help would be greatly appreciated.

Many thanks,
Chris
--
View this message in context: http://www.nabble.com/Rounding-to-the-nearest-5-tp25463367p25463367.html
Sent from the R help mailing list archive at Nabble.com.

        [[alternative HTML version deleted]]

______________________________________________
R-help at r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
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 mailing list