如何在R软件中设置:计算小数点后面只保留4位数?
用print(x, digits = getOption("digits"))这样就可以针对具体的数值设定小数位。
如:
> x<-pi
> print(x,digits=5)
[1] 3.1416