ropensci / skimr

A frictionless, pipeable approach to dealing with summary statistics
https://docs.ropensci.org/skimr
1.11k stars 78 forks source link

Is there a way to get the plain text output in RMarkdown? #711

Closed ArthurAndrews closed 2 years ago

ArthurAndrews commented 2 years ago

It seems that skim understands when it's called from within an RMarkdown chunk and uses a different print method with kable. This looks great in the document/notebook, but it's harder to read in the RStudio IDE. Sometimes I would prefer to see the output from the print method that's used in the console in the chunk. Is there any way to do this? Thanks for the great package!

I tried the suggested method with chunk options normal_print from the vignette, but it didn't work for me.

image

elinw commented 2 years ago

That would definitely be a helpful feature, something like print.skimr.console ... I don't see an obvious way to do this at the moment but perhaps @michaelquinn32 will have an idea.

michaelquinn32 commented 2 years ago

Hi Arthur!

Glad you like the package.

Set options(paged.print = FALSE) to get the original output.

Screenshot 2022-06-18 125429

You can also disable it using paged.print=FALSE as a chunk option.

Either way, we could probably do more to improve paged output in notebooks. I'll start another issue for that.

Best wishes, Michael

ArthurAndrews commented 2 years ago

This is a great solution. I'll be using this often. Thank you very much!

ArthurAndrews commented 2 years ago

The paged.print = FALSE chunk setting is respected by the RStudio IDE and html_notebook output, but is ignored when I knit to html_document. It will still print a kable html table. Any ideas?

michaelquinn32 commented 2 years ago

Sorry about that issue Arthur. This looks like you're running into:

I think the easiest issue is to switch from html_notebook to html_document if you need more control of the rendered output. Your original option render = knitr::normal_print seems to be WAI.

Best wishes, Michael