#### For code Use... - `message = FALSE` and `warning = FALSE` to suppress messages and warnings (caution). - `error = TRUE` to knit despite an error - `include = TRUE` to run code and show output. - `echo = TRUE` to show code and output - `eval = FALSE` to prevent code from being evaluated. (And obviously if the code is not run, no results will be generated). This is useful for displaying example code, or for disabling a large block of code without commenting each line. - `include = FALSE` to run code, but hide any output. Runs the code, but doesn’t show the code or results in the final document. Use this for setup code that you don’t want cluttering your report. - `echo = FALSE` to prevent code, but not the results from appearing in the finished file. Use this when writing reports aimed at people who don’t want to see the underlying R code. - `message = FALSE` or `warning = FALSE` to prevent messages or warnings from appearing in the finished file. - `results = 'hide'` to hide printed output; `fig.show = 'hide'` to hide plots. - `error = TRUE` to cause the render to continue even if code returns an error. This is rarely something you’ll want to include in the final version of your report, but can be very useful if you need to debug exactly what is going on inside your `.Rmd`. It’s also useful if you’re teaching R and want to deliberately include an error. The default, `error = FALSE` causes knitting to fail if there is a single error in the document. #### For figures - `fig.retina = 3` - out.width = "70%" # or 90% - fig.width = 6 - fig.asp = 0.618 # rather than setting a height, which may distort image - fig.alt: alternative text # for screen readers #### Global Options knitr::opts_chunk$set{ fig.retina = 3, out.width = "70%", # or 90% fig.width = 6, fig.asp = 0.618 } #### Resources - [27 R Markdown | R for Data Science (had.co.nz)](https://r4ds.had.co.nz/r-markdown.html) - [Tips and tricks for working with images and figures in R Markdown documents | Technical Tidbits From Spatial Analysis & Data Science (zevross.com)](https://www.zevross.com/blog/2017/06/19/tips-and-tricks-for-working-with-images-and-figures-in-r-markdown-documents/) *** 2023 cloudedknowledge.net