Permalink
Switch branches/tags
Nothing to show
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
61 lines (38 sloc) 566 Bytes
title
Knit SQL Demo
library(DBI)
db <- dbConnect(RSQLite::SQLite(), dbname = ":memory:")
DROP TABLE IF EXISTS packages
CREATE TABLE packages (id INTEGER, name TEXT)
INSERT INTO packages VALUES (1, 'readr'), (2, 'readxl'), (3, 'haven')
SELECT * FROM packages
id name
1 readr
2 readxl
3 haven
packageReadR <- "readr"
SELECT * FROM packages
WHERE name = ?packageReadR
readrPackage
##   id  name
## 1  1 readr