Call library(knitsql)
to automatically register a sql
knitr
engine. This allows you to create R Markdown code chunks that contain SQL
queries.
TODO: Improve these docs
Specify the connection either in R Markdown metadata, or by creating a DBI
connection object in a prior R code chunk and pass it as the conn
object.
Use the knitr chunk name to assign the results to a variable.
You can bind R variables to parameters in the SQL query by using
?varname
.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.