I want to round numbers to the closest half or whole number. So I want to round 4.2 to 4, 4.3 to 4.5 and 4.8 to 5. I tried a few things with the round option:
> round(4.34,1)
[1] 4.3
> round(4.34)
[1] 4
> round(4.34,0.5)
[1] 4.3
> round(4.34,2)
[1] 4.34
So I only know how to increase the amount of significant numbers, but not how to do different kinds of rounding. Can that be done with the round function, or is there a different function to do that in R?