I have been trying to pull specific columns for a disease using "rclinicaltrial" package, but unable to do so.
Kindly need your suggestions.
I've tried using this code
melanom <- clinicaltrials_search(query = c("cond=melanoma", "phase=2", "type=Intr", "rslt=With"), count=5)
e.g., I want data for melanoma from clinicaltrial.gov, with specific columns like-
- Title
- Phase
- Recruiting status and
- Compound
but it gives me a default output like this, with all the default columns-
score     nct_id        url                                          title                         status.text                  condition_summary                 intervention_summary                        last_changed
0.99384   NCT01723800   http://ClinicalTrials.gov/show/NCT01723800   PI3K Inhibitor BKM120         Active, not recruiting       Adenocarcinoma of the             Drug: PI3K inhibitor BKM120;                May 5, 2015
                                                                     Carboplatin, and                                           Lung; Bronchoalveolar             Drug: pemetrexed disodium;
                                                                     Pemetrexed Disodium in                                     Cell Lung Cancer;                 Drug: carboplatin;
                                                                     Treating Patients With                                     Large Cell Lung Cancer;           Other: laboratory biomarker analysis;
                                                                     Stage IV Non-Small Cell                                    Recurrent Non-small Cell          Other: pharmacological study;
                                                                     Lung Cancer                                                Lung Cancer; Stage IV             Procedure: quality-of-life assessment
                                                                                                                                Non-small Cell Lung Cancer
Thanks a lot it works!.
I've one more doubt,
Is it possible to write the two data frames together? since they've differing number of rows it is not being possible.. How do I write it?
Thanks a lot it works!.
I've one more doubt,
Is it possible to write the two data frames together? since they've differing number of rows it is not being possible.. How do I write it?
I'm happy it helped; could you click the "accept answer" checkbox next to my answer? Thanks.
I wasn't sure about the data frame size either; my guess is that one or more of those trials used more than one intervention (e.g. one trial used two or three different interventions), so the sizes of the dataframes aren't equal. You could force them to be merged, but you'd have to add "NA"s for some of the rows, which wouldn't be very meaningful. If you still want to force them into one data frame, copy and paste the following into R (assuming you used the names that I used before):