I'm starting working with R Markdown and I'm not understanding how to generate bigger plots. With today screens the plots can be much bigger.
How do I control the plots width/heigh in a Markdown report?
Thanks for the help.
To set plot line width/thickness in R, call plot() function and along with the data to be plot, pass required thickness/line-width value for the “lwd” parameter.
RMarkdown is an extension to markdown which includes the ability to embed code chunks and several other extensions useful for writing technical reports. The rmarkdown package extends the knitr package to, in one step, allow conversion between an RMarkdown file (.Rmd) into PDF, HTML, word document, amongst others.
In RStudio, when you open a new RMarkdown file, in the editor pane, there is a cogwheel button / menu where you can choose "Chunk Output Inline". That should put the plots into the document.
See this SO answer for how to specify these details in chunks.
To set global chunk options, use opts_chunk$set(out.width='750px', dpi=200)
inside your first chunk. See this page on chunk options for more.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With