实例 R 语言 将数字上下舍入为最接近的整数

x
 
ceiling(1.4)
floor(1.4)
                    

输出结果

[1] 2
[1] 1