Comments (9)
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 option(pillar.sigfigs = 3)
allowing option(pillar.sigfigs = Inf)
to turn it off.
from pillar.
That is not under consideration right now. It needs more discussion, and we need to get a release out to resolve the biggest problems.
from pillar.
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)
from pillar.
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. 1234
the three digits with a separate color are 123
and not 234
. Also, I would've thought that if 123456789
was shown in two colors, 123
and 789
would be shown in one, and 456
in the other color. That is, I thought that the two colors represented thousands separators. I was therefore confused what it actually meant, and only from the documentation learned that it represented significant digits.
Since I didn't want to use it that way, I started to implement an option so I could use options(pillar.sigfigs = Inf)
.
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 sigfig
already means different things for the rhs (colors and rounding) and lhs (no rounding, only colors), I'm not sure if that rules out the idea.
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.
from pillar.
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
in many cases.
from pillar.
See #78 for a suggestion for visible thousand separators using a very light gray background every other three digits.
from pillar.
Thank you for the new options in #79!
However, I still think there should either be
- a separation in how significant figures are treated on the left and right hand sides,
- a mode that didn't force the number of significant digits to be set (like with base R), or
- a separate option that would override the formatting of lhs's (#78).
I really like having subtle
for things like column headers or how POSIXct's are displayed. So, I would prefer not to turn it off. But if I don't turn it off, I'm forced to set sigfig
to some value. If it's small (like 3), numbers (or their lhs's to be exact) look funny. If it's large (like 10), there are many unnecessary zeros on the rhs's (#62 is about this, but I think the functionality discussed on that issue would be a slippery slope to go down).
from pillar.
@ilarischeinin: Happy to discuss this in a separate issue or even pull request ;-)
from pillar.
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.
from pillar.
Related Issues (20)
- Should `*` or `i` be used for footer information? HOT 11
- Truncated list-cols don't seem to get grey coloring HOT 2
- pillar_num and logical vectors cause (potential?) issues
- Installation of pillar 1.9.0 in GitHub actions fails HOT 2
- Should time zones be changing datetime formatting?
- Conditional colouring of values in specific columns HOT 2
- Infinite date-time being printed twice
- Why do `new_pillar_shaft()` and `new_pillar_shaft_simple()` default `min_width` to `width`? HOT 1
- FR: don't print seconds in dttm if there is not enough space
- FR: Add a pillar.max_chars option HOT 1
- Modify tbl_df subclass print in a package HOT 2
- Feature request: Option to print both head and tail of tables? HOT 6
- Use pillar to make column titles red HOT 1
- Guidance colorizing values within a column HOT 2
- The output of `glimpse()` is too wide in RStudio Visual Editor mode HOT 6
- Show colour in `glimpse()` HOT 2
- pillar::num type vector is not properly treated by base::sum (with respect to na.rm=TRUE) HOT 1
- Some changes make warnings in tibble
- Please add col number to glimpse output HOT 1
- logic of pillar.print_max pillar.print_min
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pillar.