-
Notifications
You must be signed in to change notification settings - Fork 37
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Alternative method to display numeric values that were truncated for display #104
Comments
The numbers in the We see more if we ask for 6 significant figures: library(tibble)
library(purrr)
options(pillar.sigfig = 6)
tibble(
integer = sample(100),
numeric = integer + runif(100, 0, 10e-4),
long_string = rerun(100, paste0(sample(rep(letters, 10)), collapse = "")) %>% flatten_chr()
)
#> # A tibble: 100 x 3
#> integer numeric long_string
#> <int> <dbl> <chr>
#> 1 97 97.0001 bggdngfamupzwnoqtgnpeqxgepycbzoojruswgoucxowflljkhonep…
#> 2 13 13.0009 mzxwfaftnmugqiaukxjkwxzqmorukcufbsxaklttwsalglxpsuiijw…
#> 3 12 12.0008 zomszzwwrvajedxgaqhomgivvgdltlyvhvhcdckpfxxljeunfjupcc…
#> 4 83 83.0004 niekxtluwrkifjgiuovvgwzudsugibqkfmlkdcuzdjygpedlobbhym…
#> 5 58 58.0001 zzfieszqpotnneexxngltoemlqptkqbpmlptwpnegctcvdfcvtmonr…
#> 6 93 93.0006 qzdafvochukcfpazpsbgybtgncdxchvxatuzqivrrwhefogzimspuq…
#> 7 16 16.0005 rbfhrijvbskyamftsvwgduopeqevmivomepeqddjgrwldirnbmipwk…
#> 8 18 18.0003 iyvvaxwugorelcghunzcbqlrtewissyfpsxkedrxczjkzxvavqvhtn…
#> 9 38 38.0002 przmtjfypppokwmgbcxbuqxmqigwkllyuewbiqvialnyneesysupoq…
#> 10 21 21.0004 ztmqatqjxswfyqgwdpwwxwjnsunmpqizcofrmxbxcczjirysruvuod…
#> # ... with 90 more rows
Closing, please open a new issue in tibble if you still think the behavior is wrong even with more significant digits shown. |
This old thread has been automatically locked. If you think you have found something related to this, please open a new issue and link to this old issue if necessary. |
Essentially migrating tidyverse/tibble#362 (comment).
with
pillar 1.2.1
andtibble 1.4.2
I get thisCreated on 2018-03-02 by the reprex package (v0.2.0).
I think it's hard to guess that 96.0 does not represent the same value as 96, at least for me. Hence, I propose to represent numbers that were truncated for display (more) similar to truncated text: With three trailing dots after the decimal dot (that's at least what it looks like on my mac).
As pointed out by @krlmlr in tidyverse/tibble#362 (comment), I could increase the pillar option to show more digits, but I guess my point is not that I want to know the exact number, but rather I think it would be beneficial to see at first glance whether a number is truncated for display or not, in an intuitive way. So the above would become
Created on 2018-03-02 by the reprex package (v0.2.0).
The text was updated successfully, but these errors were encountered: