Skip to content
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

Colours for text reports? #7

Open
DominiqueMakowski opened this issue Feb 18, 2019 · 4 comments
Open

Colours for text reports? #7

DominiqueMakowski opened this issue Feb 18, 2019 · 4 comments
Labels
feature idea 🔥 New feature or request help us 👀 Help is needed to implement something

Comments

@DominiqueMakowski
Copy link
Member

As the text (especially the fulltext) can become a bit lengthy (for instance in the case of Bayesian models), I am wondering about the possibility of adding some "contrast" to the text, by colouring some of the values using the same colour code as in the table. It would help to identify key parts of the text.

One way to achieve is to run a smart regex (🤢) over the text to find key elements, e.g. where "beta = X,", "Median = X" etc. However, this doesn't seem straightforward 😕

@DominiqueMakowski DominiqueMakowski added help us 👀 Help is needed to implement something feature idea 🔥 New feature or request labels Mar 5, 2019
@strboul
Copy link

strboul commented Sep 21, 2019

This package looks very promising!

I was thinking about how to make report more integrated with the RMarkdown. The current missing things for me in report are that there are not many options to change styling; and therefore, there are less RMarkdown inlining possibilities.

An API suggestion and an expected result:

library(tidyverse)
library(report)

iris %>% 
  with(., cor.test(Sepal.Length, Petal.Length)) %>% 
  report() %>% 
  report_style(
    rename_values(
      Parameter1 = `Sepal Length`,
      Parameter2 = `Sepal Width`
    ),
    text_bold(
      value = "Parameter1"
    ),
    text_bold(
      value = "Parameter2"
    )
    text_italic(
      value = "r"
    ),
    text_italic(
      value = "p"
    )
  ) %>% 
  to_fulltext()
#> The Pearson's product-moment correlation between **Sepal Length** and 
#> **Petal Length** is positive, significant and large (*r = 0.87*, *p < .001*).

This kind of pipe chaining is implemented in a very well manner in rstudio/gt.

Also, referring to your initial message, I'd suggest doing modifications in the object returned by report() instead of relying upon the pure RegEx which would be a lot of work and very likely to fail.

@DominiqueMakowski
Copy link
Member Author

@strboul Thanks for that suggestion! >e will start looking into it once an initial version of report in on CRAN. We might ping you then to seek your opinion ☺️

@bwiernik
Copy link
Contributor

bwiernik commented Apr 8, 2021

The cli package could coloring console output quite straightforward, but I don't know how well it translates to Md/TeX/HTML output (if at all)?

@IndrajeetPatil
Copy link
Member

Dr. Strengejacke strongly recommends the easystats remain lightweight, so can't pick up a new dependency like cli 😄

insight has a utility function does exactly this:
https://easystats.github.io/insight/reference/print_color.html

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature idea 🔥 New feature or request help us 👀 Help is needed to implement something
Projects
None yet
Development

No branches or pull requests

4 participants