Comments (17)
Also color column headers and header/footer?
from tibble.
@kevinushey Is there any road map for getting colored output in RStudio? Interpreting ANSII escapes should get us most of the way there right? But maybe it requires support within ace so isn't really done...
from tibble.
Design questions:
- Need new
signif
argument to trunc_mat() and print.tbl_df()? - Need new option
tibble.signif
that is used as default argument? - How about simply rounding on non-color terminals?
from tibble.
@jimhester Colored output is something that's been in the big picture for a while, but the work just hasn't been done yet (unfortunately).
from tibble.
@kevinushey Just out of curiosity, how are you planning to do it? (Assuming that there are some plans. :) I suspect you don't want to emulate a terminal. Would you support ANSI codes or rather have your own API for it?
from tibble.
Although we haven't looked too deeply into this yet, I think the goal will be to parse ANSI escape sequences and produce the appropriate HTML output (if possible).
from tibble.
Yes, that is sensible, and certainly possible. You can essentially convert ANSI escapes to opening and closing tags, they basically work like opening and closing tags.
There will be some tricky things, though. E.g. what if there is no closing tag? It might be coming later, but how long should you wait? Anyway, thanks, looking forward to it!
from tibble.
I have mixed feelings about this stylistic decision. Sometimes the most important thing about a number is the position of the decimal point, and highlighting the significant digits might undermine that. Can you point me to an implementation of this technique?
from tibble.
@NilsEnevoldsen It would actually highlight the position of the decimal place. I don't know of an existing implementation. But maybe in a Tufte book?
from tibble.
NA values should be printed in grey, too: #69 (comment).
from tibble.
For what it's worth, I've created a package that tries to something similar to what is discussed here. As a simple example:
library(lucid)
lucid(antibiotic)
bacteria penicillin streptomycin neomycin gramstain
1 Aerobacter aerogenes 870 1 1.6 neg
2 Brucella abortus 1 2 0.02 neg
3 Brucella antracis 0.001 0.01 0.007 pos
4 Diplococcus pneumoniae 0.005 11 10 pos
5 Escherichia coli 100 0.4 0.1 neg
6 Klebsiella pneumoniae 850 1.2 1 neg
7 Mycobacterium tuberculosis 800 5 2 neg
8 Proteus vulgaris 3 0.1 0.1 neg
9 Pseudomonas aeruginosa 850 2 0.4 neg
10 Salmonella (Eberthella) typhosa 1 0.4 0.008 neg
11 Salmonella schottmuelleri 10 0.8 0.09 neg
12 Staphylococcus albus 0.007 0.1 0.001 pos
13 Staphylococcus aureus 0.03 0.03 0.001 pos
14 Streptococcus fecalis 1 1 0.1 pos
15 Streptococcus hemolyticus 0.001 14 10 pos
16 Streptococcus viridans 0.005 10 40 pos
from tibble.
@kwstat: The lucid output looks awesome to me, color could perhaps be added later there. @hadley: Is this what you had in mind?
from tibble.
That's very similar, except I'd prefer to keep the non significant digits but display them in pale grey.
How do you handle columns a column containing (say) 1e6 and 1e-6?
from tibble.
@hadley: lucid currently doesn't seem to use exponential notation at all. A few examples:
> lucid::lucid(1e6, 1e-6)
[1] "1000000"
> lucid::lucid(c(1e6, 1e-6))
[1] "1000000" " 0"
> lucid::lucid(c(1e6, 1e6))
[1] "1000000" "1000000"
> lucid::lucid(c(1e-6, 1e-6))
[1] "0.000001" "0.000001"
from tibble.
I guess we'll borrow the relevant parts from lucid, it's not that much code.
from tibble.
Closing in favor of #144.
from tibble.
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 tibble.
Related Issues (20)
- tibble depends on GPL-code HOT 4
- Note "Use `colnames()` to see all variable names" prints unneccesarily HOT 1
- Required R version is at least 3.4.0 HOT 4
- Probably it can be fixed by using as.data.frame() after using group_by() and slice HOT 1
- Error when updating tibble using `[` operator HOT 2
- Use `as_tibble()` with object class "conflict_report" (new feature) HOT 1
- Arranging with the view function. HOT 1
- Diagrams are not rendering on pkgdown site HOT 6
- dplyr 1.1.0 ungroup() drops data frame attributes HOT 2
- [Accessibility issue] Vignettes lacks alt= in plots HOT 1
- Error vectbl_assign: DLL requires the use of native symbols HOT 1
- Tibble printing rounding issue HOT 2
- [Accessibility issue] alt text for DiagrammeR::mermaid()
- tibble() behaves oddly with classed list columns
- `match(<num>, <num>)` fails on R 4.3.0.
- add_case/add_row silently converts factors to strings
- FR: Show column types like readr in the footer
- Feature request: Suppress message of new names being created in `tibble()` HOT 4
- YAML headers in Tibble
- Tweak the view function
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 tibble.