[R] rounding to whole number

2014-03-20 Thread Kristi Glover
Hi R User, I was trying to convert a decimal value into integral (whole number). I used round function but some of the cells have the value less than 0.5 and it converted into 0. But I wanted these cell to have 1 instead of 0. Another way, I could multiply by 10. But l did not want it because

Re: [R] rounding to whole number

2014-03-20 Thread Sarah Goslee
What about: ceiling(data[,2:3]) A B 1 0 1 2 3 1 3 3 3 4 2 3 Note that ceiling is referenced in ?round Thanks for the clear reproducible example. Sarah On Thu, Mar 20, 2014 at 3:42 PM, Kristi Glover kristi.glo...@hotmail.com wrote: Hi R User, I was trying to convert a decimal value into

Re: [R] rounding to whole number

2014-03-20 Thread Ted Harding
On 20-Mar-2014 19:42:35 Kristi Glover wrote: Hi R User, I was trying to convert a decimal value into integral (whole number). I used round function but some of the cells have the value less than 0.5 and it converted into 0. But I wanted these cell to have 1 instead of 0. Another way, I could

Re: [R] rounding to whole number

2014-03-20 Thread Boris Steipe
Try ?ceiling ceiling(0.4) [1] 1 B. On 2014-03-20, at 3:42 PM, Kristi Glover wrote: Hi R User, I was trying to convert a decimal value into integral (whole number). I used round function but some of the cells have the value less than 0.5 and it converted into 0. But I wanted these