knitr::opts_chunk$set( collapse = TRUE, comment = "#>" )
library(rUM)
The rUM
package installs several R Markdown document templates into the RStudio menus. These include a YAML header (where you can specify your name and the project name) and code chunks to enable the tidyverse
package (to help with data processing), the tidymodels
package (to help with modeling) and the conflicted
package[^1].
[^1]: The conflicted
package watches to make sure that you are not using a function that is defined twice. For example, the stats package, which ships with R has a function called lag()
and if you load the dplyr
package, which also contains a function called lag()
it is not immediately obvious which version of the lag()
function you will be using. conflicted
will keep R from running the lag()
function until you say which version you want to use.
There is also a setup code chunk that sets options to:
There are four templates:
You access the templates from the File menu by choosing
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.