Coder Social home page Coder Social logo

Improve table printing about report HOT 15 OPEN

easystats avatar easystats commented on June 20, 2024
Improve table printing

from report.

Comments (15)

strengejacke avatar strengejacke commented on June 20, 2024 1

Ok, I think we can reduce code complexity and should put the formatting in .colour_column_if(). Now we have to get rid of NA where it makes no sense.

from report.

strengejacke avatar strengejacke commented on June 20, 2024 1

unbenannt

from report.

strengejacke avatar strengejacke commented on June 20, 2024

I digged a bit into the code, and this one is tricky... we need to use format() on the complete column, e.g. in .colour_column_if(). But once it's a string, we can't check for the negative / positive sign... ?!?

from report.

DominiqueMakowski avatar DominiqueMakowski commented on June 20, 2024

Yes, I tried with some regex detection (if the stripped characters began with the "-" string), without success...

We might need to imagine another way of integrating the colouring, the formatting and the to-string conversion than my clunky proposal

from report.

DominiqueMakowski avatar DominiqueMakowski commented on June 20, 2024

Moreover, the format has to be used on the striped columns (without the colour codes), otherwise, the columns are too large (as the colour codes disappear)... So yea very tricky, puzzling and challenging haha... and worth trouble (even now with the uneven columns, I find the colouring of the coefs and such super cool 😄)

from report.

DominiqueMakowski avatar DominiqueMakowski commented on June 20, 2024

This can be relevant for future vignette / readme improvements: https://twitter.com/BrodieGaslam/status/1029059002225721344

from report.

strengejacke avatar strengejacke commented on June 20, 2024

I would say that column with numers should be right-aligned, while "string" columns (with values that are non-numeric from the user's perspective) should be left-aligned... Isn't this a common table convention?

from report.

strengejacke avatar strengejacke commented on June 20, 2024

Table printing no longer works for model-objects when digits are specified. Thus, we need some extra handling here. I tried to solve this using an additional class attribute. We should think about how to solve this issue, respectively if my suggestion is ok and not too sloppy.

from report.

DominiqueMakowski avatar DominiqueMakowski commented on June 20, 2024

image

It looks great 🎊 🎉 ! Brilliant implementation, thanks :)

from report.

DominiqueMakowski avatar DominiqueMakowski commented on June 20, 2024

It seems that bold slightly enlarges the column, resulting in a minor misalignment toward the end... but that's details ^^

from report.

strengejacke avatar strengejacke commented on June 20, 2024

Damn... ;-)
I have a fix in mind, will try this evening. We could, for the p-value column, replace all empty values with as many whitespaces as "column-width" (nchar()) and sourround the whitespaces with bold as well... Or we switch to a colour. But misalignment doesn't look that nice. :-)

from report.

strengejacke avatar strengejacke commented on June 20, 2024

Can you check if my workaround works for you? I don't have this alignment issue.

from report.

DominiqueMakowski avatar DominiqueMakowski commented on June 20, 2024

image

Seems like it's still there... are you using R studio also?

from report.

strengejacke avatar strengejacke commented on June 20, 2024

Yes, I'm using RStudio (both latest stable and current preview) on Windows 10 (light theme). Strange, but then let's format p-values in colour, not bold.

from report.

DominiqueMakowski avatar DominiqueMakowski commented on June 20, 2024

Strange indeed... maybe has something to do with the font used?
Will change back to yellow then (or maybe orange if yellow is too hard to read on a light theme?)

from report.

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.