-1

The following code

---
title: "Test"
format: revealjs
---

```{r}
library(Hmisc)
describe(mtcars)
```

will create a description of all variables in the mtcars dataset. Since it's too wide to fit on the page, there are line breaks after the 10-percentile. What are my options if I don't want line breaks? Can I scale the output chunk by some factor? Another option would be to allow for a horizontal slider, but I tried following this answer but it didn't fix the issue. I guess this means that the line breaks aren't introduced by Quarto but by the describe() function.

shafee
  • 15,566
  • 3
  • 19
  • 47
Stefan Hansen
  • 499
  • 1
  • 3
  • 16
  • Would a different package also be an option? E.g. `modelsummary::datasummary_skim(mtcars)` produces better HTML output for revealjs compared to `describe`. – Julian Jun 09 '23 at 08:04
  • @Julian: I was actually looking for something that produced a non-HTML output, but maybe I should just give up on that part. Let's say I wanted to use `datasummary_skim`, how would I make it fit horizontally? – Stefan Hansen Jun 09 '23 at 08:39
  • @Julian: So this shouldn't be happening: https://imgbox.com/YnghmSyF ? – Stefan Hansen Jun 09 '23 at 09:34
  • 1
    You are using the plain text output mode of `describe`. Try two different `html` options: `options(prType='html'); describe(mydata); print(describe(mydata), 'continuous'))` – Frank Harrell Jun 15 '23 at 20:29
  • 1
    Thanks @FrankHarrell! The one with sparklines look really neat. – Stefan Hansen Jun 16 '23 at 07:43

1 Answers1

0

Here is an datasummary_skim option:

---
title: "Test"
format: revealjs
---

<style>
.cell-output-display:not(.no-overflow-x) {
    overflow-x: auto;
}
  
</style>


```{r}
modelsummary::datasummary_skim(mtcars)
```

enter image description here

Julian
  • 6,586
  • 2
  • 9
  • 33