AndriSignorell / DescTools

Tools for Descriptive Statistics and Exploratory Data Analysis
http://andrisignorell.github.io/DescTools/
82 stars 18 forks source link

DescTools hardcodes ANSI codes: this causes issues in Quarto #119

Closed GegznaV closed 7 months ago

GegznaV commented 1 year ago

DescTools package is outputting ANSI color code characters using cat() https://github.com/AndriSignorell/DescTools/blob/214a6615769fb4c2d39734c88595d968912ce72b/R/Desc.R#L1388-L1390

And these hardcoded values are printed as-is in reports rendered via Quarto and similar tools. Can package cli package be used instead for creating color codes? cli automatically disables ANSI codes in Quarto output and this would make the output more readable.

The discussion on this is here:

And particularly this comment https://github.com/quarto-dev/quarto-cli/issues/5746#issuecomment-1569861227 talks about DescTools.

AndriSignorell commented 1 year ago

I see no problems to implement this. I'll do it as soon as possible..

AndriSignorell commented 8 months ago

Fixed in DescTools 99.51 @GegznaV: Do you have the time for a check?

GegznaV commented 7 months ago

The code looks good: https://github.com/AndriSignorell/DescTools/blob/6b3edb79083ea0f6135b81b538759210b9eb8a67/R/Desc.R#L1397-L1399

And there are no ANSI codes in the output:

Quarto output

Thank you, @AndriSignorell, for solving this.