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-07-02 for version 1.22.3.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

1,044

Version

1.23.0

License

MIT + file LICENSE

Maintainer

Ralf Herold

Last Published

July 2nd, 2025

Functions in ctrdata (1.23.0)

dfTrials2Long

Convert data frame with trial records into long format
ctrdata

Getting started, database connection, function overview
dbFindIdsUniqueTrials

Get identifiers of deduplicated trial records
dbFindFields

Find names of fields in the database collection
f.primaryEndpointResults

Calculate details of a study's primary endpoint analysis and testing
f.primaryEndpointDescription

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

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

Calculate sample size of a study
f.trialPopulation

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

Calculate date of results of a study
f.trialPhase

Calculate phase of a clinical trial
dfMergeVariablesRelevel

Merge variables, keeping type where possible, optionally relevel factors
f.trialTitle

Calculate the title of a study
dbQueryHistory

Show history of queries loaded into a database collection
f.startDate

Calculate start date of a study
f.sponsorType

Calculate type of sponsor of a study
f.isMedIntervTrial

Calculate if study is a medicine-interventional 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.numSites

Calculate number of sites of a study
f.numTestArmsSubstances

Calculate number of arms or groups with investigational medicines in a study
f.trialObjectives

Calculate objectives of a study
ctrdata-registers

Information on clinical trial registers
ctrOpenSearchPagesInBrowser

Open register to show query results or search page
ctrDb

Check and prepare nodbi connection object for ctrdata
ctrShowOneTrial

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

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

Find synonyms of an active substance
ctrLoadQueryIntoDb

Load and store register trial information
ctrGetQueryUrl

Get register name and query parameters from search URL
ctrGenerateQueries

Generates queries that work across registers
dfName2Value

Get value for variable of interest
dbGetFieldsIntoDf

Create data frame of specified fields or trial concepts from database collection
ctrdata-trial-concepts

Trial concepts implemented across registers