Giter Club home page Giter Club logo

Comments (17)

krlmlr avatar krlmlr commented on June 1, 2024

Also color column headers and header/footer?

from tibble.

jimhester avatar jimhester commented on June 1, 2024

@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.

krlmlr avatar krlmlr commented on June 1, 2024

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.

kevinushey avatar kevinushey commented on June 1, 2024

@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.

gaborcsardi avatar gaborcsardi commented on June 1, 2024

@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.

kevinushey avatar kevinushey commented on June 1, 2024

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.

gaborcsardi avatar gaborcsardi commented on June 1, 2024

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.

NilsEnevoldsen avatar NilsEnevoldsen commented on June 1, 2024

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.

hadley avatar hadley commented on June 1, 2024

@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.

krlmlr avatar krlmlr commented on June 1, 2024

NA values should be printed in grey, too: #69 (comment).

from tibble.

kwstat avatar kwstat commented on June 1, 2024

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.

krlmlr avatar krlmlr commented on June 1, 2024

@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.

hadley avatar hadley commented on June 1, 2024

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.

krlmlr avatar krlmlr commented on June 1, 2024

@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.

krlmlr avatar krlmlr commented on June 1, 2024

I guess we'll borrow the relevant parts from lucid, it's not that much code.

from tibble.

krlmlr avatar krlmlr commented on June 1, 2024

Closing in favor of #144.

from tibble.

github-actions avatar github-actions commented on June 1, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.