Learn R Programming

ctrdata (version 1.6.0)

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

Description

Extract query parameters and register name from input or from 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 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

Run this code
# NOT RUN {
# }
# 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
)
# }
# NOT RUN {
# }

Run the code above in your browser using DataLab