Search code examples
rdm

Center output from dm_draw


It seems like the output from the datamodeler package (dm) doesn't respect rmarkdown chunk option fig.align. Any suggestions on how to center the output?

---
title: "dm_draw test"
output: html_document
---

```{r fig.align='center'}

dm::dm_nycflights13() |> 
  dm::dm_select_tbl(flights) |> 
  dm::dm_draw()

```

enter image description here


Solution

  • One option would be to set out.width='100%':

    ---
    title: "dm_draw test"
    output: html_document
    ---
    
    ```{r}
    dm::dm_nycflights13() |> 
      dm::dm_select_tbl(flights) |> 
      dm::dm_draw()
    ```
    
    ```{r out.width='100%'}
    dm::dm_nycflights13() |> 
      dm::dm_select_tbl(flights) |> 
      dm::dm_draw()
    ```
    

    enter image description here