Search code examples
quartoreveal.js

Use Hmisc::describe() in RevealJS/Quarto without creating line breaks


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.


Solution

  • 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