Knit SQL Demo

db <- dbConnect(RSQLite::SQLite(), dbname = ":memory:")

```{sql, connection=db} DROP TABLE IF EXISTS packages

```{sql, connection=db}
CREATE TABLE packages (id INTEGER, name TEXT)

```{sql, connection=db} INSERT INTO packages VALUES (1, 'readr'), (2, 'readxl'), (3, 'haven')

```{sql connection=db}
SELECT * FROM packages
packageReadR <- "readr"

```{sql, connection=db, output.var="readrPackage"} SELECT * FROM packages WHERE name = ?packageReadR


Try the parsermd package in your browser

Any scripts or data that you put into this service are public.

parsermd documentation built on May 20, 2021, 5:08 p.m.