Managing Precision
- floor() The floor function
- ceiling() The ceiling function
- round() Round to the nearest integer
- round( ,2) Round to two decimal places
Also - Absolute Value Function
- abs() Absolute Value Function
Changing Types
as.numeric()
as.integer()
> pi
[1] 3.141593
> floor(pi)
[1] 3
> ceiling(pi)
[1] 4
> round(pi,3)
[1] 3.142
> as.integer(pi)
[1] 3