View source: R/search_trials.R
ctg_get_fields | R Documentation |
This function sends a query to the ClinicalTrials.gov API and returns the results as a tibble. Users can specify various parameters to filter the results, and if a parameter is not provided, it will be omitted from the query.
ctg_get_fields(
condition = NULL,
location = NULL,
title = NULL,
intervention = NULL,
status = NULL,
page_size = 20
)
condition |
A character string specifying the medical condition to search for. This will filter the results to studies related to the given condition. |
location |
A character string specifying the location (e.g., city or country) to search in. This will filter the results to studies conducted in the specified location. |
title |
A character string specifying keywords to search for in study title. This will filter the results to studies with title that include the specified keywords. |
intervention |
A character string specifying the intervention or treatment to search for. This will filter the results to studies involving the specified intervention. |
status |
A character vector specifying the overall status of the studies. Valid values include:
|
page_size |
An integer specifying the number of results per page. The default value is 20. The maximum allowed value is 1,000. If a value greater than 1,000 is specified, it will be coerced to 1,000. If not specified, the default value will be used. |
This function can return up to 1,000 results.
The function constructs a query to the ClinicalTrials.gov API using the provided parameters. It supports filtering by condition, location, title keywords, intervention, and overall status. The function handles the API response, checks for errors, and parses the results into a tibble.
A tibble containing the query results. Each row represents a study, and the columns correspond to the study details returned by the API.
# Query for studies related to "diabetes" in "Kolkata" with the status "RECRUITING"
ctg_get_fields(condition = "diabetes", location = "Kolkata",
status = "RECRUITING")
# Query for studies with "vaccine" in the title and the status "COMPLETED"
ctg_get_fields(title = "vaccine", status = "COMPLETED", page_size = 50)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.