How to increase the width of the table output in RStudio Notebook visual markdown editor

Viewed 117

I'm trying to use a notebook in RStudio for an interactive demonstration for students. I like the visual markdown editor, but I'm struggling to format the output.

I can't figure out why the width of the output table is not 100%. It looks fine in the source editor, but not in the visual editor, see screenshots.

visual editor

source editor

How can I increase the width of the table in the output? (Note: I mean in the dynamic output that shows up immediately after running the code, not in the knitted document or the automatically saved nb.html file.) I tried setting fig.width, width, table.width in the chunk options, but it doesn't change anything.

1 Answers

There is no repeatable code in the question. That's why I can't try. However, I think the code samples I found on a web site below will solve the problem. The information on this site may be useful. Good luck.

The output is too wide in this chunk:

```{r}
options(width = 300)
matrix(runif(100), ncol = 20)

The output of this chunk looks better:

```{r}
options(width = 60)
matrix(runif(100), ncol = 20)
Related