library("knitr") library(htmltools) knitr::opts_chunk$set( comment = "#>", collapse = TRUE, warning = FALSE, message = FALSE, fig.width = 4.5, fig.height = 3, fig.path = "inst/img/", fig.align = "center", cache.path = "inst/cache/" ) knitr::knit_hooks$set(imgcenter = function(before, options, envir){ if (before) { HTML("<p align='center'>") } else { HTML("</p>") } })
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.