ctrdata | R Documentation |
A package for aggregating and analysing information on clinical studies, and for obtaining documents, from public registers
Package ctrdata
retrieves trial information and stores it in a
database collection, which has to be given as a connection object
to parameter con
for several ctrdata functions; this
connection object is created in almost identical ways for
these supported backends:
Database | Connection object |
MongoDB | dbc <- nodbi::src_mongo(db = "my_db", collection = "my_coll") |
SQLite | dbc <- nodbi::src_sqlite(dbname = "my_db", collection = "my_coll") |
PostgreSQL | dbc <- nodbi::src_postgres(dbname = "my_db"); dbc[["collection"]] <- "my_coll" |
DuckDB | dbc <- nodbi::src_duckdb(dbname = "my_db", collection = "my_coll") |
Use a connection object with a ctrdata
function, for example
dbQueryHistory, or other packages, for example
mongolite::mongo or nodbi::docdb_query.
Use a demo database:
dbc <- nodbi::src_sqlite(dbname = system.file("extdata", "demo.sqlite", package = "ctrdata"), collection = "my_trials")
ctrOpenSearchPagesInBrowser, ctrLoadQueryIntoDb (load trial records into database collection); see ctrdata-registers for details on registers and how to search.
dbFindFields (find names of fields of interest in trial records in a collection), dbGetFieldsIntoDf (create a data frame with fields of interest from collection), dbFindIdsUniqueTrials (get de-duplicated identifiers of clinical trials' records that can be used to subset a data frame).
dfTrials2Long (convert fields with nested elements into long format), dfName2Value (get values for variable(s) of interest).
Ralf Herold ralf.herold@mailbox.org
Useful links:
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.