A package for aggregating and analysing information on clinical studies, and for obtaining documents, from public registers
1 - Database connection
Package ctrdata
retrieves trial information and stores it in a database
collection. Therefore, a database connection object has to be given to
parameter con
for several ctrdata
functions.
The connection object is built using nodbi
which allows to use
different database backends.
Specifying a collection = "<my collection's name>"
is
necessary for package ctrdata
.
A connection object (here called dbc
) is created in almost identical
ways for these supported backends:
Database | Connection object |
MongoDB | dbc <- nodbi::src_mongo(db = "my_db", collection = "my_coll") |
DuckDB | dbc <- nodbi::src_duckdb(dbname = "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" |
2 - Operate on a clinical trial register
ctrOpenSearchPagesInBrowser, ctrLoadQueryIntoDb (load trial records into database collection); see ctrdata-registers for details on registers and how to search.
3 - Get a data frame from the database collection
ctrShowOneTrial (show widget to explore structure, fields and data of a trial), 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 to subset a data frame).
4 - Operate on a data frame with trial information
dfTrials2Long (convert fields with nested elements into long format), dfName2Value (get values for variable(s) of interest).
Author
Ralf Herold ralf.herold@mailbox.org