ctrGetQueryUrl: Extract query parameters and register name from input or from...

Description Usage Arguments Value Examples

View source: R/utils.R

Description

Extract query parameters and register name from input or from clipboard into which the URL of a register search was copied

Usage

1
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 string of query parameters that can be used to retrieve data from the register.

A data frame with column names query term and register name that can directly be used in ctrLoadQueryIntoDb and in ctrOpenSearchPagesInBrowser

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
## Not run: 
db <- nodbi::src_sqlite(
  collection = "my_collection"
)

# user now copies into the clipboard the URL from
# the address bar of the browser that shows results
# from a query in one of the trial registers
ctrLoadQueryIntoDb(
  ctrGetQueryUrl(),
  con = db
)

## End(Not run)

ctrdata documentation built on Nov. 22, 2021, 1:06 a.m.