小编roc*_*ist的帖子

为什么R轮功能不是大数字

我需要一个R函数,它始终返回小数点后面的相同位数,无论参数有多大.我试过round()但是这样做不起作用.这是我的例子:

Rweb:> round(111234.678912,4) # expect 111234.6789
[1] 111234.7 
Rweb:> round(111234.678912/10,4) # expect 11123.4679    
[1] 11123.47 
Rweb:> round(111234.678912/100,4) # expect 1112.3468      
[1] 1112.347 
Rweb:> round(111234.678912/1000,4)     
[1] 111.2347 
Rweb:> round(111234.678912/10000,4)     
[1] 11.1235 
Run Code Online (Sandbox Code Playgroud)

如果参数是指数格式但我需要使用浮动格式的数字,它确实有效.

math statistics r rounding

15
推荐指数
1
解决办法
3253
查看次数

标签 统计

math ×1

r ×1

rounding ×1

statistics ×1