Working status ✓ (18-01-2024).
Install with devtools::install_github("AdlCruz/rctapi")
Using this tool is as easy as 1, 2, 3 … 4 … 1a.
Both "embolism"
and "heart attack AND NOT stroke AND AREA[StudyType](Interventional OR Observational) AND TILT[OfficialTitle]stress"
are valid search expressions, just follow the rules.
View all_fields
and create your own list. E.gc("NCTId","Acronym")
, or view field_lists_df
for pre-made lists.for_explorer
is good to start with.
Reliably retrieve up to 1000 studies with the max_studies
argument.
Putting it all together
stress_heart <- get_study_fields(search_expr = "heart attack AND NOT stroke AND AREA[StudyType](Interventional OR Observational)AND TILT[OfficialTitle]stress", fields = for_explorer, max_studies = 500)
stress_heart
is a dataframe with rows of studies and columns of fields.
Toggling the argument response_content = TRUE
will return the entire API response.
Among the contents is the number of studies that were found to match your search expression.
Access it with stress_heart$StudyFieldsResponse$NStudiesFound
NOTE: 1a will not work unless a pre-made list is filling fields
NOTE: This package includes very little internal error handling.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.