Confirming how tibble handles significant digits

I just asked a question on stack overflow about how tibble handles significant digits.

I am happy with the answer, but wanted to confirm something, so I decided to ask here: it appears that there is no way:

  • to force a tibble to always print all digits
  • to force a tibble a fixed number of digits after the decimal point.

Is that correct?

In the original SO question I used an example with toy data. But in the "real world" I am training / consulting with a client that works with scientific data. In their industry they always verify numbers by hand before releasing them publicly. They originally thought there was a bug and that R had "chopped off all the digits after the ." after reading in the data from a CSV file.

We now realize that this is not what happened. But my impression is that there is no way to force tibble to print the data exactly as it was read into R. Is that correct?

I should also mention that (thanks to the answer on SO) I am aware of options(pillar.sigfig = foo). But it appears that there is no option like pillar.sigfig=Inf to make tibbles print all digits (i.e. to print the data as it was read in).

1 Like

To my knowledge there is not an option like that for pillar.sigfig. However, you can override the entire print.tbl_df method (which is what pillar calls to format output).

This doesn't do precisely what you're describing, but there is an issue/feature request open in the pillar repo asking for something ~ pillar.round = FALSE, which you can take a look at/weigh in on. Hopefully it's in the works.

A post was split to a new topic: tibbles: my tibble adds precision where it didn't exist