-
Notifications
You must be signed in to change notification settings - Fork 36
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
Control significant figures with an option #72
Comments
The underlying problem here is #57 - I think if we fix that an option will not be necessary. I'd prefer to push as far as we can before introducing more options, since options substantially increase the testing complexity, and make the package behave differently for different people. If this new behaviour is too annoying, we can definitely consider options, but I'd like to give it more time (i.e. open again in 6 months time if it's still a problem and I'll be more amenable) |
I've changed my mind - it's causing enough pain for enough people right now that we should have someway to suppress. Probably easiest to parameterise as |
options
or similar to control styling behavior?
Unaware of this issue, I was actually already in the middle of implementing this kind of option for my own use. But then I came here to check if there was any discussion in more general terms about the question of left-hand-sides of numbers and significant digits vs. thousands separators. As a little background, I was surprised at first when I saw that in e.g. Since I didn't want to use it that way, I started to implement an option so I could use But then I got to thinking that would the thousands separator idea actually be a more useful use case for the colors than significant digits? Consistency is important, but since I definitely haven't looked into this very deeply, so there might be fairly obvious factors at play that make my suggestion ridiculous. Or maybe it's just plain stupid. But since I have spent a fair amount of time staring at integers on the scale of millions (base pair numbers in the human genome), I for one see a lot of potential in this kind of representation (color formatting) of thousands separators. Use of commas, or extra characters in general, is problematic for copy&paste. Or maybe keep significant digits behaving as it is, but include a new option for the thousands separator. That one could default to not be shown, but when set, it would override the significant digits on the lhs. I'm happy to work on this and make a PR if it's deemed useful. |
I agree that this has to change. The current implementation makes inspecting tibbles almost impossible for me. I LOVE the alignment along decimal points, but the forced highlight of only three digits is confusing at best. Not only is this unintuitive (as cboettig indicates), it is visually distracting |
See #78 for a suggestion for visible thousand separators using a very light gray background every other three digits. |
- New options to control the output, with defaults that match the current behavior unless stated otherwise: - `pillar.sigfig` to control the number of significant digits, for highlighting and truncation (#72), - `pillar.subtle` to specify if insignificant digits should be printed in gray (#72), - `pillar.neg` to specify if negative digits should be printed in red, - `pillar.bold` to specify if column headers should be printed in bold (default: `FALSE`, #76), - `pillar.min_title_chars` to specify the minimum number of characters to display for each column name (default: 15 characters, #75).
- `NA` values are now shown in plain red, without changing the background color (#70). - New options to control the output, with defaults that match the current behavior unless stated otherwise: - `pillar.sigfig` to control the number of significant digits, for highlighting and truncation (#72), - `pillar.subtle` to specify if insignificant digits should be printed in gray (#72), - `pillar.neg` to specify if negative digits should be printed in red, - `pillar.bold` to specify if column headers should be printed in bold (default: `FALSE`, #76), - `pillar.min_title_chars` to specify the minimum number of characters to display for each column name (default: 15 characters, #75). - Shortened abbreviations for types: complex: cplx -> cpl, function: fun -> fn, factor: fctr -> fct (#71). - Date columns now show sub-seconds if the `digits.secs` option is set (#74). - Work around failing CRAN tests on Windows.
Thank you for the new options in #79! However, I still think there should either be
I really like having |
That is not under consideration right now. It needs more discussion, and we need to get a release out to resolve the biggest problems. |
@ilarischeinin: Happy to discuss this in a separate issue or even pull request ;-) |
- `NA` values are now shown in plain red, without changing the background color (#70). - New options to control the output, with defaults that match the current behavior unless stated otherwise: - `pillar.sigfig` to control the number of significant digits, for highlighting and truncation (#72), - `pillar.subtle` to specify if insignificant digits should be printed in gray (#72), - `pillar.neg` to specify if negative digits should be printed in red, - `pillar.bold` to specify if column headers should be printed in bold (default: `FALSE`, #76), - `pillar.min_title_chars` to specify the minimum number of characters to display for each column name (default: 15 characters, #75). - Shortened abbreviations for types: complex: cplx -> cpl, function: fun -> fn, factor: fctr -> fct (#71). - Date columns now show sub-seconds if the `digits.secs` option is set (#74). - Very wide tibbles now print faster (#85).
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. |
For instance, I see that
But you'll have to explain to me how the digits
201
are the important components of the year column in the example 😛 . Being able to change the default behavior somehow to give me 4 digits would be nice in instances like my class where students end up reading in a lot of examples whereyear
is a column. I want them to like tibbles and not get frustrated by this unintuitive behavior.The text was updated successfully, but these errors were encountered: