ceil.RdFunctions for rounding and truncating numeric values towards near integer values.
ceil(n)
Fix(n)ceil() is an alias for ceiling() and rounds to the smallest
integer equal to or above n.
Fix() truncates values towards 0 and is an alias for
trunc(). Uses ml prefix to indicate Matlab style.
The corresponding functions floor() (rounding to the largest interger
equal to or smaller than n) and round() (rounding to the
specified number of digits after the decimal point, default being 0) are
already part of R base.
integer values
x <- c(-1.2, -0.8, 0, 0.5, 1.1, 2.9)
ceil(x)
#> [1] -1 0 0 1 2 3
Fix(x)
#> [1] -1 0 0 0 1 2