Subject: [PATCH 4/4] gnu: Add r-ctrdata.

From: Mădălin Ionel Patrașcu<[email-masked]>
Date: Sat, 25 Mar 2023 18:45:55 +0100

* gnu/packages/cran.scm (r-ctrdata): New variable.
---
 gnu/packages/cran.scm | 46 +++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 46 insertions(+)

diff --git a/gnu/packages/cran.scm b/gnu/packages/cran.scm
index 9b314bae43..6e70dd134a 100644
--- a/gnu/packages/cran.scm
+++ b/gnu/packages/cran.scm
@@ -97,6 +97,7 @@ (define-module (gnu packages cran)
   #:use-module (gnu packages pcre)
   #:use-module (gnu packages pdf)
   #:use-module (gnu packages perl)
+  #:use-module (gnu packages php)
   #:use-module (gnu packages pkg-config)
   #:use-module (gnu packages pulseaudio)  ;libsndfile
   #:use-module (gnu packages protobuf)
@@ -396,6 +397,51 @@ (define-public r-cplm
 comparison tool involving zero-inflated and highly skewed distributions.")
     (license license:gpl2+)))
 
+(define-public r-ctrdata
+  (package
+    (name "r-ctrdata")
+    (version "1.11.1")
+    (source
+     (origin
+       (method url-fetch)
+       (uri (cran-uri "ctrdata" version))
+       (sha256
+        (base32 "076v3bll8s6m61wcbwgrgrm34g0wa7gsc90mbwxwap1xfxyzjjsg"))))
+    (properties `((upstream-name . "ctrdata")))
+    (build-system r-build-system)
+    (inputs
+     (list coreutils
+           perl
+           php
+           sed))
+    (propagated-inputs
+     (list r-clipr
+           r-curl
+           r-dplyr
+           r-httr
+           r-jsonlite
+           r-lubridate
+           r-nodbi
+           r-rvest
+           r-stringi
+           r-xml2))
+    (native-inputs (list r-r-rsp))
+    (home-page "https://cran.r-project.org/package=ctrdata")
+    (synopsis "Retrieve and analyze clinical trials in public registers")
+    (description
+     "This package provides a system for querying, retrieving and analyzing
+protocol- and results-related information on clinical trials from three public
+registers, the @acronym{EUCTR, European Union Clinical Trials Register} @url{
+https://www.clinicaltrialsregister.eu/}, @acronym{CTGOV, ClinicalTrials.gov}
+@url{https://clinicaltrials.gov/} and the @acronym{ISRCTN, International Clinical
+Trials Registry Platform} @url{https://www.isrctn.com/}.  Trial information is
+downloaded, converted and stored in a database.  Functions are included to
+identify deduplicated records, to easily find and extract variables (fields) of
+interest even from complex nesting as used by the registers, and to update
+previous queries.  The package can be used for meta-analysis and trend-analysis
+of the design and conduct as well as for results of clinical trials.")
+    (license license:expat)))
+
 (define-public r-ctrialsgov
   (package
     (name "r-ctrialsgov")
-- 
2.39.2