Width of R code chunk output in RMarkdown files knitr-ed to html
<h3>Question:</h3>

<p>What is the current working solution to set the width of r code output in html files? I would like to set width to something big and use a slider in the html output.</p>

<p><code>options(width = XXX)</code> seems not to work anymore.</p>

<h3>Example:</h3>

<pre><code>---
title: "Width test"
output:
  html_document:
    theme: default
---
```{r global_options, echo = FALSE, include = FALSE}
options(width = 999)
knitr::opts_chunk$set(echo = FALSE, warning = FALSE, message = FALSE,
                      cache = FALSE, tidy = FALSE, size = "small")
```
```{r}
sessionInfo()
```
```{r}
dataM &lt;- matrix(rnorm(100, 5, 2), ncol = 15)
dataM
```
</code></pre>

<h3>Result:</h3>

<p><a href="https://i.stack.imgur.com/Rgo1V.png" rel="noreferrer"><img src="https://i.stack.imgur.com/Rgo1V.png" alt="enter image description here"></a></p>

<p>sessionInfo() output on the screenshot above.</p>

<h3>Related:</h3>

<p>(<code>options(width = 999)</code> is not working for me)</p>

<p><a href="https://stackoverflow.com/questions/12176296/knitr-how-to-prevent-text-wrapping-in-output">knitr: How to prevent text wrapping in output?</a></p>

<p><a href="https://stackoverflow.com/questions/15385696/how-to-adjust-the-output-width-of-rstudio-markdown-output-to-html">How to adjust the output width of RStudio Markdown output (to HTML)</a></p>