ctrGetQueryUrl {ctrdata}R Documentation

Get query details

Description

Extracts query parameters and register name from parameter 'url' or from the clipboard, into which the URL of a register search was copied.

Usage

ctrGetQueryUrl(url = "", register = "")

Arguments

url

URL such as from the browser address bar. If not specified, clipboard contents will be checked for a suitable URL. Can also contain a query term such as from dbQueryHistory()["query-term"]

register

Optional name of register (i.e., "EUCTR" or "CTGOV") in case url is a query term

Value

A data frame (or tibble, if dplyr is loaded) with column names 'query-term' and 'query-register'. The data frame (or tibble) can be passed as such as parameter 'query-term' to ctrLoadQueryIntoDb and as parameter 'url' to ctrOpenSearchPagesInBrowser.

Examples


# user copied into the clipboard the URL from
# the address bar of the browser that shows results
# from a query in one of the trial registers
try(ctrGetQueryUrl(), silent = TRUE)

# extract query parameters from search result URL
# (URL was cut for the purpose of formatting only)
ctrGetQueryUrl(
  url = paste0("https://clinicaltrials.gov/ct2/results?",
  "cond=&term=AREA%5BMaximumAge%5D+RANGE%5B0+days%2C+28+days%5D",
  "&type=Intr&rslt=&age_v=&gndr=&intr=Drugs%2C+Investigational",
  "&titles=&outc=&spons=&lead=&id=&cntry=&state=&city=&dist=",
  "&locn=&phase=2&rsub=&strd_s=01%2F01%2F2015&strd_e=01%2F01%2F2016",
  "&prcd_s=&prcd_e=&sfpd_s=&sfpd_e=&rfpd_s=&rfpd_e=&lupd_s=&lupd_e=&sort="))


[Package ctrdata version 1.11.1 Index]