1

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.

Waldi
  • 39,242
  • 6
  • 30
  • 78
  • This can help: https://tibble.tidyverse.org/reference/formatting.html – Duck Aug 15 '20 at 21:47
  • I think you must a posted a different link than you intended to. Anyway, I tried options(tibble.width = Inf) and that didn't help. –  Aug 15 '20 at 21:50

1 Answers1

2

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.

Ben Bolker
  • 211,554
  • 25
  • 370
  • 453
  • 1
    can you link to the reference? – Ben Bolker Aug 15 '20 at 22:06
  • http://ritsokiguess.site/docs/2018/07/13/how-to-change-the-significant-digits-in-a-tibble/ ? (There is a note that says "*** this doesn’t actually display with more decimals" but it could be easy to miss ... worth contacting the [author](http://ritsokiguess.site/home/) ? – Ben Bolker Aug 15 '20 at 23:10