Learn R Programming

Main featuresReferencesInstallationOverviewDatabasesData modelExample workflowAnalysis across registersTestsAcknowledgementsFuture

ctrdata for aggregating and analysing clinical trials

The package ctrdata provides functions for retrieving (downloading), aggregating and analysing clinical trials using information (structured protocol and result data, as well as documents) from public registers. It can be used with the

The motivation is to investigate the design and conduct of trials of interest, to describe their trends and availability for patients and to facilitate using their detailed results for research and meta-analyses. ctrdata is a package for the R system, but other systems and tools can use the databases created with this package. This README was reviewed on 2025-04-13 for version 1.21.1.9000.

Main features

  • Protocol- and results-related trial information is easily downloaded: Users define a query in a register’s web interface, then copy the URL and enter it into ctrdata which retrieves in one go all trials found. A script can automate copying the query URL from all registers. Personal annotations can be made when downloading trials. Also, trial documents and historic versions as available in registers on trials can be downloaded.

  • Downloaded trial information is transformed and stored in a collection of a document-centric database, for fast and offline access. Information from different registers can be accumulated in a single collection. Uses DuckDB, PostgreSQL, RSQLite or MongoDB, via R package nodbi: see section Databases below. Interactively browse through trial structure and data. Easily re-run any previous query in a collection to retrieve and update trial records.

  • For analyses, convenience functions in ctrdata implement canonical trial concepts to simplify analyses across registers

Copy Link

Version

Install

install.packages('ctrdata')

Monthly Downloads

813

Version

1.22.0

License

MIT + file LICENSE

Maintainer

Ralf Herold

Last Published

April 14th, 2025

Functions in ctrdata (1.22.0)

f.controlType

Calculate type of control data collected in a study
dfName2Value

Get value for variable of interest
f.isMedIntervTrial

Calculate if study is a medicine-interventional study
dbFindFields

Find names of fields in the database collection
dbFindIdsUniqueTrials

Get identifiers of deduplicated trial records
f.numSites

Calculate number of sites of a study
f.sampleSize

Calculate sample size of a study
f.resultsDate

Calculate date of results of a study
f.sponsorType

Calculate type of control data collected in a study
dbGetFieldsIntoDf

Create data frame of specified fields from database collection
f.startDate

Calculate start date of a study
f.trialTitle

Calculate the title of a study
f.primaryEndpointDescription

Calculate details of a primary endpoint of a study
f.primaryEndpointResults

Calculate type of control data collected in a study
f.likelyPlatformTrial

Calculate if study is likely a platform trial or not
f.isUniqueTrial

Calculate if record is unique for a study
f.statusRecruitment

Calculate status of recruitment of a study
f.trialObjectives

Calculate objectives of a study
f.numTestArmsSubstances

Calculate type of control data collected in a study
f.trialPopulation

Calculate in- and exclusion criteria and age groups
f.trialPhase

Calculate phase of a clinical trial
ctrGenerateQueries

Generates queries that work across registers
ctrFindActiveSubstanceSynonyms

Find synonyms of an active substance
ctrShowOneTrial

Show full structure and all data of a trial
ctrdata-package

ctrdata: Retrieve and Analyze Clinical Trials Data from Public Registers
ctrOpenSearchPagesInBrowser

Open register to show query results or search page
ctrGetQueryUrl

Get register name and query parameters from search URL
ctrLoadQueryIntoDb

Load and store register trial information
dbQueryHistory

Show history of queries loaded into a database collection
dfMergeVariablesRelevel

Merge variables, keeping type, and optionally relevel factors
ctrdata-registers

Information on clinical trial registers
ctrdata-trial-concepts

Trial concepts implemented across registers
ctrDb

Check and prepare nodbi connection object for ctrdata
ctrdata

Getting started, database connection, function overview
dfTrials2Long

Convert data frame with trial records into long format