Coder Social home page Coder Social logo

rctgov's Introduction

rCTgov

The rCTgov package is a collection of R functions to interact with the ClinicalTrials.gov API

Installation

# install.packages("devtools")
devtools::install_github("gasparemellino/rCTgov", ref = "main")  

library(rCTgov)

Functions

all_fields()

The function returns an alphabetical list of all study fields available

fields <- all_fields()

default_fields()

This function is used by the search_by_id and search_ctgov functions as default fields returned by the query. This list should contain the list of fields most frequently used (this is to improve performance). This list can, of course, be changed locally as required.

fields <- default_fields()

search_by_id()

This function can be used to retrieve the information of a particular study. It uses the search_ctgov function. Examples:

search_by_id("BP28248") #returns the information for study BP28248 using the default fields defined in default_fields()
search_by_id("BP28248", output = "LONG") #as per above, but in long format
search_by_id("BP28248", fields = all_fields()) #returns all fields for study BP28248 - CAREFUL this will take a while...
search_by_id("BP28248", fields = c("OrgStudyId", "NCTId")) #select which fields to be returned by the query
search_by_id("NCT01874691", area = c("NCTId")) #specify in which field to search
search_by_id("BP28248", coverage = "FullMatch") #speficy coverage see here: https://clinicaltrials.gov/api/gui/ref/expr#coverageOp

#return specific information for a study
study_info <- search_by_id("BP30153")
study_info$OfficialTitle
study_info$MaximumAge
study_info$Condition
study_info$Phase

search_ctgov()

This function is used to search across study fields and it consumes the Study Fields API

search_ctgov("heart+attack")
search_ctgov("heart+attack", max_rnk = 10) #free search across all fields, max results 10
search_ctgov("heart+attack", fields = c("OrgStudyId","SecondaryId","NCTId")) #specify fields to be returned
search_ctgov("Severe Headache") #free search across all fields
search_ctgov("BP28248", fields = all_fields()) #note: all_fields() takes a long time to run

Important Notes

  • There is a search limit by the API of max 1000 results
  • Search using "all_fields()" is only recommended in certain cases as it has an impact on performance
  • Futher documentation is available in the documentation of each function and on the clinicaltrials.gov API website

rctgov's People

Contributors

gasparemellino avatar

Stargazers

 avatar  avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.