R:让dplyr和摘要显示超过3位数字



此操作失败。我需要小数点右边的三位数字。

require("dplyr")
options(digits = 10)
group_by(MyData, Type_1, Type_2) %>%
summarise(
count = n(),
mean = mean(Rate, na.rm = TRUE),
sd = sd(Rate, na.rm = TRUE)
)
# A tibble: 4 x 5
# Groups:   Type_1 [2]
Type_1  Type_2 count  mean    sd
<fct>  <fct> <int> <dbl> <dbl>
1 A      X        8  1203. 120. 
2 A      Y        8  1324. 99.1
3 B      X        8  1162. 106. 
4 B      Y        8  1639. 118. 

我也试过

options(pillar.sigfigs=10)

我在找一个单行的答案。我该用什么来替换上面的数字设置?

谢谢你的帮助。

问题是我使用的引用说使用

options(pillar.sigfigs=7)

当您需要使用时

options(pillar.sigfig=7)

R不会给你一个错误,说它不知道pillar.sigfigs的意思。

最新更新