Description Usage Arguments Value Functions Examples
Provides a connection to a DuckDB database of the CMS synthetic claims data.
Alternatively, you can use claims_db()
to manually connect to the
database using DBI::dbConnect()
and duckdb::duckdb()
.
1 2 3 4 5 | claims_connect(dbdir = ":memory:", ...)
claims_disconnect(con)
claims_db()
|
dbdir |
Location for database files. Should be a path to an existing directory in the file system. With the default, all data is kept in RAM |
... |
Additional parameters passed to |
con |
A connection to the Star Wars database |
A connection to the synthetic claims database, or the path to the database.
claims_connect
: Connect to the DuckDB database
claims_disconnect
: Disconnect from the DuckDB database
claims_db
: Returns the path to the claimsdb database
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 | # Manually connect using {duckdb} and {DBI}
con <- DBI::dbConnect(
duckdb::duckdb(),
dbdir = claims_db(),
read_only = TRUE
)
if (requireNamespace("dplyr", quietly = TRUE)) {
dplyr::tbl(con, "bene")
}
# Disconnect from that database (shutdown is specific to duckdb)
DBI::dbDisconnect(con, shutdown = TRUE)
# Or connect without worrying about connection details
con <- claims_connect()
if (requireNamespace("dplyr", quietly = TRUE)) {
dplyr::tbl(con, "bene")
}
# Similarly, disconnect quickly without worrying about duckdb arguments
claims_disconnect(con)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.