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-06-07 for version 1.22.2.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

797

Version

1.22.3

License

MIT + file LICENSE

Maintainer

Ralf Herold

Last Published

June 8th, 2025

Functions in ctrdata (1.22.3)

dbFindFields

Find names of fields in the database collection
f.trialTitle

Calculate the title of a study
f.controlType

Calculate type of control data collected in a study
dbQueryHistory

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

Calculate if study is a medicine-interventional study
ctrdata

Getting started, database connection, function overview
f.primaryEndpointDescription

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

Calculate date of results of a study
f.numSites

Calculate number of sites of a study
f.primaryEndpointResults

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.sponsorType

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

Calculate start date of a study
f.trialPhase

Calculate phase of a clinical trial
f.trialObjectives

Calculate objectives of a study
dbGetFieldsIntoDf

Create data frame of specified fields or trial concepts from database collection
f.numTestArmsSubstances

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

Calculate status of recruitment of a study
f.isUniqueTrial

Calculate if record is unique for a study
f.likelyPlatformTrial

Calculate if study is likely a platform trial or not
ctrShowOneTrial

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

Trial concepts implemented across registers
ctrGetQueryUrl

Get register name and query parameters from search URL
ctrGenerateQueries

Generates queries that work across registers
ctrOpenSearchPagesInBrowser

Open register to show query results or search page
ctrdata-registers

Information on clinical trial registers
ctrdata-package

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

Load and store register trial information
ctrFindActiveSubstanceSynonyms

Find synonyms of an active substance
dfTrials2Long

Convert data frame with trial records into long format
dfMergeVariablesRelevel

Merge variables, keeping type where possible, optionally relevel factors
dfName2Value

Get value for variable of interest
ctrDb

Check and prepare nodbi connection object for ctrdata
dbFindIdsUniqueTrials

Get identifiers of deduplicated trial records