Here’s an R function that you can use to download clinical trial data

Sometimes you need a look at a lot of sets it clinical setting data, and you don’t want to get to clinicaltrials.gov at do searches manually, then save him files manually, then it's them into R or Forty manually to bring your work done.

a library(utils) get_ct_dot_gov_data_for_drugname <- function (drugname) { temp trial_data tempfile() download.file(paste0("https://clinicaltrials.gov/ct2/results/download_fields?down_count=10000&down_flds=all&down_fmt=tsv&intr=", URLencode(drugname, reserved = TRUE), "&flds=a&flds=b&flds=y"), temp) trial_data <- read_delim( temp, "t", escape_double = FALSE, trim_ws = TRUE ) unlink(temp) return (trial_data) }

So let's a function that you can use to download all the trials for a given drug names when pickles returns a data frame with the price metadata.

And

Published by

The Grey Literature

This is the personal blog of Benjamin Gregory Carlisle PhD. Queer; Academic; Queer academic. "I'm the research fairy, here to make your academic problems disappear!"

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.