Skip to content

Commit b3ed542

Browse files
committed
improve documentation
1 parent 5aa456f commit b3ed542

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

65 files changed

+858
-1427
lines changed

R/ctrGenerateQueries.R

Lines changed: 145 additions & 139 deletions
Large diffs are not rendered by default.

R/ctrGetQueryUrl.R

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,14 @@
55
#' Extracts query parameters and register name from parameter `url` or
66
#' from the clipboard, into which the URL of a register search was copied.
77
#'
8+
#' To obtain the search query from CTIS, consider installing the
9+
#' \href{https://www.tampermonkey.net/}{Tampermonkey browser extension},
10+
#' click on the extension icon, "Create a new script", "Utility" and then
11+
#' "Import from this URL":
12+
#' `https://raw.githubusercontent.com/rfhb/ctrdata/master/tools/ctrdataURLcopier.js`
13+
#' This will copy query URLs from all registers into the clipboard; see
14+
#' \link{ctrOpenSearchPagesInBrowser} for additional uses.
15+
#'
816
#' @param url URL such as from the browser address bar.
917
#' If not specified, clipboard contents will be checked for
1018
#' a suitable URL.

R/ctrLoadQueryIntoDb.R

Lines changed: 18 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -11,17 +11,18 @@
1111
#' A previous query can be re-run, which replaces or adds trial
1212
#' records while keeping any user annotations of trial records.
1313
#'
14-
#' @param queryterm Either a string with the full URL of a search
15-
#' query in a register, or the data frame returned by
14+
#' @param queryterm Either a single string with the full URL of a search
15+
#' query in a register, e.g. one of the strings returned by
16+
#' \link{ctrGenerateQueries}, or a single-row data frame returned by
1617
#' \link{ctrGetQueryUrl} or \link{dbQueryHistory},
17-
#' or an `_id` in the format of one of the trial registers,
18+
#' or an `_id` in the format of one of the trial registers (e.g., "NCT..."),
1819
#' or, together with \code{register}, a string with query
1920
#' elements of a search URL. The query details are recorded in the
2021
#' \code{collection} for later use, e.g. to update records.
2122
#' For "CTIS", \code{queryterm} can be an empty string to obtain
2223
#' all trial records. For automatically copying the user's
23-
#' query of a register in a web browser to the clipboard, see
24-
#' \ifelse{latex}{\out{\href{https://rfhb.github.io/ctrdata/#id_2-script-to-automatically-copy-users-query-from-web-browser}{here}}}{\href{https://rfhb.github.io/ctrdata/#id_2-script-to-automatically-copy-users-query-from-web-browser}{here}}
24+
#' query of a register in a web browser to the clipboard, see the
25+
#' information on a browser extension script in \link{ctrGetQueryUrl}.
2526
#'
2627
#' @param register String with abbreviation of register to query,
2728
#' either "EUCTR", "CTGOV2", "ISRCTN" or "CTIS". Not needed
@@ -138,24 +139,25 @@
138139
#' @examples
139140
#' \dontrun{
140141
#'
142+
#' # Count ongoing interventional cancer trials involving children
143+
#' # Note this query is a classical CTGOV query and is translated
144+
#' # to a corresponding query for the current CTGOV2 webinterface
145+
#' ctrLoadQueryIntoDb(
146+
#' queryterm = "cond=cancer&recr=Open&type=Intr&age=0",
147+
#' register = "CTGOV",
148+
#' only.count = TRUE
149+
#' )
150+
#'
141151
#' dbc <- nodbi::src_sqlite(collection = "my_collection")
142152
#'
143153
#' # Retrieve protocol- and results-related information
144-
#' # on two specific trials identified by their EU number
154+
#' # on two specific trials identified by their EU number,
155+
#' # including protocol versions from all Member States
145156
#' ctrLoadQueryIntoDb(
146157
#' queryterm = "2005-001267-63+OR+2008-003606-33",
147158
#' register = "EUCTR",
148159
#' euctrresults = TRUE,
149-
#' con = dbc
150-
#' )
151-
#'
152-
#' # Count ongoing interventional cancer trials involving children
153-
#' # Note this query is a classical CTGOV query and is translated
154-
#' # to a corresponding query for the current CTGOV2 webinterface
155-
#' ctrLoadQueryIntoDb(
156-
#' queryterm = "cond=cancer&recr=Open&type=Intr&age=0",
157-
#' register = "CTGOV",
158-
#' only.count = TRUE,
160+
#' euctrprotocolsall = TRUE,
159161
#' con = dbc
160162
#' )
161163
#'

R/ctrOpenSearchPagesInBrowser.R

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,12 @@
22

33
#' Open register to show query results or search page
44
#'
5-
#' Open advanced search pages of register(s), or execute search in browser
5+
#' Open advanced search pages of register(s), or execute search in browser.
6+
#' For CTIS to accept a search URL and show results, consider installing the
7+
#' \href{https://www.tampermonkey.net/}{Tampermonkey browser extension},
8+
#' click on the extension icon, "Create a new script", "Utility" and then
9+
#' "Import from this URL":
10+
#' `https://raw.githubusercontent.com/rfhb/ctrdata/master/tools/ctrdataURLcopier.js`
611
#'
712
#' @param url of search results page to show in the browser. To open the
813
#' browser with a previous search, the output of \link{ctrGetQueryUrl}

