Learn R Programming

ctrdata (version 1.23.0)

ctrdata: Getting started, database connection, function overview

Description

ctrdata is a package for aggregating and analysing data on clinical studies, and for obtaining documents, from public trial registers

Arguments

1 - Define a database connection

Package ctrdata retrieves trial data and stores it in a database collection. The connection is specified using nodbi, which allows to use different database backends in an identical way. A database connection object is specified once and then can be used as parameter con in subsequent calls of ctrdata functions. Specifying collection = "<my trial data collection's name>" indicates the table in the database that package ctrdata should use.

DatabaseConnection object
SQLitedbc <- nodbi::src_sqlite(dbname = "my_db", collection = "my_coll")
DuckDBdbc <- nodbi::src_duckdb(dbname = "my_db", collection = "my_coll")
MongoDBdbc <- nodbi::src_mongo(db = "my_db", collection = "my_coll")
PostgreSQLdbc <- nodbi::src_postgres(dbname = "my_db"); dbc[["collection"]] <- "my_coll"

2 - Load information from clinical trial registers

ctrGenerateQueries (generate from simple user input specific queries for registers EUCTR, CTIS, CTGOV2 and ISRCTN), ctrOpenSearchPagesInBrowser (open queries in browser), see script (automatically copy user search in any register to clipboard), see ctrdata-registers for details on registers and how to search, ctrLoadQueryIntoDb (load trial records found with query into database collection).

3 - Use database with downloaded trial information

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 and calculated trial concepts from collection), ctrdata-trial-concepts (calculate pre-defined trial concepts for every register), dbFindIdsUniqueTrials (get de-duplicated identifiers of clinical trials' records to subset a data frame).

4 - Operate on a trial data frame from dbGetFieldsIntoDf

dfTrials2Long (convert fields with nested elements into long format), dfName2Value (get values for variable(s) of interest), ctrdata-trial-concepts (calculate pre-defined trial concepts for every register).

Author

Ralf Herold ralf.herold@mailbox.org

See Also