user13248694
user13248694

Reputation:

R: Getting dplyr & summary to show more than 3 digits

This fails. I need 3 digits to the right of the decimal point.

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. 

I also tried

options(pillar.sigfigs=10)

I'm looking for a one line answer. What do I replace the digits setting above with?

Thanks for any help.

Upvotes: 1

Views: 828

Answers (1)

user13248694
user13248694

Reputation:

The problem was the reference I used said to use

options(pillar.sigfigs=7)

When you need to use

options(pillar.sigfig=7)

and that R doesn't give you an error saying that it doesn't know what pillar.sigfigs means.

Upvotes: 2

Related Questions