R/ctrShowOneTrial.R

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,8 @@
88
#' \code{con} is provided or if the trial is not in database \code{con}.
99
#' For use in a Shiny app, see output and render functions in source code
1010
#' \ifelse{latex}{\out{
11-
#' \href{https://github.com/rfhb/ctrdata/blob/master/R/ctrShowOneTrial.R\#L190}{here}}}{
12-
#' \href{https://github.com/rfhb/ctrdata/blob/master/R/ctrShowOneTrial.R#L190}{here}}.
13-
#'
14-
#'
11+
#' \href{https://github.com/rfhb/ctrdata/blob/master/R/ctrShowOneTrial.R\#L196}{here}}}{
12+
#' \href{https://github.com/rfhb/ctrdata/blob/master/R/ctrShowOneTrial.R#L196}{here}}.
1513
#'
1614
#' This is the widget for CTIS trial 2022-501142-30-00:
1715
#'
@@ -22,7 +20,7 @@
2220
#' \out{\begin{center}}\figure{ctrdata_ctrShowOneTrial.jpg}\out{\end{center}}
2321
#' }
2422
#'
25-
#' @param identifier A trial identifier string
23+
#' @param identifier A trial identifier (`_id`) string, see examples
2624
#'
2725
#' @inheritParams ctrDb
2826
#'

R/ctrdata-package.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
#' \link{ctrShowOneTrial} (show widget to explore structure, fields and data of a trial),
3535
#' \link{dbFindFields} (find names of fields of interest in trial records in a collection),
3636
#' \link{dbGetFieldsIntoDf} (create a data frame with fields of interest and calculated trial concepts from collection),
37-
#' \link{ctrdata-trial-concepts} (calculate pre-defined trial concepts for every register),
37+
#' \link{ctrdata-trial-concepts} (calculate pre-defined trial concepts across registers),
3838
#' \link{dbFindIdsUniqueTrials} (get de-duplicated identifiers of clinical trials' records to subset a data frame).
3939
#'
4040
#' @section 4 - Operate on a trial data frame from dbGetFieldsIntoDf:

R/ctrdata-registers.R

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,30 +2,30 @@
22
#'
33
#' Registers of the four clinical trial registers from which package
44
#' \link{ctrdata} can retrieve, aggregate and analyse protocol- and
5-
#' result-related information as well as documents, last updated 2025-05-31.
5+
#' result-related information as well as documents, last updated 2025-07-24.
66
#'
77
#' @section 1 - Overview:
88
#'
99
#' - **EUCTR**: The EU Clinical Trials Register holds more than 44,300 clinical
1010
#' trials (at least one investigational medicinal product, IMP; in the European
11-
#' Union and beyond), including more than 25,100 trials with results, which
11+
#' Union and beyond), including more than 25,300 trials with results, which
1212
#' continue to be added (and can be loaded by `ctrdata`).
1313
#'
1414
#' - **CTIS**: The EU Clinical Trials Information System, launched in 2023,
15-
#' holds more than 9,200 publicly accessible clinical trials, including
16-
#' around 180 with results or a report (only as PDF files).
15+
#' holds more than 9,600 publicly accessible clinical trials, including
16+
#' around 230 with results or a report (only as PDF files).
1717
#' _No results in a structured electronic format are foreseeably available_,
1818
#' thus `ctrdata` cannot load any CTIS results.
1919
#' (To automatically get CTIS search query URLs, see
2020
#' \ifelse{latex}{\out{\href{https://rfhb.github.io/ctrdata/\#id_2-script-to-automatically-copy-users-query-from-web-browser}{here}}}{\href{https://rfhb.github.io/ctrdata/#id_2-script-to-automatically-copy-users-query-from-web-browser}{here}})
2121
#'
22-
#' - **CTGOV2**: ClinicalTrials.gov holds about 540,000 interventional and
23-
#' observational studies, including almost 71,000 interventional studies with
22+
#' - **CTGOV2**: ClinicalTrials.gov holds about 546,000 interventional and
23+
#' observational studies, including almost 68,000 interventional studies with
2424
#' results (can be loaded by `ctrdata`).
2525
#'
26-
#' - **ISRCTN**: The ISRCTN Registry holds more than 26,400 interventional and
27-
#' observational health studies, including almost 14,400 studies with
28-
#' results (only as references).
26+
#' - **ISRCTN**: The ISRCTN Registry holds more than 26,600 interventional and
27+
#' observational health studies, including almost 14,500 studies with
28+
#' results (as references).
2929
#' _No results in a structured electronic format are foreseeably available_,
3030
#' thus `ctrdata` cannot load any ISRCTN results.
3131
#'

