Description Usage Arguments Value Examples
Wrapper around DBI and formatting functions to execute a SELECT
statement
and return the results in a tibble.
1 | db_select_data(con, select_statement)
|
con |
A DBIConnection object, as returned by |
select_statement |
a character string representing a SQL |
a tibble with the results.
1 2 3 4 5 6 7 8 9 10 | con <- RSQLite::dbConnect(RSQLite::SQLite(), ":memory:")
p <- tibble::tibble(SUBJECT_ID = c(10006, 10011))
a <- tibble::tibble(SUBJECT_ID = c(10006, 10011))
RSQLite::dbWriteTable(con, "PATIENTS", p)
RSQLite::dbWriteTable(con, "ADMISSIONS", a)
patients <- db_select_data(con, "SELECT * FROM PATIENTS")
admissions <- db_select_data(con, "SELECT * FROM ADMISSIONS WHERE SUBJECT_ID = 10006")
RSQLite::dbDisconnect(con)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.