R/ctrdata-trial-concepts.R

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
#' The following trial concepts can be used by referencing their name when
2222
#' calling \link{dbGetFieldsIntoDf} (parameter `calculate`).
2323
#' Concepts will continue to be refined and added;
24-
#' last updated 2025-07-18.
24+
#' last updated 2025-07-24.
2525
#'
2626
#' - \link{f.assignmentType} (factor) was the assignment to treatment based on
2727
#' randomisation or not? ("R" or "NR")
@@ -42,27 +42,28 @@
4242
#' of study design)
4343
#'
4444
#' - \link{f.isUniqueTrial} (logical) is the trial record unique in the data
45-
#' frame of trial, based on default parameters of \link{dbFindIdsUniqueTrials}?
45+
#' frame of trial records, based on default parameters of
46+
#' \link{dbFindIdsUniqueTrials}?
4647
#'
4748
#' - \link{f.likelyPlatformTrial} (logical, list of likely related trials, and
4849
#' list of maybe related trials) is the trial possibly a (research)
4950
#' platform trial, and what are related trials? (based on trial title,
50-
#' f.numTestArmsSubstances, number of periods; identifiers of related trials;
51+
#' `f.numTestArmsSubstances`, number of periods; identifiers of related trials;
5152
#' similarity of terms in parts of trial titles)
5253
#'
5354
#' - \link{f.numSites} (integer) how many sites does the trial have?
5455
#'
55-
#' - \link{f.numTestArmsSubstances} (integer) how many arms or groups have
56-
#' medicines that are investigational? (cannot be calculated for ISRCTN or
57-
#' for phase 1 trials)
56+
#' - \link{f.numTestArmsSubstances} (integer) how many arms or groups in the
57+
#' trial have medicines that are investigational? (cannot be calculated for
58+
#' ISRCTN or for phase 1 trials)
5859
#'
5960
#' - \link{f.primaryEndpointDescription} (list of character) string containing
6061
#' protocol definition, details and time frames, concatenated with " == "
6162
#'
6263
#' - \link{f.primaryEndpointResults} (columns of number, character, integer,
6364
#' logical) returning the statistical testing p value and method as well as the
64-
#' number of subjects included in the test and if the record includes results,
65-
#' each in one new column, for the first primary endpoint only
65+
#' number of subjects included in the test, each in one new column, for the
66+
#' first primary endpoint only
6667
#'
6768
#' - \link{f.resultsDate} (date) the planned or achieved date of results availability
6869
#'
@@ -81,11 +82,11 @@
8182
#' withdrawn)
8283
#'
8384
#' - \link{f.trialObjectives} (string) identifies with letters those objectives
84-
#' that could be identified by text fragments, e.g. "E S PD D", with "E"
85+
#' that could be identified in text fragments, e.g. "E S PD D", with "E"
8586
#' (efficacy), "S" (safety), "D" (dose-finding)
8687
#'
8788
#' - \link{f.trialPhase} (ordered factor) the phase(s) of medicine development
88-
#' with which a trial is associated
89+
#' with which a trial is associated ("phase 1", "phase 1+2" etc.)
8990
#'
9091
#' - \link{f.trialPopulation} (columns of factor, string and string) age groups
9192
#' (e.g., "P" for paediatric participants, "A" for adults, "E" for older than

R/dbFindFields.R

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,12 @@
22

33
#' Find names of fields in the database collection
44
#'
5-
#' Given part of the name of a field of interest to the user, this
5+
#' Given a part of the name of fields that are of interest to the user, this
66
#' function returns the full field names used in records that were
7-
#' previously loaded into a collection
8-
#' (using \link{ctrLoadQueryIntoDb}). Only names of fields that have
9-
#' a value in the collection can be returned.
7+
#' previously loaded into a collection (using \link{ctrLoadQueryIntoDb}).
8+
#' Only names of fields that have a value in the collection can be returned.
109
#' Set \code{sample = FALSE} to force screening all records in the
11-
#' collection for field names, see below.
10+
#' collection for field names, which can take long.
1211
#' See \link{ctrShowOneTrial} to interactively find fields.
1312
#'
1413
#' The full names of child fields are returned in dot notation (e.g.,
@@ -57,7 +56,7 @@
5756
#'
5857
#' dbFindFields(namepart = "date", con = dbc)[1:5]
5958
#'
60-
#' # view all 1880+ fields from all registers:
59+
#' # view names of all 3838 fields from all registers:
6160
#'
6261
#' allFields <- dbFindFields(con = dbc, sample = FALSE)
6362
#'

R/dbFindIdsUniqueTrials.R

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@
1313
#' (and, for "EUCTR", between records for different Member States).
1414
#' Such differences are not considered by this function.
1515
#'
16-
#' Note that the trial concept ".isUniqueTrial" (which uses this function)
17-
#' can be calculated at the time of creating a data frame with
16+
#' Note that the trial concept \link{f.isUniqueTrial} (which uses this
17+
#' function) can be calculated at the time of creating a data frame with
1818
#' \link{dbGetFieldsIntoDf}, which often may be the preferred approach.
1919
#'
2020
#' @param preferregister A vector of the order of preference for

0 commit comments

Comments
 (0)