;;; GNU Guix --- Functional package management for GNU
;;; Copyright © 2015-2025 Ricardo Wurmus <rekado@elephly.net>
;;; Copyright © 2015 Andreas Enge <andreas@enge.fr>
;;; Copyright © 2015, 2016 Pjotr Prins <pjotr.guix@thebird.nl>
;;; Copyright © 2016, 2017 Ben Woodcroft <donttrustben@gmail.com>
;;; Copyright © 2016, 2017, 2018, 2020, 2021 Roel Janssen <roel@gnu.org>
;;; Copyright © 2017, 2018, 2019, 2020 Tobias Geerinckx-Rice <me@tobias.gr>
;;; Copyright © 2017 Raoul Bonnal <ilpuccio.febo@gmail.com>
;;; Copyright © 2018 Vijayalakshmi Vedantham <vijimay12@gmail.com>
;;; Copyright © 2018 Sahithi Yarlagadda <sahi@swecha.net>
;;; Copyright © 2018 Sandeep Subramanian <sandeepsubramanian94@gmail.com>
;;; Copyright © 2018 Charlie Ritter <chewzeirta@posteo.net>
;;; Copyright © 2018 Konrad Hinsen <konrad.hinsen@fastmail.net>
;;; Copyright © 2018, 2020-2024 Mădălin Ionel Patrașcu <madalinionel.patrascu@mdc-berlin.de>
;;; Copyright © 2018 Laura Lazzati <laura.lazzati.15@gmail.com>
;;; Copyright © 2018 Leo Famulari <leo@famulari.name>
;;; Copyright © 2018 Marius Bakke <mbakke@fastmail.com>
;;; Copyright © 2018, 2019 Brett Gilio <brettg@gnu.org>
;;; Copyright © 2019 Nicolò Balzarotti <anothersms@gmail.com>
;;; Copyright © 2019, 2020, 2021, 2022 Wiktor Żelazny <wzelazny@vurv.cz>
;;; Copyright © 2019 Arne Babenhauserheide <arne_bab@web.de>
;;; Copyright © 2019, 2020, 2023 Efraim Flashner <efraim@flashner.co.il>
;;; Copyright © 2020 Todor Kondić <tk.code@protonmail.com>
;;; Copyright © 2020 Danjela Lura <danielaluraa@gmail.com>
;;; Copyright © 2020 Naga Malleswari <nagamalli@riseup.net>
;;; Copyright © 2020 Eric Brown <ecbrown@ericcbrown.com>
;;; Copyright © 2020 Peter Lo <peterloleungyau@gmail.com>
;;; Copyright © 2020 Rafael Luque Leiva <rafael.luque@osoco.es>
;;; Copyright © 2020, 2021 Lars-Dominik Braun <ldb@leibniz-psychology.org>
;;; Copyright © 2020 Vinicius Monego <monego@posteo.net>
;;; Copyright © 2020 Antoine Côté <antoine.cote@posteo.net>
;;; Copyright © 2020 Arun Isaac <arunisaac@systemreboot.net>
;;; Copyright © 2020 Magali Lemes <magalilemes00@gmail.com>
;;; Copyright © 2020-2023, 2025 Simon Tournier <zimon.toutoune@gmail.com>
;;; Copyright © 2020 Aniket Patil <aniket112.patil@gmail.com>
;;; Copyright © 2021 Marcel Schilling <marcel.schilling@uni-luebeck.de>
;;; Copyright © 2021 Guillaume Le Vaillant <glv@posteo.net>
;;; Copyright © 2022-2024 Navid Afkhami <navid.afkhami@mdc-berlin.de>
;;; Copyright © 2022 Greg Hogan <code@greghogan.com>
;;; Copyright © 2023 Kyle Andrews <kyle@posteo.net>
;;; Copyright © 2024 Marco Baggio <guix@mawumag.com>
;;; Copyright © 2024, 2025 Spencer King <spencer.king@wustl.edu>
;;; Copyright © 2024-2025 Tor-björn Claesson <tclaesson@gmail.com>
;;;
;;; This file is part of GNU Guix.
;;;
;;; GNU Guix is free software; you can redistribute it and/or modify it
;;; under the terms of the GNU General Public License as published by
;;; the Free Software Foundation; either version 3 of the License, or (at
;;; your option) any later version.
;;;
;;; GNU Guix is distributed in the hope that it will be useful, but
;;; WITHOUT ANY WARRANTY; without even the implied warranty of
;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
;;; GNU General Public License for more details.
;;;
;;; You should have received a copy of the GNU General Public License
;;; along with GNU Guix.  If not, see <http://www.gnu.org/licenses/>.

(define-module (gnu packages cran)
  #:use-module ((guix licenses) #:prefix license:)
  #:use-module (guix packages)
  #:use-module (guix download)
  #:use-module (guix gexp)
  #:use-module (guix git-download)
  #:use-module (guix utils)
  #:use-module (guix build-system gnu)
  #:use-module (guix build-system r)
  #:use-module (gnu packages)
  #:use-module (gnu packages algebra)
  #:use-module (gnu packages autotools)
  #:use-module (gnu packages base)
  #:use-module (gnu packages bioinformatics)
  #:use-module (gnu packages c)
  #:use-module (gnu packages cmake)
  #:use-module (gnu packages compression)
  #:use-module (gnu packages cpp)
  #:use-module (gnu packages crypto)
  #:use-module (gnu packages curl)
  #:use-module (gnu packages databases)
  #:use-module (gnu packages fontutils)
  #:use-module (gnu packages fribidi)
  #:use-module (gnu packages gawk)
  #:use-module (gnu packages gcc)
  #:use-module (gnu packages geo)
  #:use-module (gnu packages ghostscript)
  #:use-module (gnu packages gl)
  #:use-module (gnu packages gnome)
  #:use-module (gnu packages gnupg)
  #:use-module (gnu packages gtk)
  #:use-module (gnu packages haskell-xyz)
  #:use-module (gnu packages icu4c)
  #:use-module (gnu packages image)
  #:use-module (gnu packages imagemagick)
  #:use-module (gnu packages java)
  #:use-module (gnu packages javascript)
  #:use-module (gnu packages jupyter)
  #:use-module (gnu packages libevent)
  #:use-module (gnu packages linux)
  #:use-module (gnu packages machine-learning)
  #:use-module (gnu packages maths)
  #:use-module (gnu packages mpi)
  #:use-module (gnu packages multiprecision)
  #:use-module (gnu packages networking)
  #:use-module (gnu packages node)
  #:use-module (gnu packages ocr)
  #:use-module (gnu packages pcre)
  #:use-module (gnu packages pdf)
  #:use-module (gnu packages perl)
  #:use-module (gnu packages pkg-config)
  #:use-module (gnu packages pulseaudio)  ;libsndfile
  #:use-module (gnu packages protobuf)
  #:use-module (gnu packages python)
  #:use-module (gnu packages python-xyz)
  #:use-module (gnu packages rdf)
  #:use-module (gnu packages rust)
  #:use-module (gnu packages ssh)
  #:use-module (gnu packages sqlite)
  #:use-module (gnu packages statistics)
  #:use-module (gnu packages tbb)
  #:use-module (gnu packages tcl)
  #:use-module (gnu packages tex)
  #:use-module (gnu packages textutils)
  #:use-module (gnu packages tls)
  #:use-module (gnu packages version-control)
  #:use-module (gnu packages video)
  #:use-module (gnu packages web)
  #:use-module (gnu packages xml)
  #:use-module (gnu packages xorg)
  #:use-module ((srfi srfi-1) #:hide (zip))
  #:use-module (ice-9 match))

(define-public r-abbreviate
  (package
    (name "r-abbreviate")
    (version "0.1")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "abbreviate" version))
       (sha256
        (base32 "1cvjdbi17qz8gr5898zchm5fyz4n51z66lwps25v8a9mhwab8imi"))))
    (properties `((upstream-name . "abbreviate")))
    (build-system r-build-system)
    (native-inputs (list r-testthat))
    (home-page "https://github.com/sigbertklinke/abbreviate")
    (synopsis "Readable string abbreviation")
    (description
     "This package abbreviates strings to a specified minimum number of
characters, such that the strings remain unique (if they originally were).")
    (license license:gpl3)))

(define-public r-acepack
  (package
    (name "r-acepack")
    (version "1.6.1")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "acepack" version))
       (sha256
        (base32
         "00z5pv28liyrxwhaizsp5g6kn7qd6qghmmyaka43i7jsh8fy06xw"))))
    (properties
     `((upstream-name . "acepack")
       (updater-extra-inputs . ("gfortran"))))
    (build-system r-build-system)
    (inputs
     (list gfortran))
    (native-inputs (list gfortran r-testthat))
    (home-page "https://cran.r-project.org/web/packages/acepack")
    (synopsis "Functions for regression transformations")
    (description
     "This package provides ACE and AVAS methods for choosing regression
transformations.")
    (license license:expat)))

(define-public r-ade4
  (package
    (name "r-ade4")
    (version "1.7-23")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "ade4" version))
       (sha256
        (base32
         "0zv7fsa3b7j0y84hc99m0r32m1irp51pyh47hg14zwk8iykcb4ih"))))
    (build-system r-build-system)
    (propagated-inputs
     (list r-mass r-pixmap r-rcpp r-rcpparmadillo r-sp))
    (home-page "https://pbil.univ-lyon1.fr/ADE-4")
    (synopsis "Multivariate data analysis and graphical display")
    (description
     "The ade4 package contains data analysis functions to analyze ecological
and environmental data in the framework of Euclidean exploratory methods.")
    (license license:gpl2+)))

(define-public r-aer
  (package
    (name "r-aer")
    (version "1.2-14")
    (source (origin
              (method url-fetch)
              (uri (cran-uri "AER" version))
              (sha256
               (base32
                "06l7h1gdyc007hx5xavkb879mgqnskcq2zrbr0xbm88rv1b63a26"))))
    (properties `((upstream-name . "AER")))
    (build-system r-build-system)
    (propagated-inputs
     (list r-car
           r-formula
           r-lmtest
           r-sandwich
           r-survival
           r-zoo))
    (native-inputs (list r-foreign))
    (home-page "https://cran.r-project.org/package=AER")
    (synopsis "Applied econometrics with R")
    (description
     "This package provides functions, data sets, examples, demos, and
vignettes for the book Christian Kleiber and Achim Zeileis (2008), Applied
Econometrics with R, Springer-Verlag, New York.  ISBN 978-0-387-77316-2. (See
the vignette \"AER\" for a package overview.)")
    ;; Either version of the GPL
    (license (list license:gpl2 license:gpl3))))

(define-public r-afpt
  (package
    (name "r-afpt")
    (version "1.1.0.4")
    (source (origin
              (method url-fetch)
              (uri (cran-uri "afpt" version))
              (sha256
               (base32
                "15pa4p78p6r478l05481lzx6z4ahswj728s1sb3xp3pvn6rv4jfj"))))
    (properties `((upstream-name . "afpt")))
    (build-system r-build-system)
    (native-inputs (list r-knitr r-testthat))
    (home-page "https://github.com/MarcoKlH/afpt-r/")
    (synopsis "Tools for modelling of animal flight performance")
    (description
     "This package allows estimation and modelling of flight costs in animal
(vertebrate) flight, implementing the aerodynamic power model.  Flight
performance is estimated based on basic morphological measurements such as
body mass, wingspan and wing area.  @code{Afpt} can be used to make
predictions on how animals should adjust their flight behaviour and wingbeat
kinematics to varying flight conditions.")
    (license license:gpl3+)))

(define-public r-aod
  (package
    (name "r-aod")
    (version "1.3.3")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "aod" version))
       (sha256
        (base32 "0zh8sjzbsq3sjzayv8wa0n1vh654g47xkxklgzxcsy3xpy55w95p"))))
    (properties `((upstream-name . "aod")))
    (build-system r-build-system)
    (home-page "https://cran.r-project.org/package=aod")
    (synopsis "Analysis of overdispersed data")
    (description
     "This package provides a set of functions to analyze overdispersed counts
or proportions.  Most of the methods are already available elsewhere but are
scattered in different packages.  The proposed functions should be considered
as complements to more sophisticated methods such as @dfn{generalized
estimating equations} (GEE) or @dfn{generalized linear mixed effect
models} (GLMM).")
    (license license:gpl2+)))

(define-public r-asioheaders
  (package
    (name "r-asioheaders")
    (version "1.30.2-1")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "AsioHeaders" version))
       (sha256
        (base32 "0cdbw8w9mj2a6syqvhb11pyhjdrjg3yb8wsn9gw4ww6cli43pr0v"))))
    (properties `((upstream-name . "AsioHeaders")))
    (build-system r-build-system)
    (home-page "https://github.com/eddelbuettel/asioheaders")
    (synopsis "Asio C++ header files")
    (description
     "Asio is a cross-platform C++ library for network and low-level I/O
programming that provides developers with a consistent asynchronous model
using a modern C++ approach.  It is also included in Boost but requires
linking when used with Boost.  Standalone it can be used header-only (provided
a recent compiler).  Asio is written and maintained by Christopher
M. Kohlhoff, and released under the Boost Software License', Version 1.0.")
    (license license:boost1.0)))

(define-public r-assertthat
  (package
    (name "r-assertthat")
    (version "0.2.1")
    (source (origin
              (method url-fetch)
              (uri (cran-uri "assertthat" version))
              (sha256
               (base32
                "17wy5bdfzg73sg2clisg1k3zyn1adkj59x56m5nwia2k8z67zkw5"))))
    (build-system r-build-system)
    (native-inputs (list r-testthat))
    (home-page "https://github.com/hadley/assertthat")
    (synopsis "Easy pre and post assertions")
    (description
     "Assertthat is an extension to @code{stopifnot()} that makes it easy to
declare the pre and post conditions that your code should satisfy, while also
producing friendly error messages so that your users know what they've done
wrong.")
    (license license:gpl3+)))

(define-public r-aster
  (package
    (name "r-aster")
    (version "1.3-4")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "aster" version))
       (sha256
        (base32 "0inj8gn29z6apjh9h2ps26j7077k91l9m637rsdav2b8a87anw5h"))))
    (properties `((upstream-name . "aster")))
    (build-system r-build-system)
    (propagated-inputs (list r-trust))
    (native-inputs (list r-numderiv))
    (home-page "http://www.stat.umn.edu/geyer/aster/")
    (synopsis "Aster Models")
    (description
     "Aster models (Geyer, Wagenius, and Shaw, 2007,
<doi:10.1093/biomet/asm030>; Shaw, Geyer, Wagenius, Hangelbroek, and Etterson,
2008, <doi:10.1086/588063>; Geyer, Ridley, Latta, Etterson, and Shaw, 2013,
<doi:10.1214/13-AOAS653>) are exponential family regression models for life
history analysis.  They are like generalized linear models except that
elements of the response vector can have different families (e.2g., some
Bernoulli, some Poisson, some zero-truncated Poisson, some normal) and can be
dependent, the dependence indicated by a graphical structure.  Discrete time
survival analysis, life table analysis, zero-inflated Poisson regression, and
generalized linear models that are exponential family (e.g., logistic
regression and Poisson regression with log link) are special cases.  Main use
is for data in which there is survival over discrete time periods and there is
additional data about what happens conditional on survival (e.g., number of
offspring).  Uses the exponential family canonical parameterization (aster
transform of usual parameterization).  There are also random effects versions
of these models.")
    (license license:expat)))

(define-public r-autometric
  (package
    (name "r-autometric")
    (version "0.1.2")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "autometric" version))
       (sha256
        (base32 "1dk2k78niqx9n8pq95cyx4qw00cmic47lyrg5ac0ghr25539jrld"))))
    (properties `((upstream-name . "autometric")))
    (build-system r-build-system)
    (native-inputs (list r-callr r-ps r-tinytest))
    (home-page "https://wlandau.github.io/autometric/")
    (synopsis "Background resource logging")
    (description
     "Intense parallel workloads can be difficult to monitor.  Packages
@code{crew.cluster}, @code{clustermq}, and @code{future.batchtools} distribute
hundreds of worker processes over multiple computers.  If a worker process
exhausts its available memory, it may terminate silently, leaving the
underlying problem difficult to detect or troubleshoot.  Using the autometric
package, a worker can proactively monitor itself in a detached background
thread.  The worker process itself runs normally, and the thread writes to a
log every few seconds.  If the worker terminates unexpectedly, autometric can
read and visualize the log file to reveal potential resource-related reasons
for the crash.  The autometric package borrows heavily from the methods of
packages @code{ps} and @code{psutil}.")
    (license license:expat)))

(define-public r-backports
  (package
    (name "r-backports")
    (version "1.5.0")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "backports" version))
       (sha256
        (base32
         "18kwi50bvha6p5jfl833grmhqzi55adnd3glcy4yh18mizdxjghd"))))
    (build-system r-build-system)
    (home-page "https://cran.r-project.org/web/packages/backports")
    (synopsis "Reimplementations of functions introduced since R 3.0.0")
    (description
     "Provides implementations of functions which have been introduced in R
since version 3.0.0.  The backports are conditionally exported which results
in R resolving the function names to the version shipped with R (if available)
and uses the implemented backports as fallback.  This way package developers
can make use of the new functions without worrying about the minimum required
R version.")
    (license license:gpl2+)))

(define-public r-base64
  (package
    (name "r-base64")
    (version "2.0.2")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "base64" version))
       (sha256
        (base32
         "030f8ynlga2qych88d45hk491cfi25hrjwl2gj4gsphljvi7ps5i"))))
    (build-system r-build-system)
    (propagated-inputs
     (list r-openssl))
    (home-page "https://cran.r-project.org/web/packages/base64")
    (synopsis "Base64 encoder and decoder")
    (description
     "This package is a compatibility wrapper to replace the orphaned package
by Romain Francois.  New applications should use the openssl or base64enc
package instead.")
    (license license:expat)))

(define-public r-base64enc
  (package
    (name "r-base64enc")
    (version "0.1-3")
    (source (origin
              (method url-fetch)
              (uri (cran-uri "base64enc" version))
              (sha256
               (base32
                "13b89fhg1nx7zds82a0biz847ixphg9byf5zl2cw9kab6s56v1bd"))))
    (build-system r-build-system)
    (home-page "https://www.rforge.net/base64enc")
    (synopsis "Tools for Base64 encoding")
    (description
     "This package provides tools for handling Base64 encoding.  It is more
flexible than the orphaned \"base64\" package.")
    (license license:gpl2+)))

(define-public r-batchjobs
  (package
    (name "r-batchjobs")
    (version "1.9")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "BatchJobs" version))
       (sha256
        (base32
         "0xsw25j2ks9bqgz189qdcyj8hzz93snknlik83nj04s6vy0w7aax"))))
    (properties
     '((upstream-name . "BatchJobs")
       (updater-extra-native-inputs . ("r-mass"))))
    (build-system r-build-system)
    (propagated-inputs
     (list r-backports
           r-bbmisc
           r-brew
           r-checkmate
           r-data-table
           r-dbi
           r-digest
           r-rsqlite
           r-sendmailr
           r-stringi))
    (native-inputs (list r-mass r-testthat))
    (home-page "https://github.com/tudo-r/BatchJobs")
    (synopsis "Batch computing with R")
    (description
     "This package provides @code{Map}, @code{Reduce} and @code{Filter}
variants to generate jobs on batch computing systems like PBS/Torque, LSF,
SLURM and Sun Grid Engine.  Multicore and SSH systems are also supported.")
    (license license:bsd-2)))

(define-public r-bayesfactor
  (package
    (name "r-bayesfactor")
    (version "0.9.12-4.7")
    (source
      (origin
        (method url-fetch)
        (uri (cran-uri "BayesFactor" version))
        (sha256
          (base32
            "0z9p9vdcmcdwqmixaiqnhli2b06whbap6y4pqx4a5gcdgxlj09zr"))))
    (properties `((upstream-name . "BayesFactor")))
    (build-system r-build-system)
    ;; Tests fail with: could not find function "context"
    (arguments (list #:test-types '(list "vignettes")))
    (propagated-inputs
     (list r-coda
           r-hypergeo
           r-matrix
           r-matrixmodels
           r-mvtnorm
           r-pbapply
           r-rcpp
           r-rcppeigen
           r-stringr))
    (native-inputs (list r-knitr r-testthat))
    (home-page "https://richarddmorey.github.io/BayesFactor/")
    (synopsis "Computation of Bayes factors for common designs")
    (description
     "This package provides a suite of functions for computing various Bayes
factors for simple designs, including contingency tables, one- and two-sample
designs, one-way designs, general ANOVA designs, and linear regression.")
    (license license:gpl2)))

(define-public r-bbmisc
  (package
    (name "r-bbmisc")
    (version "1.13")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "BBmisc" version))
       (sha256
        (base32
         "01a43raxj374cg6khs14r0bxvfm8v1sp0p2ambp7npnizvwxqi8i"))))
    (properties
     '((upstream-name . "BBmisc")
       (updater-extra-native-inputs . ("r-codetools"))))
    (build-system r-build-system)
    (propagated-inputs
     (list r-checkmate r-data-table))
    (native-inputs (list r-codetools r-testthat))
    (home-page "https://github.com/berndbischl/BBmisc")
    (synopsis "Miscellaneous functions for R package development")
    (description
     "This package provides miscellaneous helper functions for the development
of R packages.")
    (license license:bsd-3)))

(define-public r-beepr
  (package
    (name "r-beepr")
    (version "2.0")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "beepr" version))
       (sha256
        (base32 "0xq4qs06f61m1q6gb157n4c3j7pf7wanh27nr2lr228s7k4mw3k2"))))
    (properties `((upstream-name . "beepr")))
    (build-system r-build-system)
    (propagated-inputs (list r-audio))
    (native-inputs (list r-testthat))
    (home-page "https://github.com/rasmusab/beepr")
    (synopsis "Easily play notification sounds on any platform")
    (description
     "The main function of this package is @code{beep()}, with the purpose to
make it easy to play notification sounds on whatever platform you are on.  It
is intended to be useful, for example, if you are running a long analysis in
the background and want to know when it is ready.")
    (license license:gpl3)))

(define-public r-beeswarm
  (package
    (name "r-beeswarm")
    (version "0.4.0")
    (source (origin
              (method url-fetch)
              (uri (cran-uri "beeswarm" version))
              (sha256
               (base32
                "016mqcbdksialkmap56rprzna9b6cd6896ml9gl2n2h8yjdk7x2i"))))
    (build-system r-build-system)
    (home-page "https://www.cbs.dtu.dk/~eklund/beeswarm/")
    (synopsis "Implementation of bee swarm plots")
    (description
     "This package provides an implementation of bee swarm plots.  The bee
swarm plot is a one-dimensional scatter plot like stripchart, but with
closely-packed, non-overlapping points.")
    (license license:artistic2.0)))

(define-public r-betareg
  (package
    (name "r-betareg")
    (version "3.2-3")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "betareg" version))
       (sha256
        (base32 "0iizgzlsk4gm6pjb4i4qwcig2c4crngxkrmdasnr0qzc0piq5dnw"))))
    (properties
     '((upstream-name . "betareg")
       (updater-extra-native-inputs . ("r-partykit"))))
    (build-system r-build-system)
    ;; Vignettes need r-quarto.
    (arguments (list #:test-types '(list "tests")))
    (propagated-inputs (list r-flexmix r-formula r-lmtest r-modeltools
                             r-sandwich))
    (native-inputs (list r-partykit r-quarto))
    (home-page "https://topmodels.R-Forge.R-project.org/betareg/")
    (synopsis "Beta regression")
    (description
     "This package implements beta regression for modeling beta-distributed
dependent variables on the open unit interval (0, 1), e.g., rates and
proportions, see Cribari-Neto and Zeileis (2010) <doi:10.18637/jss.v034.i02>.
Moreover, extended-support beta regression models can accommodate dependent
variables with boundary observations at 0 and/or 1.  For the classical beta
regression model, alternative specifications are provided: Bias-corrected and
bias-reduced estimation, finite mixture models, and recursive partitioning for
beta regression, see <doi:10.18637/jss.v048.i11>.")
    (license (list license:gpl2 license:gpl3))))

(define-public r-bh
  (package
    (name "r-bh")
    (version "1.87.0-1")
    (source (origin
              (method url-fetch)
              (uri (cran-uri "BH" version))
              (sha256
               (base32
                "14q3wq9aix8fsbd09dj3nbhh89wpbxzn2l8wk8l26apl6pk9m0jr"))))
    (build-system r-build-system)
    (home-page "https://github.com/eddelbuettel/bh")
    (synopsis "R package providing subset of Boost headers")
    (description
     "This package aims to provide the most useful subset of Boost libraries
for template use among CRAN packages.")
    (license license:boost1.0)))

(define-public r-biased-urn
  (package
   (name "r-biased-urn")
   (version "2.0.12")
   (source
    (origin
     (method url-fetch)
     (uri (cran-uri "BiasedUrn" version))
     (sha256
      (base32
       "14jpijms81pgl4zyqrhwwdfj0jmlmml21blspvin8lqw8fbbbcr9"))))
   (properties `((upstream-name . "BiasedUrn")))
   (build-system r-build-system)
   (home-page "https://www.agner.org/random/")
   (synopsis "Biased urn model distributions")
   (description
    "This package provides statistical models of biased sampling in the form
of univariate and multivariate noncentral hypergeometric distributions,
including Wallenius' noncentral hypergeometric distribution and Fisher's
noncentral hypergeometric distribution (also called extended hypergeometric
distribution).")
   (license license:gpl3+)))

(define-public r-bigassertr
  (package
    (name "r-bigassertr")
    (version "0.1.6")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "bigassertr" version))
       (sha256
        (base32 "0bk11jinlc1cvm6aaq9mccs9i328b8s2lbwq63a42fgf1qng103p"))))
    (properties `((upstream-name . "bigassertr")))
    (build-system r-build-system)
    (native-inputs (list r-testthat))
    (home-page "https://github.com/privefl/bigassertr")
    (synopsis "Assertion and message functions")
    (description
     "This package provides enhanced message functions @code{(cat()} /
@code{message()} / @code{warning()} / @code{error()}) using wrappers around
@code{sprintf()}.  It also provides multiple assertion functions (e.g. to
check class, length, values, files, arguments, etc.).")
    (license license:gpl3)))

(define-public r-bigmemory
  (package
    (name "r-bigmemory")
    (version "4.6.4")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "bigmemory" version))
       (sha256
        (base32
         "0b80c2nsgphgr3cnvf75a0z3bzqx4q1a4dplq0h2izc71mn5fgzy"))))
    (build-system r-build-system)
    (propagated-inputs
     (list r-bh r-bigmemory-sri r-rcpp r-uuid))
    (inputs
     (list `(,util-linux "lib"))) ;for -luuid
    (native-inputs (list r-testthat))
    (supported-systems
     (fold delete
           %supported-systems
           ;; Build fails on these systems
           '("armhf-linux"
             "aarch64-linux"
             "powerpc64le-linux")))
    (home-page "http://www.bigmemory.org")
    (synopsis "Manage large matrices with shared memory or memory-mapped files")
    (description "This package provides methods to create, store, access, and
manipulate large matrices.  Matrices are allocated to shared memory and may use
memory-mapped files.")
    ;; Users can choose either LGPLv3 or ASL2.0.
    (license (list license:lgpl3 license:asl2.0))))

(define-public r-bigmemory-sri
  (package
    (name "r-bigmemory-sri")
    (version "0.1.8")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "bigmemory.sri" version))
       (sha256
        (base32 "0wbpk3naipl0ab3wnixnp2n874kazrapv1c31fi3cxm19b94x6h2"))))
    (properties
     `((upstream-name . "bigmemory.sri")))
    (build-system r-build-system)
    (home-page "https://cran.r-project.org/web/packages/bigmemory.sri")
    (synopsis "Shared resource interface for the bigmemory package")
    (description "This package provides a shared resource interface for the
bigmemory and synchronicity packages.")
    ;; Users can choose either LGPLv3 or ASL2.0.
    (license (list license:lgpl3 license:asl2.0))))

(define-public r-bigparallelr
  (package
    (name "r-bigparallelr")
    (version "0.3.2")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "bigparallelr" version))
       (sha256
        (base32 "14rkcig4j93c231sfm43331ykmvxjx2fiz5nhblj2rfzkxli4css"))))
    (properties `((upstream-name . "bigparallelr")))
    (build-system r-build-system)
    (propagated-inputs (list r-bigassertr
                             r-doparallel
                             r-flock
                             r-foreach
                             r-parallelly
                             r-rhpcblasctl))
    (native-inputs (list r-testthat))
    (home-page "https://github.com/privefl/bigparallelr")
    (synopsis "Easy parallel tools")
    (description
     "This package provides utility functions for easy parallelism in R.  This
includes some reexports from other packages, utility functions for splitting
and parallelizing over blocks, and choosing and setting the number of cores
used.")
    (license license:gpl3)))

(define-public r-bigreadr
  (package
    (name "r-bigreadr")
    (version "0.2.5")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "bigreadr" version))
       (sha256
        (base32 "15wy5rphk2l59k8fk68a15xsvy8nxj1srnc2c86i7y5ym04a856k"))))
    (properties `((upstream-name . "bigreadr")))
    (build-system r-build-system)
    (arguments (list #:tests? #false)) ;tests attempt to read from GitHub.
    (propagated-inputs (list r-bigassertr r-data-table r-parallelly r-rcpp))
    (native-inputs (list r-spelling r-testthat))
    (home-page "https://github.com/privefl/bigreadr")
    (synopsis "Read large text files")
    (description
     "Read large text files by splitting them in smaller files.  This package
also provides some convenient wrappers around @code{fread()} and
@code{fwrite()} from package @code{data.table}.")
    (license license:gpl3)))

(define-public r-bigstatsr
  (package
    (name "r-bigstatsr")
    (version "1.6.1")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "bigstatsr" version))
       (sha256
        (base32 "1c445mm11gsvs2sqmrblig1d3456vwb1n3rz08mhkpxghjaf4dci"))))
    (properties `((upstream-name . "bigstatsr")))
    (build-system r-build-system)
    (propagated-inputs (list r-bigassertr
                             r-bigparallelr
                             r-cowplot
                             r-foreach
                             r-ggplot2
                             r-ps
                             r-rcpp
                             r-rcpparmadillo
                             r-rmio
                             r-rspectra
                             r-tibble))
    (native-inputs (list r-bigmemory
                         r-bigreadr
                         r-dplyr
                         r-modelmetrics
                         r-ppcor
                         r-psychometric
                         r-spelling
                         r-testthat))
    (home-page "https://privefl.github.io/bigstatsr/")
    (synopsis "Statistical tools for file-backed big matrices")
    (description
     "This package aims to provide easy-to-use, efficient, flexible and
scalable statistical tools.  It provides and uses file-backed big matrices via
memory-mapping.  It provides for instance matrix operations, Principal
Component Analysis, sparse linear supervised models, utility functions and
more.")
    (license license:gpl3)))

(define-public r-binom
  (package
    (name "r-binom")
    (version "1.1-1.1")
    (source
      (origin
        (method url-fetch)
        (uri (cran-uri "binom" version))
        (sha256
          (base32 "1yxyhsd0savwirlmgnq6973slfakqyfvjm0zz60cmc9v490my8gf"))))
    (properties `((upstream-name . "binom")))
    (build-system r-build-system)
    (home-page "https://cran.r-project.org/package=binom")
    (synopsis "Binomial confidence intervals for several parameterizations")
    (description
      "Constructs confidence intervals on the probability of success in a
binomial experiment via several parameterizations")
    (license (list license:gpl2+ license:gpl3+))))

(define-public r-bit
  (package
    (name "r-bit")
    (version "4.6.0")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "bit" version))
       (sha256
        (base32
         "026y8la4g4nyflh4w8zvlwqwdh4m8c3n1ssyd56p4yscs32j3zj8"))))
    (build-system r-build-system)
    ;; Tests require r-ff, which depends on this package.
    (arguments (list #:tests? #false))
    (native-inputs
     (list r-knitr r-rmarkdown r-testthat))
    (home-page "https://ff.r-forge.r-project.org")
    (synopsis "Class for vectors of 1-bit booleans")
    (description
     "This package provides bitmapped vectors of booleans (no @code{NA}s),
coercion from and to logicals, integers and integer subscripts, fast boolean
operators and fast summary statistics.  With @code{bit} class vectors of true
binary booleans, @code{TRUE} and @code{FALSE} can be stored with 1 bit only.")
    (license license:gpl2)))

(define-public r-bit64
  (package
    (name "r-bit64")
    (version "4.6.0-1")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "bit64" version))
       (sha256
        (base32
         "1dqr2g43rhiryzgpfsjb7mb4idnz2jl31jdsvjgrlb625wacxh7v"))))
    (build-system r-build-system)
    (propagated-inputs
     (list r-bit))
    (native-inputs (list r-testthat))
    (home-page "https://ff.r-forge.r-project.org/")
    (synopsis "S3 class for vectors of 64 bit integers")
    (description
     "The bit64 package provides serializable S3 atomic 64 bit (signed)
integers that can be used in vectors, matrices, arrays and @code{data.frames}.
Methods are available for coercion from and to logicals, integers, doubles,
characters and factors as well as many elementwise and summary functions.
Many fast algorithmic operations such as @code{match} and @code{order} support
interactive data exploration and manipulation and optionally leverage
caching.")
    (license license:gpl2)))

(define-public r-bitops
  (package
    (name "r-bitops")
    (version "1.0-9")
    (source (origin
              (method url-fetch)
              (uri (cran-uri "bitops" version))
              (sha256
               (base32
                "020dfk0pmiz739rnpb9yi8hnsih3z3891dljvs7kpfvjgfvsbwyg"))))
    (build-system r-build-system)
    (home-page "https://cran.r-project.org/web/packages/bitops")
    (synopsis "Bitwise operations")
    (description
     "This package provides functions for bitwise operations on integer
vectors.")
    (license license:gpl2+)))

(define-public r-blob
  (package
    (name "r-blob")
    (version "1.2.4")
    (source (origin
              (method url-fetch)
              (uri (cran-uri "blob" version))
              (sha256
               (base32
                "13vjy9f3zki8w1damz6kqq47689mk4l1navnwh7r6z8lqkmj52fh"))))
    (build-system r-build-system)
    (propagated-inputs
     (list r-rlang r-vctrs))
    (native-inputs (list r-testthat))
    (home-page "https://github.com/hadley/blob")
    (synopsis "Simple S3 Class for representing vectors of binary data")
    (description "Raw vectors in R are useful for storing a single binary
object.  What if you want to put a vector of them in a data frame?  The blob
package provides the blob object, a list of raw vectors, suitable for use as
a column in data frame.")
    (license license:gpl3+)))

(define-public r-bigd
  (package
    (name "r-bigd")
    (version "0.3.1")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "bigD" version))
       (sha256
        (base32 "1lc8c3g22sb3mkmr0vjw6x92cs04gdfsny1iii0v3xj9337v1cc6"))))
    (properties
     '((upstream-name . "bigD")
       (updater-extra-native-inputs . ("r-vctrs"))))
    (build-system r-build-system)
    (native-inputs (list r-testthat r-vctrs))
    (home-page "https://cran.r-project.org/package=bigD")
    (synopsis "Flexibly format dates and times to a given locale")
    (description
     "Format dates and times flexibly and to whichever locales make sense.
This package parses dates, times, and date-times in various formats (including
string-based ISO 8601 constructions).  The formatting syntax gives the user
many options for formatting the date and time output in a precise manner.
Time zones in the input can be expressed in multiple ways and there are many
options for formatting time zones in the output as well.  Several of the
provided helper functions allow for automatic generation of locale-aware
formatting patterns based on date/time skeleton formats and standardized
date/time formats with varying specificity.")
    (license license:expat)))

(define-public r-bma
  (package
    (name "r-bma")
    (version "3.18.20")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "BMA" version))
       (sha256
        (base32 "18rhz04ykd4gpf8wkj93x5q64ng0x44w7bakhjrsigrcpxnajwid"))))
    (properties `((upstream-name . "BMA")))
    (build-system r-build-system)
    (propagated-inputs (list r-inline r-leaps r-robustbase r-rrcov r-survival))
    (native-inputs (list gfortran r-mass))
    (home-page "https://github.com/hanase/BMA")
    (synopsis "Bayesian model averaging")
    (description
     "This is a package for Bayesian model averaging and variable selection
for linear models, generalized linear models and survival models (cox
regression).")
    (license license:gpl2+)))

(define-public r-boot
  (package
    (name "r-boot")
    (version "1.3-31")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "boot" version))
       (sha256
        (base32
         "1ln8079g7l6yxdh7bmcn2acjlln0hvrhhjbp5r0wl0xms662wm6q"))))
    (build-system r-build-system)
    (native-inputs (list r-survival))
    (home-page "https://cran.r-project.org/web/packages/boot")
    (synopsis "Bootstrap functions for R")
    (description
     "This package provides functions and datasets for bootstrapping from the
book \"Bootstrap Methods and Their Application\" by A.C. Davison and
D.V. Hinkley (1997, CUP), originally written by Angelo Canty for S.")
    ;; Unlimited distribution
    (license (license:non-copyleft "file://R/bootfuns.q"))))

(define-public r-box
  (package
    (name "r-box")
    (version "1.2.0")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "box" version))
       (sha256
        (base32 "00g5ik3f6260m38jl8k4s8nycmy7mzdwr7qslrl66phpg84xzmln"))))
    (properties `((upstream-name . "box")))
    (arguments
     ;; Tests don't work because of this error:
     ;; the ‘box’ package is not supposed to be attached!
     (list #:test-types '(list "vignettes")))
    (build-system r-build-system)
    (native-inputs (list r-knitr r-testthat))
    (home-page "https://klmr.me/box/")
    (synopsis "Write reusable, composable and modular R code")
    (description
     "This package provides a modern module system for R.  Organize code into
hierarchical, composable, reusable modules, and use it effortlessly across
projects via a flexible, declarative dependency loading syntax.")
    (license license:expat)))

(define-public r-bread
  (package
    (name "r-bread")
    (version "0.4.1")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "bread" version))
       (sha256
        (base32 "0vsxmqpgi2yjcpdpgdz6gzqkpjsq5ax4qkpys60bwmxyp1ahv90r"))))
    (properties `((upstream-name . "bread")))
    (build-system r-build-system)
    (arguments
     (list
      #:phases
      '(modify-phases %standard-phases
         (add-after 'unpack 'fix-locations
           (lambda* (#:key inputs #:allow-other-keys)
             (let ((gawk (search-input-file inputs "bin/gawk"))
                   (grep (search-input-file inputs "bin/grep"))
                   (head (search-input-file inputs "bin/head"))
                   (sed  (search-input-file inputs "bin/sed"))
                   (tail (search-input-file inputs "bin/tail"))
                   (wc   (search-input-file inputs "bin/wc")))
               (substitute* "R/helper_functions.R"
                 (("'grep ")
                  (string-append "'" grep " "))
                 (("'sed ")
                  (string-append "'" sed " "))
                 (("'tail ")
                  (string-append "'" tail " "))
                 (("'awk ")
                  (string-append "'" gawk " ")))
               (substitute* "R/bnrow.R"
                 (("'wc ")
                  (string-append "'" wc " ")))
               (substitute* "R/bsep.R"
                 (("'head ")
                  (string-append "'" head " ")))))))))
    (inputs (list coreutils gawk grep sed))
    (propagated-inputs (list r-data-table))
    (home-page "https://github.com/MagicHead99/bread/")
    (synopsis "Analyze big files without loading them in memory")
    (description
     "This package provides a simple set of wrapper functions for
@code{data.table::fread()} that allows subsetting or filtering rows and
selecting columns of table-formatted files too large for the available RAM.")
    (license license:gpl3+)))

(define-public r-brew
  (package
    (name "r-brew")
    (version "1.0-10")
    (source (origin
              (method url-fetch)
              (uri (cran-uri "brew" version))
              (sha256
               (base32
                "13x3vnrhfcvr479r4dya61a5vcky2gb4kv2xbivy0ah39qrzg0a1"))))
    (build-system r-build-system)
    (native-inputs (list r-testthat))
    (home-page "https://cran.r-project.org/web/packages/brew")
    (synopsis "Templating framework for report generation")
    (description
     "The brew package implements a templating framework for mixing text and R
code for report generation.  The template syntax is similar to PHP, Ruby's erb
module, Java Server Pages, and Python's psp module.")
    (license license:gpl2+)))

(define-public r-brio
  (package
    (name "r-brio")
    (version "1.1.5")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "brio" version))
       (sha256
        (base32
         "1f6hh7mck4bb1caivcvr6ms2pyqzzzawqyxjbgi9s0rrx8sj7wm9"))))
    (properties
     ;; We can't add testthat here because of a dependency cycle.
     '((updater-ignored-native-inputs . ("r-testthat"))
       (upstream-name . "brio")))
    (build-system r-build-system)
    ;; Tests require r-testthat, which uses r-brio as an input.
    (arguments (list #:tests? #false))
    (home-page "https://github.com/r-lib/brio")
    (synopsis "Basic R input output")
    (description
     "This package provides functions to handle basic input output.  These
functions always read and write UTF-8 (8-bit Unicode Transformation Format)
files and provide more explicit control over line endings.")
    (license license:expat)))

(define-public r-broom-helpers
  (package
    (name "r-broom-helpers")
    (version "1.21.0")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "broom.helpers" version))
       (sha256
        (base32 "1b3zk163fwkba8bfa08wrailapnh7iqvr02pv2nlwkyzk710rzja"))))
    (properties `((upstream-name . "broom.helpers")))
    (build-system r-build-system)
    ;; Tests require gtsummary, which cannot be packaged due to massive
    ;; amounts of minified JavaScript.
    (arguments (list #:test-types '(list "vignettes")))
    (propagated-inputs (list r-broom
                             r-cards
                             r-cli
                             r-dplyr
                             r-labelled
                             r-lifecycle
                             r-purrr
                             r-rlang
                             r-stringr
                             r-tibble
                             r-tidyr
                             r-tidyselect))
    (native-inputs (list r-knitr r-testthat))
    (home-page "https://larmarange.github.io/broom.helpers/")
    (synopsis "Helpers for Model Coefficients Tibbles")
    (description
     "This package provides suite of functions to work with regression model
@code{broom::tidy()} tibbles.  The suite includes functions to group
regression model terms by variable, insert reference and header rows for
categorical variables, add variable labels, and more.")
    (license license:gpl3+)))

(define-public r-ca
  (package
    (name "r-ca")
    (version "0.71.1")
    (source (origin
              (method url-fetch)
              (uri (cran-uri "ca" version))
              (sha256
               (base32
                "095lk7p2b9835hc3a03c4019wg0baf0dhz6c2vqpaq1m9k4jy304"))))
    (properties `((upstream-name . "ca")))
    (build-system r-build-system)
    (home-page "http://www.carme-n.org/")
    (synopsis "Simple, multiple and joint correspondence analysis")
    (description
     "This is a package for computation and visualization of simple,
multiple and joint correspondence analysis.")
    ;; Any version of the GPL
    (license license:gpl3+)))

(define-public r-cachem
  (package
    (name "r-cachem")
    (version "1.1.0")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "cachem" version))
       (sha256
        (base32
         "089f963h59z4n0sj3isjq2h7zw2485qw38jv8zdnbn755by3j22m"))))
    (properties `((upstream-name . "cachem")))
    (build-system r-build-system)
    (propagated-inputs
     (list r-fastmap r-rlang))
    (native-inputs (list r-testthat))
    (home-page "https://cachem.r-lib.org/")
    (synopsis "Cache R objects with automatic pruning")
    (description
     "This package provides key-value stores with automatic pruning.  Caches
can limit either their total size or the age of the oldest object (or both),
automatically pruning objects to maintain the constraints.")
    (license license:expat)))

(define-public r-caic4
  (package
    (name "r-caic4")
    (version "1.1")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "cAIC4" version))
       (sha256
        (base32 "0ixkhnsbpqx5pw0r3dvrwymbwr2k7xlv5gwp7cyd2rxafsqrp5m9"))))
    (properties `((upstream-name . "cAIC4")))
    (build-system r-build-system)
    (propagated-inputs (list r-lme4
                             r-matrix
                             r-mgcv
                             r-mvtnorm
                             r-nlme
                             r-rlrsim))
    (home-page "https://cran.r-project.org/package=cAIC4")
    (synopsis "Conditional AIC for lme4 and nlme")
    (description
     "This package estimates conditional Akaike information in mixed-effect
models.  These models are fitted using @code{(g)lmer()} from lme4,
@code{lme()} from nlme, and @code{gamm()} from mgcv.  The provided functions
facilitate the computation of the conditional Akaike information for model
evaluation.")
    (license license:gpl2+)))

(define-public r-cairo
  (package
    (name "r-cairo")
    (version "1.6-2")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "Cairo" version))
       (sha256
        (base32
         "0qjdsj6mpbwvnp8cimc4yrqfq3z68pfcd78ahsai52hpjdplqvvb"))))
    (properties `((upstream-name . "Cairo")))
    (build-system r-build-system)
    (inputs
     (list cairo harfbuzz icu4c libjpeg-turbo libtiff zlib))
    (native-inputs
     (list pkg-config))
    (home-page "https://www.rforge.net/Cairo/")
    (synopsis "R graphics device using Cairo graphics library")
    (description
     "This package provides a Cairo graphics device that can be use to create
high-quality vector (PDF, PostScript and SVG) and bitmap output (PNG, JPEG,
TIFF), and high-quality rendering in displays (X11 and Win32).  Since it uses
the same back-end for all output, copying across formats is WYSIWYG.  Files
are created without the dependence on X11 or other external programs.  This
device supports alpha channel (semi-transparent drawing) and resulting images
can contain transparent and semi-transparent regions.  It is ideal for use in
server environments (file output) and as a replacement for other devices that
don't have Cairo's capabilities such as alpha support or anti-aliasing.
Backends are modular such that any subset of backends is supported.")
    (license license:gpl2)))

(define-public r-car
  (package
    (name "r-car")
    (version "3.1-3")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "car" version))
       (sha256
        (base32 "1gs9prinmxn4l6w8lyig3mzm1j2zfq3yhkznm1igd5ar74jc1wjr"))))
    (build-system r-build-system)
    (propagated-inputs
     (list r-abind
           r-cardata
           r-formula
           r-lme4
           r-mass
           r-mgcv
           r-nlme
           r-nnet
           r-pbkrtest
           r-quantreg
           r-scales))
    (native-inputs (list r-knitr))
    (home-page "https://r-forge.r-project.org/projects/car/")
    (synopsis "Companion to applied regression")
    (description
     "This package provides functions and datasets from book Companion to
Applied regression, Second Edition, Sage, 2011.")
    (license license:gpl2+)))

(define-public r-cardata
  (package
    (name "r-cardata")
    (version "3.0-5")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "carData" version))
       (sha256
        (base32 "06j52rpbqi6fj7chfjwjbwbr6slrbb7i3aygv66gnfiyndcp3rq2"))))
    (properties `((upstream-name . "carData")))
    (build-system r-build-system)
    (home-page "https://r-forge.r-project.org/projects/car/")
    (synopsis "Data sets for the book Companion to Applied Regression")
    (description
     "This package provides datasets to accompany J. Fox and S. Weisberg, An R
Companion to Applied Regression, Third Edition, Sage.")
    (license license:gpl2+)))

(define-public r-cards
  (package
    (name "r-cards")
    (version "0.6.0")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "cards" version))
       (sha256
        (base32 "1g41i4nqkgzb1sv2f9hy06h0m2hmlcpqgc2ssjm2l7dcbgy5534f"))))
    (properties
     `((upstream-name . "cards")
       ;; Do not create dependency cycle.
       (updater-ignored-native-inputs . ("r-cardx"))))
    (build-system r-build-system)
    (propagated-inputs (list r-cli
                             r-dplyr
                             r-glue
                             r-lifecycle
                             r-rlang
                             r-tidyr
                             r-tidyselect))
    (native-inputs (list r-testthat r-withr))
    (home-page "https://github.com/insightsengineering/cards")
    (synopsis "Analysis Results Data")
    (description
     "This package lets you construct @dfn{Clinical Data Interchange Standards
Consortium} (CDISC) compliant Analysis Results Data objects.  These objects
are used and re-used to construct summary tables, visualizations, and written
reports.  The package also exports utilities for working with these objects
and creating new Analysis Results Data objects.")
    (license license:asl2.0)))

(define-public r-cardx
  (package
    (name "r-cardx")
    (version "0.2.4")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "cardx" version))
       (sha256
        (base32 "1qbfa2kbxbc7lnrajj79dgz2nkjf4616ngha1yk9fl6f10qmsk24"))))
    (properties
     '((upstream-name . "cardx")
       (updater-ignored-native-inputs . ("r-mixed"))))
    (build-system r-build-system)
    (propagated-inputs (list r-cards
                             r-cli
                             r-dplyr
                             r-glue
                             r-lifecycle
                             r-rlang
                             r-tidyr))
    (native-inputs (list r-broom
                         r-effectsize
                         r-emmeans
                         r-geepack
                         r-ggsurvfit
                         r-lme4
                         r-parameters
                         r-smd
                         r-survey
                         r-survival
                         r-testthat
                         r-withr))
    (home-page "https://insightsengineering.github.io/cardx/")
    (synopsis "Extra analysis results data utilities")
    (description
     "This package lets you create extra Analysis Results Data (ARD) summary
objects.  The package supplements the simple ARD functions from the
@code{cards} package, exporting functions to put statistical results in the
ARD format.  These objects are used and re-used to construct summary tables,
visualizations, and written reports.")
    (license license:asl2.0)))

(define-public r-castor
  (package
    (name "r-castor")
    (version "1.8.3")
    (source (origin
              (method url-fetch)
              (uri (cran-uri "castor" version))
              (sha256
               (base32
                "1hq6j8zvv01lbi8q2bcn2jz6xm1iv8lylsw20a9yaagw3xkvbgw2"))))
    (properties `((upstream-name . "castor")))
    (build-system r-build-system)
    (propagated-inputs (list r-jsonlite r-matrix r-naturalsort r-rcpp
                             r-rspectra))
    (home-page "https://cran.r-project.org/package=castor")
    (synopsis "Efficient phylogenetics on large trees")
    (description
     "This tool supports analyses on massive phylogenies comprising up to
millions of tips.  Functions include pruning, rerooting, calculation of
most-recent common ancestors, calculating distances from the tree root and
calculating pairwise distances.  In addition, this tool takes care of
calculation of phylogenetic signal and mean trait depth (trait conservatism),
ancestral state reconstruction and hidden character prediction of discrete
characters, simulating and fitting models of trait evolution, fitting and
simulating diversification models, dating trees, comparing trees, and
reading/writing trees in Newick format.")
    (license license:gpl2+)))

(define-public r-catools
  (package
    (name "r-catools")
    (version "1.18.3")
    (source (origin
              (method url-fetch)
              (uri (cran-uri "caTools" version))
              (sha256
               (base32
                "1n380hnddj29nrzsqf462a1h3xy55qk4q45i5287ffd2lx13j6z7"))))
    (properties `((upstream-name . "caTools")))
    (build-system r-build-system)
    (propagated-inputs
     (list r-bitops))
    (home-page "https://cran.r-project.org/web/packages/caTools")
    (synopsis
     "Various tools including functions for moving window statistics")
    (description
     "This package contains several basic utility functions including:
moving (rolling, running) window statistic functions, read/write for GIF and
ENVI binary files, fast calculation of AUC, LogitBoost classifier, base64
encoder/decoder, round-off-error-free sum and cumsum, etc.")
    (license license:gpl3+)))

(define-public r-cellranger
  (package
    (name "r-cellranger")
    (version "1.1.0")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "cellranger" version))
       (sha256
        (base32
         "16fgi3annn34c3cxi0pxf62mmmmxi21hp0zzlv7bkfsjqy4g4f2x"))))
    (build-system r-build-system)
    (propagated-inputs
     (list r-rematch r-tibble))
    (native-inputs (list r-knitr r-testthat))
    (home-page "https://github.com/rsheets/cellranger")
    (synopsis "Translate spreadsheet cell ranges to rows and columns")
    (description
     "This package provides helper functions to work with spreadsheets and the
@code{A1:D10} style of cell range specification.")
    (license license:expat)))

(define-public r-cftime
  (package
    (name "r-cftime")
    (version "1.6.2")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "CFtime" version))
       (sha256
        (base32 "1kb8q2g0685f4gyjn0bjay9zirkxwn8via4bdqdaiyph0qshc8hh"))))
    (properties
     '((upstream-name . "CFtime")
       ;; Avoid dependency cycle.
       (updater-ignored-native-inputs . ("r-ncdfcf"))
       (updater-extra-native-inputs . ("r-stringr"))))
    (build-system r-build-system)
    (propagated-inputs (list r-r6))
    (native-inputs (list r-knitr r-stringr r-testthat))
    (home-page "https://github.com/pvanlaake/CFtime")
    (synopsis "Using CF-compliant calendars with climate projection data")
    (description
     "This package provides support for all calendars as specified in the
@dfn{Climate and Forecast} (CF) Metadata Conventions for climate and
forecasting data.  The CF Metadata Conventions is widely used for distributing
files with climate observations or projections, including the @dfn{Coupled
Model Intercomparison Project} (CMIP) data used by climate change scientists
and the @dfn{Intergovernmental Panel on Climate Change} (IPCC).  This package
specifically allows the user to work with any of the CF-compliant
calendars (many of which are not compliant with POSIXt).  The CF time
coordinate is formally defined in the
@url{https://cfconventions.org/Data/cf-conventions/cf-conventions-1.12/cf-conventions.html#time-coordinate,CF
Metadata Conventions document}.")
    (license license:expat)))

(define-public r-chameleon
  (package
    (name "r-chameleon")
    (version "0.2-3")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "chameleon" version))
       (sha256
        (base32 "0a3azp0zaakpqqx0pp94hkj3vgb2apnf8gb5ga0as4i8lrn9dz8i"))))
    (properties `((upstream-name . "chameleon")))
    (build-system r-build-system)
    (propagated-inputs (list r-clue r-ggplot2 r-umap))
    (native-inputs (list r-knitr))
    (home-page "https://cran.r-project.org/package=chameleon")
    (synopsis "Automatic colors for multi-dimensional data")
    (description
     "This package lets you assign distinct colors to arbitrary
multi-dimensional data, considering its structure.")
    (license license:expat)))

(define-public r-changepoint
  (package
    (name "r-changepoint")
    (version "2.3")
    (source (origin
              (method url-fetch)
              (uri (cran-uri "changepoint" version))
              (sha256
               (base32
                "0bb8pcfwb8vjmg7n7giad1vi1s6ix486lcsb28zvxih7v04v1a0r"))))
    (properties `((upstream-name . "changepoint")))
    (build-system r-build-system)
    (propagated-inputs (list r-zoo))
    (native-inputs (list r-testthat r-vdiffr))
    (home-page "https://github.com/rkillick/changepoint/")
    (synopsis "Methods for changepoint detection")
    (description
     "Changepoint implements various mainstream and specialised changepoint
methods.  These methods are suitable for finding single and multiple
changepoints within data.  Many popular non-parametric and frequentist methods
are included as well.")
    ;; Any version of the GPL.
    (license license:gpl3+)))

(define-public r-checkmate
  (package
    (name "r-checkmate")
    (version "2.3.2")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "checkmate" version))
       (sha256
        (base32
         "1qw81bs3lhwr1m6wlbs0l0j669051n60x4ca2821599ddhnp6mbj"))))
    (build-system r-build-system)
    (propagated-inputs
     (list r-backports))
    (native-inputs
     (list r-knitr r-testthat))
    (home-page "https://github.com/mllg/checkmate")
    (synopsis "Fast and versatile argument checks")
    (description
     "This package provides tests and assertions to perform frequent argument
checks.  A substantial part of the package was written in C to minimize any
worries about execution time overhead.")
    (license license:bsd-3)))

(define-public r-chorddiag
  (package
    (name "r-chorddiag")
    (version "0.1.3")
    (source
     (origin
       (method git-fetch)
       (uri (git-reference
             (url "https://github.com/mattflor/chorddiag")
             (commit (string-append "v" version))))
       (file-name (git-file-name name version))
       (sha256
        (base32
         "1bpy9q861l1hyyiqbx2f7qzp7j7im8bkcfdwgxzk5fm0250p359a"))
       ;; Delete minified JavaScript file
       (snippet
        '(delete-file "inst/htmlwidgets/lib/d3/d3.min.js"))))
    (build-system r-build-system)
    (arguments
     `(#:phases
       (modify-phases %standard-phases
         (add-after 'unpack 'process-javascript
           (lambda* (#:key inputs #:allow-other-keys)
             (with-directory-excursion "inst/htmlwidgets/lib/d3"
               (let ((source (assoc-ref inputs "d3.v4.js"))
                     (target "d3.min.js"))
                 (format #true "Processing ~a --> ~a~%"
                         source target)
                 (invoke "esbuild" source "--minify"
                         (string-append "--outfile=" target)))))))))
    (propagated-inputs
     (list r-htmlwidgets r-rcolorbrewer))
    (native-inputs
     `(("esbuild" ,esbuild)
       ("r-knitr" ,r-knitr)
       ("d3.v4.js"
        ,(origin
           (method url-fetch)
           (uri "https://d3js.org/d3.v4.js")
           (sha256
            (base32
             "0y7byf6kcinfz9ac59jxc4v6kppdazmnyqfav0dm4h550fzfqqlg"))))))
    (home-page "https://github.com/mattflor/chorddiag")
    (synopsis "Create D3 chord diagram")
    (description
     "This package provides tools to create interactive chords diagrams via
the D3 Javascript library.  Chord diagrams show directed relationships among a
group of entities.  This package is based on
@url{http://bl.ocks.org/mbostock/4062006} with some modifications (fading) and
additions (tooltips, bipartite diagram type).")
    (license license:gpl3+)))

(define-public r-chron
  (package
    (name "r-chron")
    (version "2.3-62")
    (source (origin
              (method url-fetch)
              (uri (cran-uri "chron" version))
              (sha256
               (base32
                "18dyy4fn48d4m7azqbqpazhvy9mwl1k494zl7gxckfrx4ivjrb87"))))
    (build-system r-build-system)
    (home-page "https://cran.r-project.org/web/packages/chron")
    (synopsis "Chronological R objects which can handle dates and times")
    (description
     "This package provides chronological R objects which can handle dates and
times.")
    (license license:gpl2)))

(define-public r-clubsandwich
  (package
    (name "r-clubsandwich")
    (version "0.6.0")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "clubSandwich" version))
       (sha256
        (base32
         "025njaxmf0pa3lzrxkffj219rs3wyfp59q52h1v6hwbxa48gh7hg"))))
    (properties `((upstream-name . "clubSandwich")))
    (build-system r-build-system)
    (propagated-inputs
     (list r-lifecycle r-sandwich))
    (native-inputs
     ;; There are lots of optional test inputs, but these two are enough.
     (list r-knitr r-testthat))
    (home-page "https://github.com/jepusto/clubSandwich")
    (synopsis
     "Cluster-robust (Sandwich) variance estimators with small-sample corrections")
    (description
     "This package provides several cluster-robust variance estimators (i.e.,
sandwich estimators) for ordinary and weighted least squares linear regression
models, including the bias-reduced linearization estimator introduced by Bell
and McCaffrey (2002)
@url{http://www.statcan.gc.ca/pub/12-001-x/2002002/article/9058-eng.pdf} and
developed further by Pustejovsky and Tipton (2017)
@url{doi:10.1080/07350015.2016.1247004}.  The package includes functions for
estimating the variance- covariance matrix and for testing single- and
multiple-contrast hypotheses based on Wald test statistics.  Tests of single
regression coefficients use Satterthwaite or saddle-point corrections.  Tests
of multiple-contrast hypotheses use an approximation to Hotelling's T-squared
distribution.  Methods are provided for a variety of fitted models, including
@code{lm()} and @code{mlm} objects, @code{glm()}, ivreg (from package
@code{AER}), @code{plm()} (from package @code{plm}), @code{gls()} and
@code{lme()} (from @code{nlme}), @code{robu()} (from @code{robumeta}), and
@code{rma.uni()} and @code{rma.mv()} (from @code{metafor}).")
    (license license:gpl3)))

(define-public r-celestial
  (package
    (name "r-celestial")
    (version "1.4.6")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "celestial" version))
       (sha256
        (base32 "1gls0qvr8mxz79lsmk76v253f747g0cqys8p8wjmpijs8r0pyr4z"))))
    (properties `((upstream-name . "celestial")))
    (build-system r-build-system)
    (propagated-inputs (list r-nistunits r-pracma r-rann))
    (home-page "https://cran.r-project.org/package=celestial")
    (synopsis
     "Collection of common astronomical conversion routines and functions")
    (description
     "This package contains a number of common astronomy conversion routines,
particularly the HMS and degrees schemes, which can be fiddly to convert between
on mass due to the textural nature of the former.  It allows users to coordinate
match datasets quickly.  It also contains functions for various cosmological
calculations.")
    (license license:gpl3)))

(define-public r-censreg
  (package
    (name "r-censreg")
    (version "0.5-38")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "censReg" version))
       (sha256
        (base32 "1rrgvq883970zp311lmkvxxky29w48p54xa4hq7iaa33yq7dbmmb"))))
    (properties `((upstream-name . "censReg")))
    (build-system r-build-system)
    (propagated-inputs (list r-glmmml r-maxlik r-misctools r-plm r-sandwich))
    (native-inputs (list r-aer))
    (home-page "http://www.sampleSelection.org")
    (synopsis "Censored regression (Tobit) models")
    (description
     "This is a package for maximum likelihood estimation of censored
regression (Tobit) models with cross-sectional and panel data.")
    (license license:gpl2+)))

(define-public r-cetcolor
  (package
    (name "r-cetcolor")
    (version "0.2.0")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "cetcolor" version))
       (sha256
        (base32 "0kygdcr9ldanr0z4qpygwh0padki7s2ad0j6myky601g4228z79q"))))
    (properties `((upstream-name . "cetcolor")))
    (build-system r-build-system)
    (native-inputs (list r-knitr))
    (home-page "https://github.com/coatless-rpkg/cetcolor")
    (synopsis "CET perceptually uniform color maps")
    (description
     "This package provides a collection of perceptually uniform color maps
made by Peter Kovesi (2015) \"Good Colour Maps: How to Design Them\"
<arXiv:1509.03700> at the Centre for Exploration Targeting (CET).")
    (license license:cc-by-sa4.0)))

;; The package sources include multiple non-minified JavaScript files and the
;; v5.1.0 variant of d3.js.  The d3.js file is not minified.
(define-public r-chromomap
  (package
    (name "r-chromomap")
    (version "4.1.1")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "chromoMap" version))
       (sha256
        (base32 "1067h5d6jdbm811n7ayikhqfbcqmxbz5jgp05vf1sbln7qgn9l43"))))
    (properties `((upstream-name . "chromoMap")))
    (build-system r-build-system)
    (propagated-inputs (list r-htmltools r-htmlwidgets))
    (native-inputs (list r-knitr))
    (home-page "https://cran.r-project.org/package=chromoMap")
    (synopsis "Interactive genomic visualization of biological data")
    (description
     "This package provides interactive, configurable and graphics
visualization of the chromosome regions of any living organism allowing users
to map chromosome elements (like genes, SNPs etc.) on the chromosome plot.  It
introduces a special plot viz. the \"chromosome heatmap\" that, in addition to
mapping elements, can visualize the data associated with chromosome
elements (like gene expression) in the form of heat colors.  Users can
investigate the detailed information about the mappings (like gene names or
total genes mapped on a location) or can view the magnified single or double
stranded view of the chromosome at a location showing each mapped element in
sequential order.  The package provide multiple features like visualizing
multiple sets, chromosome heat-maps, group annotations, adding hyperlinks, and
labelling.  The plots can be saved as HTML documents that can be customized
and shared easily.  In addition, you can include them in R Markdown or in R
Shiny applications.")
    (license (list license:gpl3
                   license:isc)))) ;for bundled d3js

(define-public r-coda
  (package
    (name "r-coda")
    (version "0.19-4.1")
    (source (origin
              (method url-fetch)
              (uri (cran-uri "coda" version))
              (sha256
               (base32
                "1mlaf3ffql3phc12vlfss0vqqdj415mxsg84vsdgymmvdzc53d7l"))))
    (build-system r-build-system)
    (propagated-inputs
     (list r-lattice))
    (home-page "https://cran.r-project.org/web/packages/coda")
    (synopsis "Package for output analysis and diagnostics for MCMC")
    (description "This package provides functions for summarizing and plotting
the output from Markov Chain Monte Carlo (MCMC) simulations, as well as
diagnostic tests of convergence to the equilibrium distribution of the Markov
chain.")
    (license license:gpl2+)))

(define-public r-codetools
  (package
    (name "r-codetools")
    (version "0.2-20")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "codetools" version))
       (sha256
        (base32
         "0qx8zrlickl45wzzbydsbx5f1vmzhn71x7amzpfj71qpxisz7riv"))))
    (build-system r-build-system)
    (home-page "https://cran.r-project.org/web/packages/codetools")
    (synopsis "Code analysis tools for R")
    (description "This package provides code analysis tools for R to check R
code for possible problems.")
    ;; Any version of the GPL.
    (license (list license:gpl2+ license:gpl3+))))

(define-public r-colorout
  (package
    (name "r-colorout")
    (version "1.2-2")
    (source
     (origin
       (method git-fetch)
       (uri (git-reference
             (url "https://github.com/jalvesaq/colorout")
             (commit (string-append "v" version))))
       (file-name (git-file-name name version))
       (sha256
        (base32 "1rsx69wjpa73c6x2hacvvvbzdzxn7wg06gizf97kasjdlb7azmp3"))))
    (build-system r-build-system)
    (home-page "https://github.com/jalvesaq/colorout")
    (synopsis "Colorize output in the R REPL")
    (description "@code{colorout} is an R package that colorizes R output when
running in terminal emulator.

R STDOUT is parsed and numbers, negative numbers, dates in the standard
format, strings, and R constants are identified and wrapped by special ANSI
scape codes that are interpreted by terminal emulators as commands to colorize
the output.  R STDERR is also parsed to identify the expressions warning and
error and their translations to many languages.  If these expressions are
found, the output is colorized accordingly; otherwise, it is colorized as
STDERROR (blue, by default).

You can customize the colors according to your taste, guided by the color
table made by the command @code{show256Colors()}.  You can also set the colors
to any arbitrary string.  In this case, it is up to you to set valid values.")
    (license license:gpl3+)))

(define-public r-colorsgen
  (package
    (name "r-colorsgen")
    (version "1.0.0")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "colorsGen" version))
       (sha256
        (base32 "0w4qkl4fw7pjfcd2z3nhpkxh8kv3bbq19bi2cg0ivfr83kxa44fj"))))
    (properties `((upstream-name . "colorsGen")))
    (build-system r-build-system)
    (propagated-inputs (list r-colorspace))
    (home-page "https://github.com/stla/colorsGen")
    (synopsis "Generation of random colors")
    (description
     "This package lets you generate random colors, possibly with a given hue
or a given luminosity.")
    (license license:cc0)))

(define-public r-commonmark
  (package
    (name "r-commonmark")
    (version "1.9.5")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "commonmark" version))
       (sha256
        (base32
         "0radgpdvpzhw3615jmjac7vhqnq0j6dfi9avhw4q4zz12vwrdgzs"))))
    (properties
     ;; We can't have r-testthat among the inputs here to avoid a dependency
     ;; cycle.
     '((updater-ignored-native-inputs . ("r-testthat"))))
    (build-system r-build-system)
    (arguments (list #:tests? #false))
    (home-page "https://cran.r-project.org/web/packages/commonmark")
    (synopsis "CommonMark and Github Markdown rendering in R")
    (description
     "The CommonMark specification defines a rationalized version of markdown
syntax.  This package uses the @code{cmark} reference implementation for
converting markdown text into various formats including HTML, LaTeX and groff
man.  In addition, it exposes the markdown parse tree in XML format.  The
latest version of this package also adds support for Github extensions
including tables, autolinks and strikethrough text.")
    (license license:bsd-2)))

(define-public r-compquadform
  (package
    (name "r-compquadform")
    (version "1.4.3")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "CompQuadForm" version))
       (sha256
        (base32
         "1i30hrqdk64q17vsn918c3q79brchgx2wzh1gbsgbn0dh1ncabq4"))))
    (properties `((upstream-name . "CompQuadForm")))
    (build-system r-build-system)
    (home-page "https://cran.r-project.org/web/packages/CompQuadForm")
    (synopsis "Distribution function of quadratic forms in normal variables")
    (description
     "This package provides functions to compute the distribution function of
quadratic forms in normal variables using Imhof's method, Davies's algorithm,
Farebrother's algorithm or Liu et al.'s algorithm.")
    (license license:gpl2+)))

(define-public r-consort
  (package
    (name "r-consort")
    (version "1.2.2")
    (source (origin
              (method url-fetch)
              (uri (cran-uri "consort" version))
              (sha256
               (base32
                "12gr1diyy2azy1fbh8z129lkm0ahwvm98j5hqxv93yp089a02l8c"))))
    (properties `((upstream-name . "consort")))
    (build-system r-build-system)
    (native-inputs (list r-knitr r-testthat))
    (home-page "https://github.com/adayim/consort/")
    (synopsis "Create Consort Diagrams")
    (description
     "To make it easy to create CONSORT diagrams for the transparent reporting of
participant allocation in randomized, controlled clinical trials.  This is done
by creating a standardized disposition data, and using this data as the source
for the creation a standard CONSORT diagram.  Human effort by supplying text
labels on the node can also be achieved.")
    (license license:expat)))

(define-public r-collapse
  (package
    (name "r-collapse")
    (version "2.1.2")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "collapse" version))
       (sha256
        (base32 "0qffq6gzh3yslj0zjkvsc7cz5wlczlpm6ag47cjszyjzb4wh2qiq"))))
    (properties `((upstream-name . "collapse")))
    (build-system r-build-system)
    (propagated-inputs (list r-rcpp))
    (native-inputs (list r-bit64
                         r-data-table
                         r-dplyr
                         r-fixest
                         r-kit
                         r-knitr
                         r-magrittr
                         r-matrixstats
                         r-testthat
                         r-withr
                         r-zoo))
    (home-page "https://sebkrantz.github.io/collapse/")
    (synopsis "Advanced and fast data transformation")
    (description
     "This is a C/C++ based package for advanced data transformation and
statistical computing in R that is extremely fast, class-agnostic, robust and
programmer friendly.  Core functionality includes a rich set of S3 generic
grouped and weighted statistical functions for vectors, matrices and data
frames, which provide efficient low-level vectorizations, @code{OpenMP}
multithreading, and skip missing values by default.  These are integrated with
fast grouping and ordering algorithms (also callable from C), and efficient
data manipulation functions.  The package also provides a flexible and
rigorous approach to time series and panel data in R.  It further includes
fast functions for common statistical procedures, detailed (grouped, weighted)
summary statistics, powerful tools to work with nested data, fast data object
conversions, functions for memory efficient R programming, and helpers to
effectively deal with variable labels, attributes, and missing data.")
    (license (list license:gpl2+))))

(define-public r-collections
  (package
    (name "r-collections")
    (version "0.3.8")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "collections" version))
       (sha256
        (base32 "0dlz7x68gynvc4bk13a05vjzxb0d71km4133qxz912azjw9ik5ql"))))
    (properties `((upstream-name . "collections")))
    (build-system r-build-system)
    (native-inputs (list r-testthat))
    (home-page "https://github.com/randy3k/collections")
    (synopsis "High performance container data types")
    (description
     "This package provides high performance container data types such as
queues, stacks, deques, dicts and ordered dicts.")
    (license license:expat)))

(define-public r-correlation
  (package
    (name "r-correlation")
    (version "0.8.7")
    (source (origin
              (method url-fetch)
              (uri (cran-uri "correlation" version))
              (sha256
               (base32
                "0r0mvhmywzic3dfx49y1z9pbkwm3mwy9k6f04ywidi04sk759za0"))))
    (properties `((upstream-name . "correlation")))
    (build-system r-build-system)
    (propagated-inputs (list r-bayestestr r-datawizard r-insight r-parameters))
    (native-inputs
     ;; The importer/updater adds a lot of optional inputs, that we can
     ;; happily do without.
     (list r-knitr r-testthat))
    (home-page "https://easystats.github.io/correlation/")
    (synopsis "Methods for correlation analysis")
    (description
     "This is a lightweight package for computing different kinds of
correlations.  These correlations include partial correlations, Bayesian
correlations, multilevel correlations, polychoric correlations, biweight
correlations, distance correlations and more.")
    (license license:gpl3)))

(define-public r-cosinor
  (package
    (name "r-cosinor")
    (version "1.2.3")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "cosinor" version))
       (sha256
        (base32 "0nyvzmqk0rhx10fki29hcrz014bv3r40adqd5d6rbcz66kc4sjy3"))))
    (properties `((upstream-name . "cosinor")))
    (build-system r-build-system)
    (propagated-inputs (list r-ggplot2 r-shiny))
    (native-inputs (list r-knitr))
    (home-page "https://github.com/sachsmc/cosinor")
    (synopsis "Tools for estimating and predicting the Cosinor model")
    (description
     "This package provides a set of simple functions that transforms
longitudinal data to estimate the cosinor linear model as described in
Tong (1976).  Methods are given to summarize the mean, amplitude and
acrophase, to predict the mean annual outcome value, and to test the
coefficients.")
    (license license:expat)))

(define-public r-cosinor2
  (package
    (name "r-cosinor2")
    (version "0.2.1")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "cosinor2" version))
       (sha256
        (base32 "1pp0z86fflqkkllfrzx3vj98kzxjwnawr4a2d8z5q6zhq6v5qrvf"))))
    (properties `((upstream-name . "cosinor2")))
    (build-system r-build-system)
    (propagated-inputs (list r-cosinor
                             r-cowplot
                             r-ggplot2
                             r-hmisc
                             r-magrittr
                             r-matrixstats
                             r-purrr
                             r-scales
                             r-stringr))
    (native-inputs (list r-knitr))
    (home-page "https://github.com/amutak/cosinor2")
    (synopsis "Extended tools for Cosinor analysis of rhythms")
    (description
     "This package provides statistical procedures for calculating
population-mean cosinor, non-stationary cosinor, estimation of best-fitting
period, tests of population rhythm differences and more.")
    (license license:gpl3)))

(define-public r-countrycode
  (package
    (name "r-countrycode")
    (version "1.6.1")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "countrycode" version))
       (sha256
        (base32 "051j7va5qv46qf9543nscinxibk2mz3sxgbfpniwi9qyjh3878s5"))))
    (properties `((upstream-name . "countrycode")))
    (build-system r-build-system)
    (native-inputs (list r-testthat r-tibble r-utf8))
    (home-page "https://vincentarelbundock.github.io/countrycode/")
    (synopsis "Convert country names and country codes")
    (description
     "This package lets you standardize country names, convert them into one
of 40 different coding schemes, convert between coding schemes, and assign
region descriptors.")
    (license license:gpl3)))

(define-public r-cowplot
  (package
    (name "r-cowplot")
    (version "1.1.3")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "cowplot" version))
       (sha256
        (base32
         "0wxjynpbamyimpms7psbac7xgwswzlidczpc037q20y5yld9fml7"))))
    (build-system r-build-system)
    (propagated-inputs
     (list r-ggplot2 r-gtable r-rlang r-scales))
    (native-inputs
     (list r-knitr r-testthat))
    (home-page "https://github.com/wilkelab/cowplot")
    (synopsis "Streamlined plot theme and plot annotations for ggplot2")
    (description
     "This package provides some helpful extensions and modifications to the
ggplot2 package to combine multiple ggplot2 plots into one and label them with
letters, as is often required for scientific publications.")
    (license license:gpl2)))

(define-public r-cplm
  (package
    (name "r-cplm")
    (version "0.7-12.1")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "cplm" version))
       (sha256
        (base32 "0z99fnmadjpx7d41p575dypy3pgsxxzani9npyishv5719hw35cf"))))
    (properties `((upstream-name . "cplm")))
    (build-system r-build-system)
    (arguments
     (list
      #:phases
      '(modify-phases %standard-phases
         ;; GET_SLOT is only found in Rdefines.h
         (add-after 'unpack 'compatibility
           (lambda _
             (substitute* "src/common.h"
               (("#include <Rinternals.h>" m)
                (string-append m "\n#include <Rdefines.h>"))))))))
    (propagated-inputs
     (list r-biglm
           r-coda
           r-ggplot2
           r-matrix
           r-minqa
           r-nlme
           r-reshape2
           r-statmod
           r-tweedie))
    (home-page "https://github.com/actuaryzhang/cplm")
    (synopsis "Compound Poisson linear models")
    (description "The Tweedie compound Poisson distribution is a mixture of a
degenerate distribution at the origin and a continuous distribution on the
positive real line.  It has been applied in a wide range of fields in which
continuous data with exact zeros regularly arise.  The cplm package provides
likelihood based and Bayesian procedures for fitting common Tweedie compound
Poisson linear models.  In particular, models with hierarchical structures or
extra zero inflation can be handled.  Further, the package implements the Gini
index based on an ordered version of the Lorenz curve as a robust model
comparison tool involving zero-inflated and highly skewed distributions.")
    (license license:gpl2+)))

(define-public r-crayon
  (package
    (name "r-crayon")
    (version "1.5.3")
    (source (origin
              (method url-fetch)
              (uri (cran-uri "crayon" version))
              (sha256
               (base32
                "0sfsx4k77fsx1dx9c186dg273psrr3awz4ivfvmbbvs1amla0x1y"))))
    (properties
     ;; We can't have r-testthat among the inputs here to avoid a dependency
     ;; cycle.
     '((updater-ignored-native-inputs . ("r-testthat"))))
    (build-system r-build-system)
    ;; Tests need r-testthat, which would lead to a dependency cycle.
    ;; r-crayon@1.5.3 -> r-diffobj@0.3.5 -> r-waldo@0.6.1 -> r-testthat@3.2.1.1
    (arguments (list #:tests? #false))
    (home-page "https://github.com/gaborcsardi/crayon")
    (synopsis "Colored terminal output for R")
    (description
     "Colored terminal output on terminals that support ANSI color and
highlight codes.  It also works in Emacs ESS.  ANSI color support is
automatically detected.  Colors and highlighting can be combined and nested.
New styles can also be created easily.  This package was inspired by the
\"chalk\" JavaScript project.")
    (license license:expat)))

(define-public r-crew
  (package
    (name "r-crew")
    (version "1.1.2")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "crew" version))
       (sha256
        (base32 "03ygyvwh418mp0vx98vdavyr6xdwi9qcb7pyj56xxba06cymdgch"))))
    (properties `((upstream-name . "crew")))
    (build-system r-build-system)
    (arguments
     (list
      #:phases
      '(modify-phases %standard-phases
         (add-after 'unpack 'disable-bad-tests
           (lambda _
             ;; Some tests use "ip_internal", which fails in the build
             ;; container.
             (delete-file "tests/testthat/test-crew_controller_sequential.R"))))))
    (propagated-inputs (list r-cli
                             r-data-table
                             r-getip
                             r-later
                             r-mirai
                             r-nanonext
                             r-processx
                             r-promises
                             r-ps
                             r-r6
                             r-rlang
                             r-tibble
                             r-tidyselect))
    (native-inputs (list r-autometric r-dplyr r-knitr r-testthat))
    (home-page "https://wlandau.github.io/crew/")
    (synopsis "Distributed worker launcher framework")
    (description
     "In computationally demanding analysis projects, statisticians and data
scientists asynchronously deploy long-running tasks to distributed systems,
ranging from traditional clusters to cloud services.  The NNG-powered mirai R
package by Gao (2023) <doi:10.5281/zenodo.7912722> is a scheduler that
efficiently processes these intense workloads.  The crew package extends mirai
with a unifying interface for third-party worker launchers.")
    (license license:expat)))

(define-public r-cubelyr
  (package
    (name "r-cubelyr")
    (version "1.0.2")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "cubelyr" version))
       (sha256
        (base32 "154vwf5pj2jh66wqdh78nc0v722b4rh88hss24g5lc31wlghzc8q"))))
    (properties `((upstream-name . "cubelyr")))
    (build-system r-build-system)
    (propagated-inputs (list r-dplyr
                             r-glue
                             r-pillar
                             r-purrr
                             r-rlang
                             r-tibble
                             r-tidyselect))
    (native-inputs (list r-testthat))
    (home-page "https://github.com/hadley/cubelyr")
    (synopsis "Data cube dplyr backend")
    (description
     "This package provides an implementation of a data cube extracted out of
dplyr for backward compatibility.")
    (license license:expat)))

(define-public r-cubist
  (package
    (name "r-cubist")
    (version "0.5.0")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "Cubist" version))
       (sha256
        (base32 "0m3jwhpa6kmaiqknms49rh0mjsrmh1cimy06gfdyjx5kcv1an4kw"))))
    (properties `((upstream-name . "Cubist")))
    (build-system r-build-system)
    (propagated-inputs (list r-lattice r-reshape2))
    (native-inputs (list r-knitr r-modeldata r-testthat))
    (home-page "https://topepo.github.io/Cubist/")
    (synopsis "Rule- and instance-based regression modeling")
    (description
     "This is package for regression modeling using rules with added
instance-based corrections.")
    (license license:gpl3)))

(define-public r-curry
  (package
    (name "r-curry")
    (version "0.1.1")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "curry" version))
       (sha256
        (base32
         "1ps9hvbnb02m0b8hlw4admwbziyjvswj08ldi2dk3ymnrpawcc29"))))
    (properties `((upstream-name . "curry")))
    (build-system r-build-system)
    (home-page "https://github.com/thomasp85/curry")
    (synopsis "Partial function application")
    (description
     "Partial application is the process of reducing the arity of a function
by fixing one or more arguments, thus creating a new function lacking the
fixed arguments.  The @code{curry} package provides three different ways of
performing partial function application by fixing arguments from either end of
the argument list (currying and tail currying) or by fixing multiple named
arguments (partial application).  This package provides this functionality
through the @code{%<%}, @code{%-<%}, and @code{%><%} operators which allows
for a programming style comparable to modern functional languages.  Compared
to other implementations such a @code{purrr::partial()} the operators in
@code{curry} composes functions with named arguments, aiding in autocomplete
etc.")
    (license license:gpl2+)))

(define-public r-cutpointr
  (package
    (name "r-cutpointr")
    (version "1.2.0")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "cutpointr" version))
       (sha256
        (base32 "14zvdq5p1hhd6y0xzf761q2kh217rra25ihl17jipakf61zbf88m"))))
    (properties `((upstream-name . "cutpointr")))
    (build-system r-build-system)
    (arguments
     (list
      #:phases
      '(modify-phases %standard-phases
         (add-after 'unpack 'disable-bad-tests
           (lambda _
             ;; This requires the fANCOVA package
             (substitute* "tests/testthat/test-cutpointr.R"
               ((".*LOESS smoothing does not return warnings or errors.*" m)
                (string-append m "skip('skip');\n"))))))))
    (propagated-inputs (list r-dplyr
                             r-foreach
                             r-ggplot2
                             r-gridextra
                             r-purrr
                             r-rcpp
                             r-rlang
                             r-tibble
                             r-tidyr
                             r-tidyselect))
    (native-inputs (list r-knitr r-rocr r-testthat))
    (home-page "https://github.com/thie1e/cutpointr")
    (synopsis "Determine optimal cutpoints for binary classification")
    (description
     "This package estimates optimal cutpoints for binary classification metrics.
It also validates performance using bootstrapping.  Some methods for more
robust cutpoint estimation are supported, e.g. a parametric method assuming
normal distributions, bootstrapped cutpoints, and smoothing of the metric
values per cutpoint using Generalized Additive Models.  Various plotting
functions are included.")
    (license license:gpl3)))

(define-public r-datapasta
  (package
    (name "r-datapasta")
    (version "3.1.0")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "datapasta" version))
       (sha256
        (base32 "0sqv29iv2rv50rbw1601rn8p7gv7rsw00djhl7h1znr0igzi5b82"))))
    (properties `((upstream-name . "datapasta")))
    (build-system r-build-system)
    (propagated-inputs (list r-clipr r-readr r-rstudioapi))
    (native-inputs (list r-data-table r-knitr r-testthat r-tibble))
    (home-page "https://github.com/milesmcbain/datapasta")
    (synopsis "R tools for data copy-pasta")
    (description
     "This package provides RStudio addins and R functions that make
copy-pasting vectors and tables to text painless.")
    (license license:expat)))

(define-public r-datasaurus
  (package
    (name "r-datasaurus")
    (version "0.1.9")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "datasauRus" version))
       (sha256
        (base32
         "0lkf32py342nswm8k4x1hf9j5pnbx2xipzfaj54z6d58a2nlgii1"))))
    (properties `((upstream-name . "datasauRus")))
    (build-system r-build-system)
    (native-inputs (list r-knitr r-testthat))
    (home-page "https://github.com/lockedata/datasauRus")
    (synopsis "Datasets from the Datasaurus Dozen")
    (description
     "The Datasaurus Dozen is a set of datasets with the same summary
statistics.  They retain the same summary statistics despite having radically
different distributions.  The datasets represent a larger and quirkier object
lesson that is typically taught via Anscombe's Quartet (available in the
'datasets' package).  Anscombe's Quartet contains four very different
distributions with the same summary statistics and as such highlights the
value of visualisation in understanding data, over and above summary
statistics.  As well as being an engaging variant on the Quartet, the data is
generated in a novel way.  The simulated annealing process used to derive
datasets from the original Datasaurus is detailed in \"Same Stats, Different
Graphs: Generating Datasets with Varied Appearance and Identical Statistics
through Simulated Annealing\" @url{doi:10.1145/3025453.3025912}.")
    (license license:expat)))

(define-public r-data-table
  (package
    (name "r-data-table")
    (version "1.17.4")
    (source (origin
              (method url-fetch)
              (uri (cran-uri "data.table" version))
              (sha256
               (base32
                "0lq774b5nyjc5k30mbg6834wzwihx72cc35nf0032jc2wfhb4vir"))))
    (properties
     `((upstream-name . "data.table")
       (updater-extra-native-inputs . ("r-r-utils" "tzdata-for-tests"))))
    (build-system r-build-system)
    (arguments
     (list
      #:phases
      '(modify-phases %standard-phases
         ;; These two phases are needed for 3 otherwise failing tests
         (add-after 'unpack 'set-HOME
           (lambda _ (setenv "HOME" "/tmp")))
         (add-before 'check 'set-timezone
           (lambda* (#:key inputs #:allow-other-keys)
             (setenv "TZ" "UTC+1")
             (setenv "TZDIR"
                     (search-input-directory inputs "share/zoneinfo")))))))
    (inputs
     (list zlib))
    (native-inputs
     (list pkg-config r-knitr r-r-utils tzdata-for-tests))
    (home-page "https://github.com/Rdatatable/data.table/wiki")
    (synopsis "Enhanced version of data.frame R object")
    (description
     "The R package @code{data.table} is an extension of @code{data.frame}
providing functions for fast aggregation of large data (e.g. 100GB in RAM),
fast ordered joins, fast add/modify/delete of columns by group, column listing
and fast file reading.")
    (license license:gpl3+)))

(define-public r-datawizard
  (package
    (name "r-datawizard")
    (version "1.1.0")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "datawizard" version))
       (sha256
        (base32
         "1zwl59852fi89nn696a1awf84qxcn1zjmmkcfp3rzpl0zm8mszg3"))))
    (properties
     `((upstream-name . "datawizard")
       (updater-ignored-native-inputs
        ;; Avoid dependency cycles
        . ("r-bayestestr" "r-effectsize" "r-parameters"))))
    (build-system r-build-system)
    (arguments
     (list
      #:phases
      '(modify-phases %standard-phases
         (add-after 'unpack 'disable-bad-tests
           (lambda _
             ;; Fails with "NA in coercion to boolean"
             (substitute* "tests/testthat/test-data_rename.R"
               ((".*data_rename: multiple selection types.*" m)
                (string-append m "skip('skip');\n"))))))))
    (propagated-inputs
     (list r-insight))
    (native-inputs
     (list r-brms
           r-dplyr
           r-ggplot2
           r-haven
           r-httr
           r-knitr
           r-mediation
           r-poorman
           r-psych
           r-testthat
           r-tibble
           r-tidyr
           r-withr))
    (home-page "https://easystats.github.io/datawizard/")
    (synopsis "Easy data wrangling")
    (description
     "This package provides a lightweight package to easily manipulate,
clean, transform, and prepare your data for analysis.  It also forms the data
wrangling backend for the packages in the @code{easystats} ecosystem.")
    (license license:gpl3)))

(define-public r-dbi
  (package
    (name "r-dbi")
    (version "1.2.3")
    (source (origin
              (method url-fetch)
              (uri (cran-uri "DBI" version))
              (sha256
               (base32
                "1gid1mfzq1j3n5fsnpzdb50p2m73z92s6njp0sgr503aaskhhryg"))))
    (build-system r-build-system)
    (native-inputs
     (list r-knitr r-testthat))
    (home-page "https://github.com/rstats-db/DBI")
    (synopsis "R database interface")
    (description
     "The DBI package provides a database interface (DBI) definition for
communication between R and relational database management systems.  All
classes in this package are virtual and need to be extended by the various
R/DBMS implementations.")
    (license license:lgpl2.0+)))

(define-public r-dbitest
  (package
    (name "r-dbitest")
    (version "1.8.2")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "DBItest" version))
       (sha256
        (base32 "1zm3y5fsmsyz4bi3fqvl3zp13jjbi029i21xi4l81h7wxrc8p5y5"))))
    (properties
     `((upstream-name . "DBItest")
       ;; Avoid dependency cycle.
       (updater-ignored-native-inputs . ("r-rsqlite"))))
    (build-system r-build-system)
    (propagated-inputs (list r-blob
                             r-callr
                             r-dbi
                             r-desc
                             r-hms
                             r-lubridate
                             r-magrittr
                             r-nanoarrow
                             r-palmerpenguins
                             r-rlang
                             r-testthat
                             r-withr))
    (native-inputs (list r-knitr r-lintr))
    (home-page "https://dbitest.r-dbi.org")
    (synopsis "Testing DBI backends")
    (description
     "This package provides a helper that tests DBI back ends for conformity
to the interface.")
    (license license:lgpl2.1+)))

(define-public r-dbplyr
  (package
    (name "r-dbplyr")
    (version "2.5.0")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "dbplyr" version))
       (sha256
        (base32
         "1zxw4ignzm2fzixsf6n80f44b9q7434vamy2xj4v31wlx3dmnixv"))))
    (build-system r-build-system)
    (arguments
     (list
      #:phases
      '(modify-phases %standard-phases
         ;; We need this for one failing test.
         (add-before 'check 'set-timezone
           (lambda* (#:key inputs #:allow-other-keys)
             (setenv "TZ" "UTC+1")
             (setenv "TZDIR"
                     (search-input-directory inputs
                                             "share/zoneinfo")))))))
    (propagated-inputs
     (list r-blob
           r-cli
           r-dbi
           r-dplyr
           r-glue
           r-lifecycle
           r-magrittr
           r-pillar
           r-purrr
           r-r6
           r-rlang
           r-tibble
           r-tidyr
           r-tidyselect
           r-vctrs
           r-withr))
    (native-inputs
     (list r-knitr r-rsqlite r-testthat tzdata-for-tests))
    (home-page "https://github.com/tidyverse/dbplyr")
    (synopsis "Dplyr back end for databases")
    (description
     "This package provides a dplyr back end for databases that allows you to
work with remote database tables as if they are in-memory data frames.  Basic
features works with any database that has a @code{DBI} back end; more advanced
features require SQL translation to be provided by the package author.")
    (license license:expat)))

(define-public r-dbscan
  (package
    (name "r-dbscan")
    (version "1.2.2")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "dbscan" version))
       (sha256
        (base32 "0hz31yp2p4zx82qzv4q4s2iiivqq3alqjdfvrgl9n7aj4b8vsfhc"))))
    (properties `((upstream-name . "dbscan")))
    (build-system r-build-system)
    (propagated-inputs (list r-generics r-rcpp))
    (native-inputs (list r-knitr r-testthat))
    (home-page "https://github.com/mhahsler/dbscan")
    (synopsis "Density-based spatial clustering of applications with noise")
    (description
     "This package provides a fast reimplementation of several density-based
algorithms of the DBSCAN family.  It includes the clustering algorithms DBSCAN
(density-based spatial clustering of applications with noise) and
@dfn{hierarchical DBSCAN} (HDBSCAN), the ordering algorithm @dfn{ordering
points to identify the clustering structure} (OPTICS), shared nearest neighbor
clustering, and the outlier detection algorithms @dfn{local outlier
factor} (LOF) and @dfn{global-local outlier score from hierarchies} (GLOSH).
The implementations use the kd-tree data structure for faster k-nearest
neighbor search.  An R interface to fast kNN and fixed-radius NN search is
also provided.")
    (license license:gpl2+)))

(define-public r-deoptimr
  (package
    (name "r-deoptimr")
    (version "1.1-3-1")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "DEoptimR" version))
       (sha256
        (base32
         "18kjq2gcqnicmbdpg5pkzsa4wvy20fprqdkh115k34l6pm176ssq"))))
    (properties `((upstream-name . "DEoptimR")))
    (build-system r-build-system)
    (home-page "https://cran.r-project.org/web/packages/DEoptimR")
    (synopsis "Differential evolution optimization in pure R")
    (description
     "This package provides a @dfn{differential evolution} (DE) stochastic
algorithms for global optimization of problems with and without constraints.
The aim is to curate a collection of its state-of-the-art variants that

@enumerate
@item do not sacrifice simplicity of design,
@item are essentially tuning-free, and
@item can be efficiently implemented directly in the R language.
@end enumerate")
    (license license:gpl2+)))

(define-public r-desc
  (package
    (name "r-desc")
    (version "1.4.3")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "desc" version))
       (sha256
        (base32
         "09ig14bm68cps6d1mrmj6hhjr01i6gz1ri35qpkwk3yp7nkqsijl"))))
    (properties
     ;; We can't have r-testthat among the inputs here to avoid a dependency
     ;; cycle.
     '((updater-ignored-native-inputs . ("r-testthat"))))
    (build-system r-build-system)
    (arguments (list #:tests? #false))
    (propagated-inputs
     (list r-cli r-r6))
    (home-page "https://github.com/r-pkgs/desc")
    (synopsis "Manipulate DESCRIPTION Files")
    (description
     "This package provides tools to read, write, create, and manipulate
DESCRIPTION files.  It is intended for packages that create or manipulate
other packages.")
    (license license:expat)))

(define-public r-desctools
  (package
    (name "r-desctools")
    (version "0.99.60")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "DescTools" version))
       (sha256
        (base32 "1g5wffssvbsqkzh6r5fcing2vxk0lx3dbmls0vhphqnwkmbxh81c"))))
    (properties `((upstream-name . "DescTools")))
    (build-system r-build-system)
    (arguments
     (list
      #:phases
      '(modify-phases %standard-phases
         (add-before 'check 'pre-check
           (lambda _ (setenv "HOME" "/tmp"))))))
    (propagated-inputs
     (list r-boot
           r-cli
           r-data-table
           r-exact
           r-expm
           r-fs
           r-gld
           r-haven
           r-httr
           r-mass
           r-mvtnorm
           r-rcpp
           r-readr
           r-readxl
           r-rstudioapi
           r-withr))
    (native-inputs (list gfortran r-r-rsp))
    (home-page "https://andrisignorell.github.io/DescTools/")
    (synopsis "Tools for descriptive statistics")
    (description
     "This package provides a collection of miscellaneous basic statistic
functions and convenience wrappers for efficiently describing data.
The author's intention was to create a toolbox, which facilitates the
(notoriously time consuming) first descriptive tasks in data analysis,
consisting of calculating descriptive statistics, drawing graphical summaries
and reporting the results.  The package contains furthermore functions to
produce documents using MS Word (or PowerPoint) and functions to import data
from Excel.  Many of the included functions can be found scattered in other
packages and other sources written partly by Titans of R.  The reason for
collecting them here, was primarily to have them consolidated in ONE instead
of dozens of packages (which themselves might depend on other packages which
are not needed at all), and to provide a common and consistent interface as
far as function and arguments naming, NA handling, recycling rules etc.  are
concerned.  Google style guides were used as naming rules (in absence of
convincing alternatives).  The BigCamelCase style was consequently applied to
functions borrowed from contributed R packages as well.")
    (license license:gpl2+)))

(define-public r-devtools
  (package
    (name "r-devtools")
    (version "2.4.5")
    (source (origin
              (method url-fetch)
              (uri (cran-uri "devtools" version))
              (sha256
               (base32
                "0jwh14clyj5flygpmifk01avs7mbnj2s1686pxzfrkcshfyhw5iq"))))
    (build-system r-build-system)
    (propagated-inputs
     (list r-cli
           r-desc
           r-ellipsis
           r-fs
           r-lifecycle
           r-memoise
           r-miniui
           r-pkgbuild
           r-pkgdown
           r-pkgload
           r-profvis
           r-rcmdcheck
           r-remotes
           r-rlang
           r-roxygen2
           r-rversions
           r-sessioninfo
           r-testthat
           r-urlchecker
           r-usethis
           r-withr))
    (native-inputs
     (list r-knitr r-mockery r-testthat))
    (home-page "https://github.com/hadley/devtools")
    (synopsis "Tools to make developing R packages easier")
    (description "The devtools package is a collection of package development
tools to simplify the devolpment of R packages.")
    (license license:gpl2+)))

(define-public r-dfidx
  (package
    (name "r-dfidx")
    (version "0.1-0")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "dfidx" version))
       (sha256
        (base32 "0ygbw1z0v2s2w7d45b09x54xycfglpd1ipgkgxq8w2q004rkdp9d"))))
    (properties `((upstream-name . "dfidx")))
    (build-system r-build-system)
    (propagated-inputs (list r-dplyr
                             r-formula
                             r-glue
                             r-pillar
                             r-rdpack
                             r-tidyselect
                             r-vctrs))
    (native-inputs (list r-quarto))
    (home-page "https://cran.r-project.org/package=dfidx")
    (synopsis "Indexed data frames")
    (description
     "This package provides extended data frames, with a special data frame
column which contains two indexes, with potentially a nesting structure.")
    (license license:gpl2+)))

(define-public r-dharma
  (package
    (name "r-dharma")
    (version "0.4.7")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "DHARMa" version))
       (sha256
        (base32 "0mfywr4pshnd13xs2zdhd8xvbc43qxaj075jhy8lrlg1agmc6gya"))))
    (properties `((upstream-name . "DHARMa")))
    (build-system r-build-system)
    (propagated-inputs (list r-ape
                             r-gap
                             r-lme4
                             r-lmtest
                             r-matrix
                             r-qgam))
    (native-inputs (list r-devtools
                         r-glmmadaptive
                         r-glmmtmb
                         r-knitr
                         r-mass
                         r-mgcv
                         r-phylolm
                         r-rhub
                         r-spamm
                         r-testthat))
    (home-page "https://florianhartig.github.io/DHARMa/")
    (synopsis "Residual diagnostics for hierarchical regression models")
    (description
     "The DHARMa package uses a simulation-based approach to create readily
interpretable scaled (quantile) residuals for fitted (generalized) linear
mixed models.  Moreover, externally created simulations, e.g. posterior
predictive simulations from Bayesian software such as JAGS, STAN, or BUGS can
be processed as well.  The resulting residuals are standardized to values
between 0 and 1 and can be interpreted as intuitively as residuals from a
linear regression.  The package also provides a number of plot and test
functions for typical model misspecification problems, such as
over/underdispersion, zero-inflation, and residual spatial, phylogenetic and
temporal autocorrelation.")
    (license license:gpl3+)))

(define-public r-dichromat
  (package
    (name "r-dichromat")
    (version "2.0-0.1")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "dichromat" version))
       (sha256
        (base32 "10b0avdar3d1y8x2ya3x5kqxqg0z0mq872hdzvc1nn4amplph1d1"))))
    (build-system r-build-system)
    (home-page "https://cran.r-project.org/web/packages/dichromat")
    (synopsis "Color schemes for dichromats")
    (description
     "Dichromat collapses red-green or green-blue distinctions to simulate the
effects of different types of color-blindness.")
    (license license:gpl2+)))

(define-public r-diffobj
  (package
    (name "r-diffobj")
    (version "0.3.6")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "diffobj" version))
       (sha256
        (base32
         "11qjwm58lf9r3qy33z89jy801dlss1r2i8wvygkrrcbpf71xj5mk"))))
    (properties `((upstream-name . "diffobj")))
    (build-system r-build-system)
    (propagated-inputs (list r-crayon))
    (native-inputs (list r-knitr))
    (home-page "https://github.com/brodieG/diffobj")
    (synopsis "Diffs for R objects")
    (description
     "Generate a colorized diff of two R objects for an intuitive
visualization of their differences.")
    (license license:gpl2+)))

(define-public r-digest
  (package
    (name "r-digest")
    (version "0.6.37")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "digest" version))
       (sha256
        (base32 "0883iyjbd50f0gwz6hgdmcsrk0i0fkjaix9hz6d4m2jbk54x3i42"))))
    (build-system r-build-system)
    ;; Vignettes require r-knitr, which requires r-digest, so we have to
    ;; disable them and the tests.
    (arguments
     `(#:tests? #f
       #:configure-flags (list "--no-build-vignettes")))
    (native-inputs (list r-simplermarkdown))
    (home-page "https://dirk.eddelbuettel.com/code/digest.html")
    (synopsis "Create cryptographic hash digests of R objects")
    (description
     "This package contains an implementation of a function @code{digest()} for
the creation of hash digests of arbitrary R objects (using the md5, sha-1,
sha-256, crc32, xxhash and murmurhash algorithms) permitting easy comparison
of R language objects, as well as a function @code{hmac()} to create hash-based
message authentication code.

Please note that this package is not meant to be deployed for cryptographic
purposes for which more comprehensive (and widely tested) libraries such as
OpenSSL should be used.")
    (license license:gpl2+)))

(define-public r-dint
  (package
    (name "r-dint")
    (version "2.1.5")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "dint" version))
       (sha256
        (base32 "0qfvxzix6k24xnjxh9nhz9dq3qfwl14mnd7rp03l8yvh6frws8fh"))))
    (properties `((upstream-name . "dint")))
    (build-system r-build-system)
    (native-inputs (list r-knitr r-testthat))
    (home-page "https://github.com/s-fleck/dint")
    (synopsis "Toolkit for year-quarter, year-month and year-isoweek dates")
    (description
     "This package provides S3 classes and methods to create and work with
year-quarter, year-month and year-isoweek vectors.  Basic arithmetic
operations (such as adding and subtracting) are supported, as well as
formatting and converting to and from standard R date types.")
    (license license:expat)))

(define-public r-diptest
  (package
    (name "r-diptest")
    (version "0.77-1")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "diptest" version))
       (sha256
        (base32
         "04r8c6xy5vympxaxmgnjib4pqh97f9k6b43i66qhzkl3yh0awki2"))))
    (build-system r-build-system)
    (home-page "https://cran.r-project.org/web/packages/diptest")
    (synopsis "Hartigan's dip test statistic for unimodality")
    (description
     "This package computes Hartigan's dip test statistic for unimodality,
multimodality and provides a test with simulation based p-values, where the
original public code has been corrected.")
    (license license:gpl2+)))

(define-public r-dirichletreg
  (package
    (name "r-dirichletreg")
    (version "0.7-1")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "DirichletReg" version))
       (sha256
        (base32 "1ql5mwb7zb06y9j6inrlngq7c15as4j17wd8kc71fxs0a2jdj7xi"))))
    (properties `((upstream-name . "DirichletReg")))
    (build-system r-build-system)
    (propagated-inputs (list r-formula r-maxlik))
    (native-inputs (list r-knitr r-testthat))
    (home-page "https://cran.r-project.org/package=DirichletReg")
    (synopsis "Dirichlet regression")
    (description "This package implements Dirichlet regression models.")
    (license license:gpl2+)))

(define-public r-dirmult
  (package
    (name "r-dirmult")
    (version "0.1.3-5")
    (source (origin
              (method url-fetch)
              (uri (cran-uri "dirmult" version))
              (sha256
               (base32
                "05whzhl81nyag7321hw98xa63r440s9bgj1764346yvm9bvzjqi4"))))
    (properties `((upstream-name . "dirmult")))
    (build-system r-build-system)
    (home-page "https://cran.r-project.org/package=dirmult")
    (synopsis "Estimation in Dirichlet-Multinomial distribution")
    (description
     "This package estimates the parameters in Dirichlet-Multinomial and
computes log-likelihoods.")
    (license license:gpl2+)))

(define-public r-dixontest
  (package
    (name "r-dixontest")
    (version "1.0.4")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "dixonTest" version))
       (sha256
        (base32 "0gz39s1z987bg56vwrpcs14wzyf7p07s7l7z9napz0i38564wsdq"))))
    (properties `((upstream-name . "dixonTest")))
    (build-system r-build-system)
    (native-inputs (list gfortran))
    (home-page "https://cran.r-project.org/package=dixonTest")
    (synopsis "Dixon's ratio test for outlier detection")
    (description
     "For outlier detection in small and normally distributed samples the ratio
test of Dixon (Q-test) can be used.  Density, distribution function, quantile
function and random generation for Dixon's ratio statistics are provided as
wrapper functions.  The core applies McBane's Fortran functions that use
Gaussian quadrature for a numerical solution.")
    (license license:gpl3)))

(define-public r-dmwr2
  (package
    (name "r-dmwr2")
    (version "0.0.2")
    (source (origin
              (method url-fetch)
              (uri (cran-uri "DMwR2" version))
              (sha256
               (base32
                "1vzfbz2k05j8r2hpig3d2grb99rnnh2s1sviii3prcyqicxfh0i9"))))
    (properties `((upstream-name . "DMwR2")))
    (build-system r-build-system)
    (propagated-inputs
     (list r-class
           r-dbi
           r-dplyr
           r-quantmod
           r-readr
           r-rpart
           r-xts
           r-zoo))
    (home-page "https://github.com/ltorgo/DMwR2")
    (synopsis
     "Functions and data for the second edition of \"Data Mining with R\"")
    (description
     "This package provides functions and data accompanying the second
edition of the book \"Data Mining with R, learning with case studies\"
by Luis Torgo, published by CRC Press.")
    (license license:gpl2+)))

(define-public r-domc
  (package
    (name "r-domc")
    (version "1.3.8")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "doMC" version))
       (sha256
        (base32
         "18qrcvqwm4cclvk8spvyi281y8prwzivj52xmzk1l9a82j2ny65j"))))
    (properties `((upstream-name . "doMC")))
    (build-system r-build-system)
    (propagated-inputs
     (list r-foreach r-iterators))
    (native-inputs (list r-runit))
    (home-page "https://cran.r-project.org/web/packages/doMC")
    (synopsis "Foreach parallel adaptor for the 'parallel' package")
    (description
     "This package provides a parallel backend for the @code{%dopar%} function
using the multicore functionality of the parallel package.")
    (license license:gpl2+)))

(define-public r-doparallel
  (package
    (name "r-doparallel")
    (version "1.0.17")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "doParallel" version))
       (sha256
        (base32
         "1mxbg2qqda1775vb4s26gz27p5n91lljgjmlqxq4sras22njasmr"))))
    (properties `((upstream-name . "doParallel")))
    (build-system r-build-system)
    (propagated-inputs
     (list r-foreach r-iterators))
    (native-inputs (list r-runit))
    (home-page "https://cran.r-project.org/web/packages/doParallel")
    (synopsis "Foreach parallel adaptor for the 'parallel' package")
    (description
     "This package provides a parallel backend for the @code{%dopar%} function
using the parallel package.")
    (license license:gpl2+)))

(define-public r-dplyr
  (package
    (name "r-dplyr")
    (version "1.1.4")
    (source (origin
              (method url-fetch)
              (uri (cran-uri "dplyr" version))
              (sha256
               (base32
                "1jsq8pj12bngy66xms486j8a65wxvyqs944q9rxkiaylsla08wyg"))))
    (build-system r-build-system)
    (arguments
     (list
      #:phases
      '(modify-phases %standard-phases
         (add-after 'unpack 'delete-failing-tests
           (lambda _
             ;; 2 tests fail because of unexpected but harmless warnings.
             (delete-file "tests/testthat/test-rows.R"))))))
    (propagated-inputs
     (list r-cli
           r-generics
           r-glue
           r-lifecycle
           r-magrittr
           r-pillar
           r-r6
           r-rlang
           r-tibble
           r-tidyselect
           r-vctrs))
    (native-inputs
     (list r-knitr r-testthat))
    (home-page "https://github.com/hadley/dplyr")
    (synopsis "Tools for working with data frames in R")
    (description
     "dplyr is the next iteration of plyr.  It is focused on tools for working
with data frames.  It has three main goals: 1) identify the most important
data manipulation tools needed for data analysis and make them easy to use in
R; 2) provide fast performance for in-memory data by writing key pieces of
code in C++; 3) use the same code interface to work with data no matter where
it is stored, whether in a data frame, a data table or database.")
    (license license:expat)))

(define-public r-dt
  (let* ((extension-origin
          (lambda (name version hash)
            (origin
              (method git-fetch)
              (uri (git-reference
                    (url
                     (format #false "https://github.com/DataTables/~a" name))
                    (commit version)))
              (file-name
               (format #false "datatables-~a-~a-checkout" name version))
              (sha256
               (base32 hash)))))
         (extensions
          '(((name . "AutoFill")
             (version . "2.6.0")
             (hash . "0dmhp7vcg9l2qwcvn8w605n9yz38b3k9j907j4i495577mk6cqb0"))
            ((name . "Buttons")
             (version . "2.4.2")
             (hash . "0zr7k5ginsfrg0nxayyd68z410ymxa6qs5n7zqjbzaydf5na2rk3"))
            ((name . "ColReorder")
             (version . "1.7.0")
             (hash . "1z152xhncmr7612wxn6p94m8330d31kdrial86zr2bj77ix571pl"))
            ((name . "DateTime")
             (version . "1.5.1")
             (hash . "11wj2pbisymp148jwg2r05ppa6c2swpip6k04q8f324ma4wy83c5"))
            ((name . "FixedHeader")
             (version . "3.4.0")
             (hash . "0vfgxmg11mbvzvi25c88a611nz53qi88j5jnmpwjag584b90a6bj"))
            ((name . "KeyTable")
             (version . "2.10.0")
             (hash . "18a0pz76532lyn9xsa079ibbfb8rrd2wbv4c8pk9npxc6j1ml0j1"))
            ((name . "Responsive")
             (version . "2.5.0")
             (hash . "04njvyab7hv61nrxs8g7nyxnxjljhnd22kmhahhdz34xf54ydy01"))
            ((name . "RowGroup")
             (version . "1.4.0")
             (hash . "0anvrw096k3pj1k7gkvyhpgchh3jzk2r6j48ywfssgqh38x41byr"))
            ((name . "RowReorder")
             (version . "1.4.1")
             (hash . "0zg7vz19hapgfivjc98fliz59zfwidx9fg42rj5zkamdn18gm8sm"))
            ((name . "Scroller")
             (version . "2.2.0")
             (hash . "1wzla8710986kax63a3r48a5j5ddkbn9fd36pdy778xb9qp766iq"))
            ((name . "Select")
             (version . "1.7.0")
             (hash . "1rb6ik3cd5zijlm95d0fl93bvan6j3bdbj83lrdzhb419qs3v3bf"))))
         (ts-extensions
          '(((name . "FixedColumns")
             (version . "4.3.0")
             (hash . "0z31qw3nz1arccg1zwkdnla98mws7c49gsyncv61c3ghh5b0qlcg"))
            ((name . "SearchBuilder")
             (version . "1.6.0")
             (hash . "10df2jrc3z2v44alwl45cp1qr96b49ai8x7kspqn6ha816lwjqrv"))
            ((name . "SearchPanes")
             (version . "2.2.0")
             (hash . "0pkcxyy357zd722bz1jnbn0dmccpwfpy6qca5cpyl97mdmmprpi9"))
            ((name . "StateRestore")
             (version . "1.3.0")
             (hash . "0zj7idfyj02hynd02w2gjrnp0m8krhzrkwn5fjadfs7gq4i21ial"))))
         (javascript-sources
          `(("https://cdn.datatables.net/1.13.6/js/jquery.dataTables.js"
             "15yjj5s1nkf9f1llmjbjgbw380gl1v35psab4qd7l18gvrspaf5k"
             "datatables")
            ("https://cdn.datatables.net/1.13.6/js/dataTables.bootstrap.js"
             "064a4vm2wd2qhf1szkppvh80fzqpyrm0xjzfcqrg1x9mr8xfs06p"
             "datatables")
            ("https://cdn.datatables.net/1.13.6/js/dataTables.bootstrap4.js"
             "0w2s6zs7bwlxdzc2z67pj49naqs2kh7xgmxmh1a4d42x3fpxacgy"
             "datatables")
            ("https://cdn.datatables.net/1.13.6/js/dataTables.bootstrap5.js"
             "1c1bnaq35w37iq214gq8rsd4rx0wp1c46054w9h21vqpf2xiy79i"
             "datatables")
            ("https://cdn.datatables.net/1.13.6/js/dataTables.bulma.js"
             "0d7ylp4qgkzkrfc5y7p0nzxxxqibynz8ijsrkvc65jbcbccxglsd"
             "datatables")
            ("https://cdn.datatables.net/1.13.6/js/dataTables.foundation.js"
             "0s6r8pc7rdic4qifwc0x3q9i737930wfqh27yycksrbv7i96w2s7"
             "datatables")
            ("https://cdn.datatables.net/1.13.6/js/dataTables.jqueryui.js"
             "09cwapax46yf2qz9w50wq9yqzysgfqfnmm9s2ixlafzhzdlx5nw5"
             "datatables")
            ("https://cdn.datatables.net/1.13.6/js/dataTables.semanticui.js"
             "09q31xdgnyc0fsi81qg6a2rfivgncm7jk7x2idm7b1pip8d58j74"
             "datatables")
            ("https://cdnjs.cloudflare.com/ajax/libs/jszip/3.10.1/jszip.js"
             "01l5lw49jz2qn6k9i63dk4llar4lvvpd6xp6i45mpwfk49fbxqg2"
             "datatables-extensions/Buttons"))))
    (package
      (name "r-dt")
      (version "0.33")
      (source (origin
                (method url-fetch)
                (uri (cran-uri "DT" version))
                (sha256
                 (base32
                  "1f17gdqjk1aj7vwjvv3363k8lnsvc6ssh4s3gy1prnz33kdxlig1"))
                (modules '((guix build utils)
                           (ice-9 match)))
                (snippet
                 `(with-directory-excursion "inst/htmlwidgets/lib"
                    (for-each (match-lambda
                                ((url hash dir)
                                 (let ((file (string-append dir "/js/" (basename url ".js") ".min.js")))
                                   (delete-file file))))
                              ',javascript-sources)
                    ;; Preserve pdfmake.js and vfs_fonts.js
                    (copy-file "datatables-extensions/Buttons/js/pdfmake.js"
                               "/tmp/pdfmake.js")
                    (copy-file "datatables-extensions/Buttons/js/vfs_fonts.js"
                               "/tmp/vfs_fonts.js")
                    (for-each (lambda (extension)
                                (let ((name (assoc-ref extension 'name)))
                                  (delete-file-recursively
                                   (string-append "datatables-extensions/" name "/js"))))
                              (append ',extensions ',ts-extensions))
                    (mkdir-p "datatables-extensions/Buttons/js/")
                    (copy-file "/tmp/pdfmake.js"
                               "datatables-extensions/Buttons/js/pdfmake.js")
                    (copy-file "/tmp/vfs_fonts.js"
                               "datatables-extensions/Buttons/js/vfs_fonts.js")
                    (delete-file "nouislider/jquery.nouislider.min.js")
                    (delete-file "selectize/selectize.min.js")
                    (with-directory-excursion "datatables-plugins/features/"
                      (for-each delete-file
                                '("scrollResize/source.min.js"
                                  "searchHighlight/source.min.js")))))))
      (properties
       `((upstream-name . "DT")))
      (build-system r-build-system)
      (arguments
       `(#:modules
         ((guix build r-build-system)
          (guix build minify-build-system)
          (guix build utils)
          (ice-9 match))
         #:imported-modules
         (,@%r-build-system-modules
          (guix build minify-build-system))
         #:phases
         (modify-phases (@ (guix build r-build-system) %standard-phases)
           (add-after 'unpack 'process-javascript
             (lambda* (#:key inputs #:allow-other-keys)
               (with-directory-excursion "inst/htmlwidgets/lib/"
                 (for-each (match-lambda
                             ((url hash dir)
                              (let* ((input (string-append "js:" (basename url)))
                                     (source (assoc-ref inputs input))
                                     (target (string-append dir "/js/"
                                                            (basename url ".js")
                                                            ".min.js")))
                                (mkdir-p dir)
                                (minify source #:target target))))
                           ',javascript-sources)

                 ;; Minify JS for each extension
                 (for-each (lambda (extension)
                             (let* ((name    (assoc-ref extension 'name))
                                    (version (assoc-ref extension 'version))
                                    (hash    (assoc-ref extension 'hash))
                                    (label   (string-append "js:" name))
                                    (dir     (string-append "datatables-extensions/"
                                                            name "/js")))
                               (mkdir-p dir)
                               (with-directory-excursion dir
                                 (for-each
                                  (lambda (file)
                                    (minify file
                                            #:target
                                            (string-append (basename file ".js") ".min.js")))
                                  (find-files (string-append (assoc-ref inputs label) "/js")
                                              "\\.js$")))))
                           ',extensions)
                 ;; Process typescript extensions
                 (for-each (lambda (extension)
                             (let* ((name    (assoc-ref extension 'name))
                                    (version (assoc-ref extension 'version))
                                    (hash    (assoc-ref extension 'hash))
                                    (label   (string-append "ts:" name))
                                    (dir     (string-append "datatables-extensions/"
                                                            name "/js")))
                               (mkdir-p dir)
                               (with-directory-excursion dir
                                 (apply invoke "esbuild"
                                        "--bundle"
                                        (string-append
                                         "--tsconfig="
                                         (string-append (assoc-ref inputs label)
                                                        "/tsconfig.json"))
                                        (string-append "--outdir=" (getcwd))
                                        (find-files
                                         (string-append (assoc-ref inputs label) "/src/")
                                         "\\.ts$"))
                                 (rename-file "index.js" (string-append "dataTables."
                                                                        (string-downcase name 0 1)
                                                                        ".js"))
                                 (for-each
                                  (lambda (file)
                                    (minify file
                                            #:target
                                            (string-append (basename file ".js") ".min.js"))
                                    (delete-file file))
                                  (find-files "." "\\.js$")))))
                           ',ts-extensions)
                 (minify (string-append (assoc-ref inputs "datatables-plugins")
                                        "/dataRender/ellipsis.js")
                         #:target "datatables-plugins/dataRender/ellipsis/source.min.js")
                 (minify (string-append (assoc-ref inputs "datatables-plugins")
                                        "/filtering/type-based/accent-neutralise.js")
                         #:target "datatables-plugins/filtering/accent-neutralise/source.min.js")
                 (minify (string-append (assoc-ref inputs "datatables-plugins")
                                        "/filtering/type-based/diacritics-neutralise.js")
                         #:target "datatables-plugins/filtering/diacritics-neutralise/source.min.js")
                 (minify (string-append (assoc-ref inputs "datatables-plugins")
                                        "/sorting/natural.js")
                         #:target "datatables-plugins/sorting/natural/source.min.js")
                 (minify (string-append (assoc-ref inputs "datatables-plugins")
                                        "/features/scrollResize/dataTables.scrollResize.js")
                         #:target "datatables-plugins/features/scrollResize/source.min.js")
                 (minify (string-append (assoc-ref inputs "datatables-plugins")
                                        "/features/searchHighlight/dataTables.searchHighlight.js")
                         #:target "datatables-plugins/features/searchHighlight/source.min.js")
                 (minify (assoc-ref inputs "js-nouislider")
                         #:target "nouislider/jquery.nouislider.min.js")

                 (let ((replace-file (lambda (old new)
                                       (format #t "replacing ~a with ~a\n" old new)
                                       (symlink new old))))
                   (replace-file "selectize/selectize.min.js"
                                 (string-append (assoc-ref inputs "js-selectize")
                                                "/share/javascript/selectize.min.js")))))))))
      (propagated-inputs
       (list r-crosstalk
             r-htmltools
             r-htmlwidgets
             r-httpuv
             r-jquerylib
             r-jsonlite
             r-magrittr
             r-promises))
      (inputs
       (list js-selectize))
      (native-inputs
       `(("r-knitr" ,r-knitr)
         ("r-testit" ,r-testit)
         ("esbuild" ,esbuild)
         ("datatables-plugins"
          ,(let ((version "1.13.6"))
             (origin
               (method git-fetch)
               (uri (git-reference
                     (url "https://github.com/DataTables/Plugins.git")
                     (commit version)))
               (file-name (git-file-name "datatables-plugins" version))
               (sha256
                (base32
                 "02ijp9671al2fpb5sahy1z4nx1q75jp8p0i77vv87r8lqmsvsjis")))))
         ("js-nouislider"
          ,(let ((version "7.0.10"))
             (origin
               (method url-fetch)
               (uri (string-append "https://raw.githubusercontent.com/leongersen/noUiSlider/"
                                   version "/distribute/jquery.nouislider.js"))
               (sha256
                (base32
                 "1f7vsfcn7wwzngib6j0wpl0psd6qriiaa6kv728ynfn5da73zfxm")))))
         ,@(map (match-lambda
                  ((url hash dir)
                   `(,(string-append "js:" (basename url))
                     ,(origin (method url-fetch)
                              (uri url)
                              (sha256 (base32 hash))))))
                javascript-sources)
         ,@(map (lambda (extension)
                  (let ((name    (assoc-ref extension 'name))
                        (version (assoc-ref extension 'version))
                        (hash    (assoc-ref extension 'hash)))
                    `(,(string-append "js:" name)
                      ,(extension-origin name version hash))))
                extensions)
         ,@(map (lambda (extension)
                  (let ((name    (assoc-ref extension 'name))
                        (version (assoc-ref extension 'version))
                        (hash    (assoc-ref extension 'hash)))
                    `(,(string-append "ts:" name)
                      ,(extension-origin name version hash))))
                ts-extensions)))
      (home-page "https://rstudio.github.io/DT")
      (synopsis "R wrapper of the DataTables JavaScript library")
      (description
       "This package allows for data objects in R to be rendered as HTML
tables using the JavaScript library @code{DataTables} (typically via R
Markdown or Shiny).  The @code{DataTables} library has been included in this R
package.")
      ;; The DT package as a whole is distributed under GPLv3.  The DT package
      ;; inludes other software components under different licenses:
      ;;
      ;;   * Expat: jquery.highlight.js, DataTables
      ;;   * WTFPL: noUiSlider
      (license (list license:gpl3
                     license:expat
                     license:wtfpl2)))))

(define-public r-dynamictreecut
  (package
    (name "r-dynamictreecut")
    (version "1.63-1")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "dynamicTreeCut" version))
       (sha256
        (base32
         "1fadbql7g5r2vvlkr89nlrjxwp4yx4xrdqmv077qvmnx9vv0f4w3"))))
    (properties `((upstream-name . "dynamicTreeCut")))
    (build-system r-build-system)
    (home-page
     "https://cran.r-project.org/web/packages/dynamicTreeCut/index.html")
    (synopsis "Detect clusters in hierarchical clustering dendrograms")
    (description
     "This package contains methods for the detection of clusters in
hierarchical clustering dendrograms.")
    (license license:gpl2+)))

(define-public r-e1071
  (package
    (name "r-e1071")
    (version "1.7-16")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "e1071" version))
       (sha256
        (base32
         "0krsgkcvs16jixmjwjl05aggpz02hahg2j8ydk4r9nrz0ginbm8j"))))
    (build-system r-build-system)
    (propagated-inputs
     (list r-class r-proxy))
    ;; For vignettes
    (native-inputs (list r-mlbench r-randomforest r-xtable))
    (home-page "https://cran.r-project.org/web/packages/e1071")
    (synopsis "Miscellaneous functions for probability theory")
    (description
     "This package provides functions for latent class analysis, short time
Fourier transform, fuzzy clustering, support vector machines, shortest path
computation, bagged clustering, naive Bayes classifier, and more.")
    (license license:gpl2+)))

(define-public r-eaf
  (package
    (name "r-eaf")
    (version "2.5.2")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "eaf" version))
       (sha256
        (base32 "14mfcc7lacaghfxiq3x7zmbvk2ink3xkkbiky1bfv9dgwbmic8dr"))))
    (properties `((upstream-name . "eaf")))
    (build-system r-build-system)
    (inputs (list gsl))
    (propagated-inputs (list r-matrixstats r-modeltools r-rdpack))
    (native-inputs (list pkg-config r-spelling r-testthat r-withr))
    (home-page "https://mlopez-ibanez.github.io/eaf/")
    (synopsis "Plots of the empirical attainment function")
    (description
     "This is a package for computation and visualization of the
@dfn{empirical attainment function} (EAF) for the analysis of random sets in
multi-criterion optimization.")
    (license license:gpl2+)))

(define-public r-earlywarnings
  (package
    (name "r-earlywarnings")
    (version "1.1.29")
    (source (origin
              (method url-fetch)
              (uri (cran-uri "earlywarnings" version))
              (sha256
               (base32
                "1xa9rijqqxa5l253dg8dn1jjhdakf8krl5rflq5v9gybfyrq1885"))))
    (properties `((upstream-name . "earlywarnings")))
    (build-system r-build-system)
    (propagated-inputs (list r-fields
                             r-ggplot2
                             r-kendall
                             r-kernsmooth
                             r-knitr
                             r-lmtest
                             r-moments
                             r-nortest
                             r-quadprog
                             r-som
                             r-spam
                             r-tgp
                             r-tseries))
    (native-inputs (list r-knitr))
    (home-page "https://www.early-warning-signals.org")
    (synopsis "Early warning signals for critical transitions in time series")
    (description
     "This package offers methods for estimating statistical changes in time
series.  These are used for identifying nearby critical transitions.")
    (license license:bsd-2)))

(define-public r-earth
  (package
    (name "r-earth")
    (version "5.3.4")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "earth" version))
       (sha256
        (base32 "1g6ywsmdp7qlp0rql6f07j9hih45w9jm7b90sgkjpylqan94zy9s"))))
    (properties `((upstream-name . "earth")))
    (build-system r-build-system)
    (propagated-inputs (list r-formula r-plotmo))
    (native-inputs (list gfortran))
    (home-page "http://www.milbo.users.sonic.net/earth/")
    (synopsis "Multivariate adaptive regression splines")
    (description
     "This package lets you build regression models using the techniques in
Friedman's papers \"Fast MARS\" and \"Multivariate Adaptive Regression
Splines\" <doi:10.1214/aos/1176347963>. The term \"MARS\" is trademarked and
thus not used in the name of the package.")
    (license license:gpl3)))

(define-public r-effects
  (package
    (name "r-effects")
    (version "4.2-2")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "effects" version))
       (sha256
        (base32
         "0nlj79am9a1yg737dhfa8dj1kj2hly9pfknmphsbcvlgxqn35vig"))))
    (properties `((upstream-name . "effects")))
    (build-system r-build-system)
    (propagated-inputs
     (list r-cardata
           r-colorspace
           r-estimability
           r-insight
           r-lattice
           r-lme4
           r-nnet
           r-survey))
    (native-inputs
     (list r-knitr))
    (home-page "https://www.r-project.org")
    (synopsis
     "Effect displays for linear, generalized linear, and other models")
    (description
     "Graphical and tabular effect displays, e.g., of interactions, for
various statistical models with linear predictors.")
    (license license:gpl2+)))

(define-public r-embedsom
  (package
    (name "r-embedsom")
    (version "2.2")
    (source (origin
              (method url-fetch)
              (uri (cran-uri "EmbedSOM" version))
              (sha256
               (base32
                "1ilsrb53x4zf0r8jc7csbdnnd8a903qkx09aakw8diif38s72rjy"))))
    (properties `((upstream-name . "EmbedSOM")))
    (build-system r-build-system)
    (propagated-inputs
     (list r-ggplot2
           r-igraph
           r-matrix
           r-rtsne
           r-umap
           r-uwot))
    (native-inputs (list r-knitr))
    (home-page "https://github.com/exaexa/EmbedSOM")
    (synopsis "Fast embedding guided by self-organizing map")
    (description
     "This package provides a smooth mapping of multidimensional points into
low-dimensional space defined by a self-organizing map.  It is designed to
work with FlowSOM and flow-cytometry use-cases.")
    (license license:gpl3+)))

(define-public r-emdist
  (package
    (name "r-emdist")
    (version "0.3-3")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "emdist" version))
       (sha256
        (base32
         "0jmnz612pjad3p1zk0qiljcbf0zbxfi4zcw2jqwg8ncjsifhr3mp"))))
    (properties `((upstream-name . "emdist")))
    (build-system r-build-system)
    (home-page "https://www.rforge.net/emd")
    (synopsis "Earth mover's distance")
    (description
     "This package provides tools to calculate the Earth Mover's
Distance (EMD).")
    (license license:expat)))

(define-public r-emulator
  (package
    (name "r-emulator")
    (version "1.2-24")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "emulator" version))
       (sha256
        (base32 "0sd45wjdb00iyj8n16kqxypisam7ibwvpcaxsi1z56yzlzp93p4i"))))
    (properties `((upstream-name . "emulator")))
    (build-system r-build-system)
    (propagated-inputs (list r-mvtnorm))
    (native-inputs (list r-knitr))
    (home-page "https://github.com/RobinHankin/emulator")
    (synopsis "Bayesian emulation of computer programs")
    (description
     "This package allows one to estimate the output of a computer program, as
a function of the input parameters, without actually running it.  The computer
program is assumed to be a Gaussian process, whose parameters are estimated
using Bayesian techniques that give a PDF of expected program output.  This
PDF is conditional on a training set of runs, each consisting of a point in
parameter space and the model output at that point.  The emphasis is on
complex codes that take weeks or months to run, and that have a large number
of undetermined input parameters; many climate prediction models fall into
this class.  The emulator essentially determines Bayesian posterior estimates
of the PDF of the output of a model, conditioned on results from previous runs
and a user-specified prior linear model.  The package includes functionality
to evaluate quadratic forms efficiently.")
    (license (list license:gpl2+ license:gpl3+))))

(define-public r-esc
  (package
    (name "r-esc")
    (version "0.5.1")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "esc" version))
       (sha256
        (base32
         "0gns7gz55p6pha05413r3hlvd7f2v1amxkg13d197mab1ypqic7q"))))
    (properties `((upstream-name . "esc")))
    (build-system r-build-system)
    (home-page "https://strengejacke.github.io/esc/")
    (synopsis "Effect size computation for meta analysis")
    (description
     "Implementation of the web-based
@url{http://www.campbellcollaboration.org/escalc/html/EffectSizeCalculator-Home.php,Practical
Meta-Analysis Effect Size Calculator} from David B. Wilson in R.  Based on the
input, the effect size can be returned as standardized mean difference,
Cohen's f, Hedges' g, Pearson's r or Fisher's transformation z, odds ratio or
log odds, or eta squared effect size.")
    (license license:gpl3)))

(define-public r-estimability
  (package
    (name "r-estimability")
    (version "1.5.1")
    (source (origin
              (method url-fetch)
              (uri (cran-uri "estimability" version))
              (sha256
               (base32
                "1sa42rczhzfj0dkn8v1pq6b752rh6h7x553gcgl7g27x75mbk9iw"))))
    (build-system r-build-system)
    (native-inputs (list r-knitr))
    (home-page "https://cran.r-project.org/web/packages/estimability")
    (synopsis "Tools for assessing estimability of linear predictions")
    (description "This package provides tools for determining estimability of
linear functions of regression coefficients, and @code{epredict} methods that
handle non-estimable cases correctly.")
    (license license:gpl2+)))

(define-public r-evaluate
  (package
    (name "r-evaluate")
    (version "1.0.3")
    (source (origin
              (method url-fetch)
              (uri (cran-uri "evaluate" version))
              (sha256
               (base32
                "1qm2vz8a1hjgqyidaf3favzbp7fjka3m6qdq9yxjjmhf2gdfvzxv"))))
    (properties
     ;; We can't have r-testthat among the inputs here to avoid a dependency
     ;; cycle.
     '((updater-ignored-native-inputs . ("r-testthat"))))
    (build-system r-build-system)
    (home-page "https://github.com/hadley/evaluate")
    (synopsis "Parsing and evaluation tools for R")
    (description
     "This package provides tools that allow you to recreate the parsing,
evaluation and display of R code, with enough information that you can
accurately recreate what happens at the command line.  The tools can easily be
adapted for other output formats, such as HTML or LaTeX.")
    (license license:gpl3+)))

(define-public r-exact
  (package
    (name "r-exact")
    (version "3.3")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "Exact" version))
       (sha256
        (base32 "0hikz8f19blywxs66xj6zf4krwyivsy3w165qvrnb0m2l6dx1l7v"))))
    (properties `((upstream-name . "Exact")))
    (build-system r-build-system)
    (propagated-inputs (list r-rootsolve))
    (home-page "https://cran.r-project.org/package=Exact")
    (synopsis "Unconditional exact test")
    (description
     "Performs unconditional exact tests and power calculations for 2x2
contingency tables.  For comparing two independent proportions, performs
@url{doi:10.1038/156177a0, Barnard's test (1945)} using the original CSM
test (@url{doi:10.1093/biomet/34.1-2.123, Barnard (1947)}), using Fisher's
p-value referred to as @url{doi:10.1111/j.1467-9574.1970.tb00104.x,
Boschloo's test (1970)}, or using a Z-statistic (@url{doi:10.2307/2981892,
Suissa and Shuster (1985)}).  For comparing two binary proportions,
performs unconditional exact test using McNemar's Z-statistic
(@url{doi:10.1191/0962280203sm312ra, Berger and Sidik (2003)}), using
McNemar's Z-statistic with continuity correction, or using CSM test.
Calculates confidence intervals for the difference in proportion.")
    (license license:gpl2)))

(define-public r-fail
  (package
    (name "r-fail")
    (version "1.3")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "fail" version))
       (sha256
        (base32
         "0vfm6kmpmgsamda5p0sl771kbnsscan31l2chzssyw93kwmams7d"))))
    (build-system r-build-system)
    (propagated-inputs
     (list r-bbmisc r-checkmate))
    (native-inputs (list r-testthat))
    (home-page "https://github.com/mllg/fail")
    (synopsis "File abstraction interface layer (FAIL)")
    (description
     "This package provides a more comfortable interface to work with R data
or source files in a key-value fashion.")
    (license license:bsd-3)))

(define-public r-fastcluster
  (package
    (name "r-fastcluster")
    (version "1.3.0")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "fastcluster" version))
       (sha256
        (base32
         "1yv3nd8s9f45pqkv4srv41chh8ij0vikprfwgyphakc0xc9lj8gw"))))
    (build-system r-build-system)
    (home-page "http://danifold.net/fastcluster.html")
    (synopsis "Fast hierarchical clustering routines")
    (description
     "This package implements fast hierarchical, agglomerative clustering
routines.  Part of the functionality is designed as drop-in replacement for
existing routines: @code{linkage()} in the SciPy package
@code{scipy.cluster.hierarchy}, @code{hclust()} in R's @code{stats} package,
and the @code{flashClust} package.  It provides the same functionality with
the benefit of a much faster implementation.  Moreover, there are
memory-saving routines for clustering of vector data, which go beyond what the
existing packages provide.")
    (license license:bsd-2)))

(define-public r-fastica
  (package
    (name "r-fastica")
    (version "1.2-7")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "fastICA" version))
       (sha256
        (base32
         "08cw1aszsi4i8asfrzyyz66wl70g50y1dndmf8j8kqvhw1r6kdxw"))))
    (properties `((upstream-name . "fastICA")))
    (build-system r-build-system)
    (home-page "https://cran.r-project.org/web/packages/fastICA")
    (synopsis "FastICA algorithms to perform ICA and projection pursuit")
    (description
     "This package provides an implementation of the FastICA algorithm to
perform @dfn{independent component analysis} (ICA) and projection pursuit.")
    ;; Any GPL version.
    (license license:gpl3+)))

(define-public r-fateid
  (package
    (name "r-fateid")
    (version "0.2.2")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "FateID" version))
       (sha256
        (base32 "0sgvaqhqkmmkcsl53bm1jlfpzrvzfb5cz8k513nizfsi638vydlm"))))
    (properties `((upstream-name . "FateID")))
    (build-system r-build-system)
    (propagated-inputs (list r-locfit
                             r-matrixstats
                             r-pheatmap
                             r-princurve
                             r-randomforest
                             r-rcolorbrewer
                             r-rtsne
                             r-som
                             r-umap))
    (native-inputs (list r-knitr))
    (home-page "https://cran.r-project.org/package=FateID")
    (synopsis "Quantification of fate bias in multipotent progenitors")
    (description
     "This package computes cell fate bias for multi-lineage single-cell data.
It also provides visualization tools for analyzing these biases.")
    (license license:gpl3)))

(define-public r-fdrtool
  (package
    (name "r-fdrtool")
    (version "1.2.18")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "fdrtool" version))
       (sha256
        (base32
         "1vxswr56c63vvl2q6m0j0a5psdw724vspf6zxlr1k9zsdfcnd6b4"))))
    (build-system r-build-system)
    (home-page "https://strimmerlab.org/software/fdrtool/")
    (synopsis "Estimation of false discovery rates and higher criticism")
    (description
     "This package provides tools to estimate tail area-based false discovery
rates as well as local false discovery rates for a variety of null
models (p-values, z-scores, correlation coefficients, t-scores).  The
proportion of null values and the parameters of the null distribution are
adaptively estimated from the data.  In addition, the package contains
functions for non-parametric density estimation (Grenander estimator), for
monotone regression (isotonic regression and antitonic regression with
weights), for computing the @dfn{greatest convex minorant} (GCM) and the
@dfn{least concave majorant} (LCM), for the half-normal and correlation
distributions, and for computing empirical @dfn{higher criticism} (HC) scores
and the corresponding decision threshold.")
    (license license:gpl3+)))

(define-public r-fit-models
  (package
    (name "r-fit-models")
    (version "0.64")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "fit.models" version))
       (sha256
        (base32
         "1nk4x2q8cv79zcls61saf627ac0fci6jcrd6lmzk61asm2zhc27p"))))
    (properties `((upstream-name . "fit.models")))
    (build-system r-build-system)
    (propagated-inputs
     (list r-lattice))
    (native-inputs (list r-mass))
    (home-page "https://cran.r-project.org/web/packages/fit.models")
    (synopsis "Compare fitted models")
    (description
     "The @code{fit.models} function and its associated methods (coefficients,
print, summary, plot, etc.) were originally provided in the @code{robust}
package to compare robustly and classically fitted model objects.  The aim of
the @code{fit.models} package is to separate this fitted model object
comparison functionality from the robust package and to extend it to support
fitting methods (e.g., classical, robust, Bayesian, regularized, etc.) more
generally.")
    ;; Any version of the GPL
    (license (list license:gpl2+ license:gpl3+))))

(define-public r-fivethirtyeight
  (package
    (name "r-fivethirtyeight")
    (version "0.1.0")
    (source
     (origin
       (method url-fetch)
       (uri (string-append "https://mran.microsoft.com/src/contrib/"
                           "fivethirtyeight_" version ".tar.gz"))
       (sha256
        (base32
         "0fcc8rq745nsghp27dk0lgih90y4zx8hrzcvsn6ih786yv7qxhvl"))))
    (build-system r-build-system)
    (propagated-inputs
     (list r-knitr
           r-rmarkdown
           r-dplyr
           r-readr
           r-ggplot2
           r-magrittr
           r-stringr))
    (home-page "https://mran.microsoft.com/package/fivethirtyeight/")
    (synopsis "Data and code behind the stories at FiveThirtyEight")
    (description "This R package provides access to the code and data sets
published by the statistics blog FiveThirtyEight.")
    (license license:expat)))

(define-public r-flexmix
  (package
    (name "r-flexmix")
    (version "2.3-20")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "flexmix" version))
       (sha256
        (base32
         "1s160zi8bsdwk2vq0f0a3cbki1j42zk14dp2abxbpfjzhxyl7621"))))
    (build-system r-build-system)
    (propagated-inputs
     (list r-lattice r-modeltools r-nnet))
    (home-page "https://cran.r-project.org/web/packages/flexmix")
    (synopsis "Flexible mixture modeling")
    (description
     "This package implements a general framework for finite mixtures of
regression models using the EM algorithm.  FlexMix provides the E-step and all
data handling, while the M-step can be supplied by the user to easily define
new models.  Existing drivers implement mixtures of standard linear models,
generalized linear models and model-based clustering.")
    (license license:gpl2+)))

(define-public r-forcats
  (package
    (name "r-forcats")
    (version "1.0.0")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "forcats" version))
       (sha256
        (base32
         "0ki5c84n7xm4iw4aj629l51hm84f6p5wa3bw88d1wbnr15wibfy5"))))
    (build-system r-build-system)
    (propagated-inputs
     (list r-cli
           r-glue
           r-lifecycle
           r-magrittr
           r-rlang
           r-tibble))
    (native-inputs
     (list r-knitr r-testthat))
    (home-page "https://forcats.tidyverse.org")
    (synopsis "Tools for working with factors")
    (description "This package provides helpers for reordering factor
levels (including moving specified levels to front, ordering by first
appearance, reversing, and randomly shuffling), and tools for modifying factor
levels (including collapsing rare levels into other, \"anonymizing\", and
manually \"recoding\").")
    (license license:gpl3)))

(define-public r-foreach
  (package
    (name "r-foreach")
    (version "1.5.2")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "foreach" version))
       (sha256
        (base32
         "1r5gdf9fp3rprvrhf0gzl9qmmqhgdn5gscpm5hk8zxpraf3qscsn"))))
    (build-system r-build-system)
    ;; Tests require doparallel, which we cannot add because of a dependency
    ;; cycle.
    (arguments (list #:tests? #false))
    (propagated-inputs
     (list r-codetools r-iterators))
    (native-inputs
     (list r-knitr))
    (home-page "https://cran.r-project.org/web/packages/foreach")
    (synopsis "Foreach looping construct for R")
    (description
     "This package provides support for the @code{foreach} looping construct.
@code{foreach} is an idiom that allows for iterating over elements in a
collection, without the use of an explicit loop counter.  This package in
particular is intended to be used for its return value, rather than for its
side effects.  In that sense, it is similar to the standard @code{lapply}
function, but doesn't require the evaluation of a function.  Using
@code{foreach} without side effects also facilitates executing the loop in
parallel.")
    (license license:asl2.0)))

(define-public r-formatr
  (package
    (name "r-formatr")
    (version "1.14")
    (source (origin
              (method url-fetch)
              (uri (cran-uri "formatR" version))
              (sha256
               (base32
                "0k271w4bhlj7r9igkiyfw7d7bg30s2mn4sr4alb8f9w57wnapfjf"))))
    (build-system r-build-system)
    (native-inputs
     (list r-knitr r-testit))
    (home-page "https://yihui.org/formatr/")
    (synopsis "Format R code automatically")
    (description
     "This package provides a function to format R source code.  Spaces and
indent will be added to the code automatically, and comments will be preserved
under certain conditions, so that R code will be more human-readable and tidy.
There is also a Shiny app as a user interface in this package.")
    (license license:gpl3+)))

(define-public r-formula
  (package
    (name "r-formula")
    (version "1.2-5")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "Formula" version))
       (sha256
        (base32
         "0p1m9pqcn8ns0sn67js53677q8gwxgbl4bymcn5y2r0dc1s4c9c6"))))
    (properties `((upstream-name . "Formula")))
    (build-system r-build-system)
    (home-page "https://cran.r-project.org/web/packages/Formula")
    (synopsis "Extended model formulas")
    (description
     "This package provides a new class @code{Formula}, which extends the base
class @code{formula}.  It supports extended formulas with multiple parts of
regressors on the right-hand side and/or multiple responses on the left-hand
side.")
    (license (list license:gpl2+ license:gpl3+))))

(define-public r-fpc
  (package
    (name "r-fpc")
    (version "2.2-13")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "fpc" version))
       (sha256
        (base32
         "0irzsl1g71z7kl0qrklkv0rv9byv017lh5klp5hfw3xw8zw3sm2g"))))
    (build-system r-build-system)
    ;; FIXME Test fails with this message:
    ;; attempt to select less than one element in get1index <real>
    (arguments (list #:tests? #false))
    (propagated-inputs
     (list r-class
           r-cluster
           r-diptest
           r-flexmix
           r-kernlab
           r-mass
           r-mclust
           r-prabclus
           r-robustbase))
    (home-page "https://cran.r-project.org/web/packages/fpc")
    (synopsis "Flexible procedures for clustering")
    (description
     "This package provides various methods for clustering and cluster
validation.  For example, it provides fixed point clustering, linear
regression clustering, clustering by merging Gaussian mixture components, as
well as symmetric and asymmetric discriminant projections for visualisation of
the separation of groupings.")
  (license license:gpl2+)))

(define-public r-futile-logger
  (package
    (name "r-futile-logger")
    (version "1.4.3")
    (source (origin
              (method url-fetch)
              (uri (cran-uri "futile.logger" version))
              (sha256
               (base32
                "1r3nayk0z9n1svbf8640vw90dal5q07nkn0gv4bnva3pbzb352sy"))))
    (properties `((upstream-name . "futile.logger")))
    (build-system r-build-system)
    (propagated-inputs
     (list r-futile-options r-lambda-r))
    (native-inputs (list r-testthat))
    (home-page "https://cran.r-project.org/web/packages/futile.logger")
    (synopsis "Logging utility for R")
    (description
     "This package provides a simple yet powerful logging utility.  Based
loosely on log4j, futile.logger takes advantage of R idioms to make logging a
convenient and easy to use replacement for @code{cat} and @code{print}
statements.")
    (license license:lgpl3+)))

(define-public r-futile-options
  (package
    (name "r-futile-options")
    (version "1.0.1")
    (source (origin
              (method url-fetch)
              (uri (cran-uri "futile.options" version))
              (sha256
               (base32
                "0w15agpi88y3qkv6fl72zy2pzyplzgvnj41a4ixhg64mw1sck73s"))))
    (properties
     `((upstream-name . "futile.options")))
    (build-system r-build-system)
    (home-page "https://cran.r-project.org/web/packages/futile.options")
    (synopsis "Options management framework")
    (description
     "The futile.options subsystem provides an easy user-defined options
management system that is properly scoped.  This means that options created
via @code{futile.options} are fully self-contained and will not collide with
options defined in other packages.")
    (license license:lgpl3+)))

(define-public r-fuzzyjoin
  (package
    (name "r-fuzzyjoin")
    (version "0.1.6")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "fuzzyjoin" version))
       (sha256
        (base32 "0s5rhqz8vih4za3a8k1k7i3gq8hj0w7bqnakw40k6mg87jvyzsj7"))))
    (properties `((upstream-name . "fuzzyjoin")))
    (build-system r-build-system)
    (propagated-inputs (list r-dplyr
                             r-geosphere
                             r-purrr
                             r-stringdist
                             r-stringr
                             r-tibble
                             r-tidyr))
    (native-inputs (list r-ggplot2 r-knitr r-testthat))
    (home-page "https://github.com/dgrtwo/fuzzyjoin")
    (synopsis "Join tables together on inexact matching")
    (description
     "Join tables together based not on whether columns match exactly, but
whether they are similar by some comparison.  Implementations include string
distance and regular expression matching.")
    (license license:expat)))

(define-public r-gdata
  (package
    (name "r-gdata")
    (version "3.0.1")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "gdata" version))
       (sha256
        (base32
         "0qiqfrk0qi8k1f6kvfkgp43algjdgfx6w5xmqrpyzh535gfrcfnv"))))
    (build-system r-build-system)
    (propagated-inputs
     (list r-gtools))
    (native-inputs (list r-runit))
    (home-page "https://cran.r-project.org/web/packages/gdata")
    (synopsis "Various R programming tools for data manipulation")
    (description
     "This package provides various R programming tools for data manipulation,
including:

@itemize
@item medical unit conversions
@item combining objects
@item character vector operations
@item factor manipulation
@item obtaining information about R objects
@item generating fixed-width format files
@item extricating components of date and time objects
@item operations on columns of data frames
@item matrix operations
@item operations on vectors and data frames
@item value of last evaluated expression
@item wrapper for @code{sample} that ensures consistent behavior for
  both scalar and vector arguments
@end itemize\n")
    (license license:gpl2+)))

(define-public r-gdtools
  (package
    (name "r-gdtools")
    (version "0.4.2")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "gdtools" version))
       (sha256
        (base32
         "0dj7xzvmkl82c8ghm4p7km1f13a34zm4nlhx4yj4ipmjqxalkrzd"))))
    (build-system r-build-system)
    (arguments
     (list
      #:phases
      '(modify-phases %standard-phases
         ;; This is needed for tests.
         (add-after 'unpack 'set-HOME
           (lambda _ (setenv "HOME" "/tmp"))))))
    (native-inputs
     (list pkg-config r-gfonts r-testthat))
    (inputs
     (list cairo fontconfig freetype zlib))
    (propagated-inputs
     (list r-fontquiver r-htmltools r-rcpp r-systemfonts))
    (home-page "https://cran.r-project.org/web/packages/gdtools")
    (synopsis "Utilities for graphical rendering")
    (description
     "The @code{gdtools} package provides functionalities to get font metrics
and to generate base64 encoded string from raster matrix.")
    (license license:gpl3)))

(define-public r-gfonts
  (package
    (name "r-gfonts")
    (version "0.2.0")
    (source (origin
              (method url-fetch)
              (uri (cran-uri "gfonts" version))
              (sha256
               (base32
                "19ja087k767bq71v2w4jcpynd62ysrqmjf6rpfnmmd40aanyxqkj"))))
    (properties `((upstream-name . "gfonts")))
    (build-system r-build-system)
    (propagated-inputs
     (list r-crayon
           r-crul
           r-glue
           r-htmltools
           r-jsonlite
           r-shiny))
    (native-inputs (list r-knitr r-testthat r-vcr))
    (home-page "https://dreamrs.github.io/gfonts/")
    (synopsis "Offline Google fonts for Markdown and Shiny")
    (description
     "This package lets you download Google fonts and generate CSS to use in
rmarkdown documents and Shiny applications.  Some popular fonts are included
and ready to use.")
    (license license:gpl3)))

(define-public r-ggalt
  (package
    (name "r-ggalt")
    (version "0.4.0")
    (source (origin
              (method url-fetch)
              (uri (cran-uri "ggalt" version))
              (sha256
               (base32
                "0ssa274d41vhd6crzjz7jqzbwgnjimxwxl23p2cx35aqs5wdfjpc"))))
    (properties `((upstream-name . "ggalt")))
    (build-system r-build-system)
    (propagated-inputs
     (list r-ash
           r-dplyr
           r-extrafont
           r-ggplot2
           r-gtable
           r-kernsmooth
           r-maps
           r-mass
           r-plotly
           r-proj4
           r-rcolorbrewer
           r-scales
           r-tibble))
    (native-inputs (list r-knitr r-testthat))
    (home-page "https://github.com/hrbrmstr/ggalt")
    (synopsis
     "Geometries, coordinate systems, fonts and more for ggplot2")
    (description
     "This package provides a compendium of new geometries, coordinate systems,
statistical transformations, scales and fonts for ggplot2, including splines,
1d and 2d densities, univariate average shifted histograms, a new map
coordinate system based on the PROJ.4-library along with
@code{geom_cartogram()} that mimics the original functionality of
@code{geom_map()}, formatters for \"bytes\", a @code{stat_stepribbon()}
function, increased @code{plotly} compatibility and the @code{StateFace} open
source font ProPublica.  Further new functionality includes lollipop charts,
dumbbell charts, the ability to encircle points and coordinate-system-based
text annotations.")
    (license license:agpl3)))

(define-public r-ggbeeswarm
  (package
    (name "r-ggbeeswarm")
    (version "0.7.2")
    (source (origin
              (method url-fetch)
              (uri (cran-uri "ggbeeswarm" version))
              (sha256
               (base32
                "1rcw54isai05np4fj19vcxx2vcxq7y2nm3az9m8xwbc9pdjs4z7x"))))
    (build-system r-build-system)
    (propagated-inputs
     (list r-beeswarm r-cli r-ggplot2 r-lifecycle r-vipor))
    (home-page "https://github.com/eclarke/ggbeeswarm")
    (synopsis "Categorical scatter (violin point) plots")
    (description
     "This package provides two methods of plotting categorical scatter plots
such that the arrangement of points within a category reflects the density of
data at that region, and avoids over-plotting.")
    (license license:gpl2+)))

(define-public r-ggbreak
  (package
    (name "r-ggbreak")
    (version "0.1.4")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "ggbreak" version))
       (sha256
        (base32 "0paqjx3jlnnwgy7iaaqlslcmngcdprwf1pxknazcj2v91yal40v8"))))
    (properties `((upstream-name . "ggbreak")))
    (build-system r-build-system)
    (propagated-inputs (list r-aplot
                             r-ggfun
                             r-ggplot2
                             r-ggplotify
                             r-rlang
                             r-yulab-utils))
    (native-inputs (list r-knitr))
    (home-page "https://github.com/YuLab-SMU/ggbreak")
    (synopsis "Set axis break for ggplot2")
    (description
     "This package provides an implementation of scale functions for setting
axis breaks of a ggplot.")
    (license license:artistic2.0)))

(define-public r-ggdendro
  (package
    (name "r-ggdendro")
    (version "0.2.0")
    (source (origin
              (method url-fetch)
              (uri (cran-uri "ggdendro" version))
              (sha256
               (base32
                "0sdayyzvhkbli0ha68mc0f7cgp36njv9ign37d63l21hvd6w6h0r"))))
    (build-system r-build-system)
    (propagated-inputs
     (list r-ggplot2 r-mass))
    (native-inputs
     (list r-knitr r-testthat))
    (home-page "https://github.com/andrie/ggdendro")
    (synopsis "Create dendrograms and tree diagrams using ggplot2")
    (description "This is a set of tools for dendrograms and tree plots using
ggplot2.  The ggplot2 philosophy is to clearly separate data from the
presentation.  Unfortunately the plot method for dendrograms plots directly to
a plot device with out exposing the data.  The ggdendro package resolves this
by making available functions that extract the dendrogram plot data.  The
package provides implementations for tree, rpart, as well as diana and agnes
cluster diagrams.")
    (license license:gpl2+)))

(define-public r-ggdist
  (package
    (name "r-ggdist")
    (version "3.3.3")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "ggdist" version))
       (sha256
        (base32 "0wrnzl6m221k2h7rv5vf88va83yc6hsdm45fp5yz96cpmfr66mgk"))))
    (properties
     '((upstream-name . "ggdist")))
    (build-system r-build-system)
    (propagated-inputs (list r-cli
                             r-distributional
                             r-ggplot2
                             r-glue
                             r-gtable
                             r-numderiv
                             r-quadprog
                             r-rcpp
                             r-rlang
                             r-scales
                             r-tibble
                             r-vctrs
                             r-withr))
    (native-inputs
     (list r-dplyr
           r-knitr
           r-posterior
           r-testthat
           r-tidyr
           r-vdiffr))
    (home-page "https://mjskay.github.io/ggdist/")
    (synopsis "Visualizations of distributions and uncertainty")
    (description
     "This package provides primitives for visualizing distributions using
ggplot2 that are particularly tuned for visualizing uncertainty in either a
frequentist or Bayesian mode.  Both analytical distributions (such as
frequentist confidence distributions or Bayesian priors) and distributions
represented as samples (such as bootstrap distributions or Bayesian posterior
samples) are easily visualized.")
    (license license:gpl3+)))

(define-public r-ggfittext
  (package
    (name "r-ggfittext")
    (version "0.10.2")
    (source (origin
              (method url-fetch)
              (uri (cran-uri "ggfittext" version))
              (sha256
               (base32
                "0glc4wh8flryv4mydzgk8a3lj7dzg2ip45gsxr472jgbg56a95mp"))))
    (properties `((upstream-name . "ggfittext")))
    (build-system r-build-system)
    (propagated-inputs (list r-cli r-ggplot2 r-gridtext r-shades r-stringi))
    (native-inputs (list r-knitr r-testthat r-vdiffr))
    (home-page "https://wilkox.org/ggfittext/")
    (synopsis "Ggfittext is a ggplot2 extension for fitting text into boxes")
    (description
     "Ggfittext is a ggplot2 extension for fitting text into boxes.")
    (license license:gpl2)))

(define-public r-ggplot2
  (package
    (name "r-ggplot2")
    (version "3.5.2")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "ggplot2" version))
       (sha256
        (base32 "1gq63zz76pqv5pj07pji10z4yl7dcd2z3j13490nkrgk5x504c0a"))))
    (properties
     '((updater-extra-native-inputs . ("r-mapproj"))))
    (build-system r-build-system)
    (propagated-inputs
     (list r-cli
           r-glue
           r-gtable
           r-isoband
           r-lifecycle
           r-mass
           r-mgcv
           r-rlang
           r-scales
           r-svglite ; Needed for 'ggsave'
           r-tibble
           r-vctrs
           r-withr))
    (native-inputs
     ;; We don't need any of the other inputs that the importer adds.
     (list r-knitr r-mapproj r-testthat))
    (home-page "https://ggplot2.tidyverse.org")
    (synopsis "Implementation of the grammar of graphics")
    (description
     "Ggplot2 is an implementation of the grammar of graphics in R.  It
combines the advantages of both base and lattice graphics: conditioning and
shared axes are handled automatically, and you can still build up a plot step
by step from multiple data sources.  It also implements a sophisticated
multidimensional conditioning system and a consistent interface to map data to
aesthetic attributes.")
    (license license:gpl2+)))

(define-public r-ggstats
  (package
    (name "r-ggstats")
    (version "0.9.0")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "ggstats" version))
       (sha256
        (base32 "110c9xcrc7rvn4lw8z0lnza3zi327biqbkg90idpjj7gzmwkf3v1"))))
    (properties
     '((upstream-name . "ggstats")
       (updater-extra-native-inputs . ("r-broom-helpers"))))
    (build-system r-build-system)
    (propagated-inputs (list r-cli
                             r-dplyr
                             r-forcats
                             r-ggplot2
                             r-lifecycle
                             r-patchwork
                             r-purrr
                             r-rlang
                             r-scales
                             r-stringr
                             r-tidyr))
    (native-inputs (list r-broom
                         r-broom-helpers
                         r-knitr
                         r-labelled
                         r-nnet
                         r-pscl
                         r-survey
                         r-survival
                         r-testthat
                         r-vdiffr))
    (home-page "https://larmarange.github.io/ggstats/")
    (synopsis "Extension to ggplot2 for plotting stats")
    (description
     "This package provides new statistics, new geometries and new positions
for ggplot2 and a suite of functions to facilitate the creation of statistical
plots.")
    (license license:gpl3+)))

(define-public r-ggstatsplot
  (package
    (name "r-ggstatsplot")
    (version "0.13.1")
    (source (origin
              (method url-fetch)
              (uri (cran-uri "ggstatsplot" version))
              (sha256
               (base32
                "0qqlfq6w3z1qb09laibf9c4w7cgnz063i8kr3yrqnr5076ww3kqf"))))
    (properties `((upstream-name . "ggstatsplot")))
    (build-system r-build-system)
    (propagated-inputs (list r-correlation
                             r-datawizard
                             r-dplyr
                             r-ggcorrplot
                             r-ggplot2
                             r-ggrepel
                             r-ggside
                             r-ggsignif
                             r-glue
                             r-insight
                             r-paletteer
                             r-parameters
                             r-patchwork
                             r-performance
                             r-purrr
                             r-rlang
                             r-statsexpressions
                             r-tidyr))
    (native-inputs (list r-knitr
                         r-survival
                         r-testthat
                         r-tibble
                         r-vdiffr
                         r-withr
                         r-wrs2))
    (home-page "https://indrajeetpatil.github.io/ggstatsplot/")
    (synopsis "Based plots with statistical details")
    (description
     "This package generates graphics with embedded details from statistical tests.
Statistical tests included in the plots themselves.  It provides an easier
syntax to generate information-rich plots for statistical analysis of
continuous or categorical data.  Currently, it supports the most common
types of statistical approaches and tests: parametric, nonparametric,
robust, and Bayesian versions of t-test/ANOVA, correlation analyses,
contingency table analysis, meta-analysis, and regression analyses.")
    (license license:gpl3)))

(define-public r-ggsurvfit
  (package
    (name "r-ggsurvfit")
    (version "1.1.0")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "ggsurvfit" version))
       (sha256
        (base32 "0c3qv9gii3ndqip3nxs08bx7lvh6sm46mxz8nyi627zbgqmhwrr5"))))
    (properties
     '((upstream-name . "ggsurvfit")
       (updater-ignored-native-inputs . ("r-tidycmprsk"))))
    (build-system r-build-system)
    ;; Some 20 tests require tidycmprsk, which pulls in React.  So I'm happy
    ;; to ignore the tests.
    (arguments (list #:tests? #false))
    (propagated-inputs (list r-broom
                             r-cli
                             r-dplyr
                             r-ggplot2
                             r-glue
                             r-gtable
                             r-patchwork
                             r-rlang
                             r-survival
                             r-tidyr))
    (native-inputs (list r-knitr
                         r-scales
                         r-spelling
                         r-testthat
                         r-vdiffr
                         r-withr))
    (home-page "https://github.com/pharmaverse/ggsurvfit")
    (synopsis "Flexible time-to-event figures")
    (description
     "This package is meant to ease the creation of
time-to-event (i.e. survival) endpoint figures.  The modular functions create
figures ready for publication.  Each of the functions that add to or modify
the figure are written as proper ggplot2 @code{geoms} or @code{stat} methods,
allowing the functions from this package to be combined with any function or
customization from ggplot2 and other ggplot2 extension packages.")
    (license license:expat)))

(define-public r-ggthemes
  (package
    (name "r-ggthemes")
    (version "5.1.0")
    (source (origin
              (method url-fetch)
              (uri (cran-uri "ggthemes" version))
              (sha256
               (base32
                "03mxigi34nd05wjigm8lpcbyhp4c8jxz7zm04qs27clbzsn1jj07"))))
    (properties
     '((updater-extra-native-inputs . ("r-dplyr"))))
    (build-system r-build-system)
    (propagated-inputs
     (list r-ggplot2
           r-lifecycle
           r-purrr
           r-scales
           r-stringr
           r-tibble))
    (native-inputs (list r-dplyr r-testthat))
    (home-page "https://cran.rstudio.com/web/packages/ggthemes")
    (synopsis "Extra themes, scales and geoms for @code{ggplot2}")
    (description "This package provides extra themes and scales for
@code{ggplot2} that replicate the look of plots by Edward Tufte and Stephen
Few in Fivethirtyeight, The Economist, Stata, Excel, and The Wall Street
Journal, among others.  This package also provides @code{geoms} for Tufte's
box plot and range frame.")
    (license license:gpl2)))

(define-public r-ggupset
  (package
    (name "r-ggupset")
    (version "0.4.1")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "ggupset" version))
       (sha256
        (base32 "08kk3hc0ipkpkwr90kkjfgz6r8rjjfbdmrzawrkg8j51a8h0lyp8"))))
    (properties `((upstream-name . "ggupset")))
    (build-system r-build-system)
    (propagated-inputs (list r-ggplot2 r-gtable r-rlang r-scales r-tibble))
    (native-inputs (list r-testthat))
    (home-page "https://github.com/const-ae/ggupset")
    (synopsis "Combination matrix axis for ggplot2 to create UpSet plots")
    (description
     "This package lets you replace the standard x-axis in ggplots with a
combination matrix to visualize complex set overlaps.  UpSet has introduced a
new way to visualize the overlap of sets as an alternative to Venn diagrams.
This package provides a simple way to produce such plots using ggplot2.  In
addition it can convert any categorical axis into a combination matrix axis.")
    (license license:gpl3)))

(define-public r-git2r
  (package
    (name "r-git2r")
    (version "0.36.2")
    (source (origin
              (method url-fetch)
              (uri (cran-uri "git2r" version))
              (sha256
               (base32
                "1b6ccsvaab63vyb04jszs352fk03hazg6cav4wv8h1f4al2z1m4c"))))
    (properties
     '((updater-extra-native-inputs . ("tzdata-for-tests"))
       (updater-ignored-native-inputs . ("openssh" "openssl" "pcre2"))))
    (build-system r-build-system)
    (inputs
     (list libgit2 zlib))
    (native-inputs
     (list pkg-config tzdata-for-tests))
    (home-page "https://github.com/ropensci/git2r")
    (synopsis "Access Git repositories with R")
    (description
     "This package provides an R interface to the libgit2 library, which is a
pure C implementation of the Git core methods.")
    ;; GPLv2 only with linking exception.
    (license license:gpl2)))

(define-public r-glba
  (package
    (name "r-glba")
    (version "0.2.1")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "glba" version))
       (sha256
        (base32 "0dilf144xfn454xfsndbddhc28gzf36fiknc2qwcx3bp7z5caqjn"))))
    (properties `((upstream-name . "glba")))
    (build-system r-build-system)
    (home-page "https://cran.r-project.org/package=glba")
    (synopsis "General linear ballistic accumulator models")
    (description
     "This package lets you analyze response times and accuracies from
psychological experiments with the @dfn{linear ballistic accumulator} (LBA)
model from Brown and Heathcote (2008).  The LBA model is optionally fitted
with explanatory variables on the parameters such as the drift rate, the
boundary and the starting point parameters.  A log-link function on the linear
predictors can be used to ensure that parameters remain positive when
needed.")
    (license (list license:gpl2+ license:gpl3+))))

(define-public r-gld
  (package
    (name "r-gld")
    (version "2.6.7")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "gld" version))
       (sha256
        (base32 "0w50nn1cp8mzjxp8403ymqh7f3iz0nk5wa8ms97d02lqp2jgfvyc"))))
    (properties `((upstream-name . "gld")))
    (build-system r-build-system)
    (propagated-inputs (list r-e1071 r-lmom))
    (home-page "https://cran.r-project.org/package=gld")
    (synopsis
     "Estimation and use of the generalised (Tukey) lambda distribution")
    (description
     "The generalised lambda distribution, or Tukey lambda distribution,
provides a wide variety of shapes with one functional form.  This package
provides random numbers, quantiles, probabilities, densities and
density quantiles for four different types of the distribution, the FKML
(Freimer et al 1988), RS (Ramberg and Schmeiser 1974), GPD (van Staden and
Loots 2009) and FM5 - see documentation for details.  It provides the density
function, distribution function, and Quantile-Quantile plots.  It implements a
variety of estimation methods for the distribution, including diagnostic
plots.  Estimation methods include the starship (all 4 types), method of
L-Moments for the GPD and FKML types, and a number of methods for only the
FKML type.  These include maximum likelihood, maximum product of spacings,
Titterington's method, Moments, Trimmed L-Moments and Distributional Least
Absolutes.")
    (license license:gpl2+)))

(define-public r-glinternet
  (package
    (name "r-glinternet")
    (version "1.0.12")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "glinternet" version))
       (sha256
        (base32
         "0aphdscj0s6kqxlkgqkw2d6snrylz6hiis6307pl8ldh7q5cvm33"))))
    (build-system r-build-system)
    (home-page "http://web.stanford.edu/~hastie/Papers/glinternet_jcgs.pdf")
    (synopsis "Learning interactions via hierarchical group-lasso regularization")
    (description "Group-Lasso INTERaction-NET.  Fits linear
pairwise-interaction models that satisfy strong hierarchy: if an interaction
coefficient is estimated to be nonzero, then its two associated main effects
also have nonzero estimated coefficients.  Accommodates categorical
variables (factors) with arbitrary numbers of levels, continuous variables,
and combinations thereof.  Implements the machinery described in the paper
\"Learning interactions via hierarchical group-lasso regularization\" (JCGS
2015, Volume 24, Issue 3).  Michael Lim & Trevor Hastie (2015)")
    (license license:gpl2)))

(define-public r-glmnet
  (package
   (name "r-glmnet")
   (version "4.1-8")
   (source
    (origin
     (method url-fetch)
     (uri (cran-uri "glmnet" version))
     (sha256
      (base32 "1znw1p1mi7nv39l7albcg6sfxj7a1jyjw85hb3ginv870z7fbnqx"))))
   (build-system r-build-system)
   (native-inputs
    (list gfortran r-knitr r-testthat))
   (propagated-inputs
    (list r-foreach
          r-matrix
          r-rcpp
          r-rcppeigen
          r-shape
          r-survival))
   (home-page "https://www.jstatsoft.org/article/view/v033i01")
   (synopsis "Lasso and elastic-net regularized generalized linear models")
   (description
    "The glmnet package provides efficient procedures for fitting the entire
lasso or elastic-net regularization path for linear and Poisson regression, as
well as logistic, multinomial, Cox, multiple-response Gaussian and grouped
multinomial models.  The algorithm uses cyclical coordinate descent in a
path-wise fashion.")
   (license license:gpl2+)))

(define-public r-glmpca
  (package
    (name "r-glmpca")
    (version "0.2.0")
    (source (origin
              (method url-fetch)
              (uri (cran-uri "glmpca" version))
              (sha256
               (base32
                "02xjf0gg52925hw9nw2j0znfmzfzfwbv0fxjl9d2fy9j63drr2h4"))))
    (properties `((upstream-name . "glmpca")))
    (build-system r-build-system)
    (propagated-inputs (list r-mass))
    (native-inputs (list r-knitr r-testthat))
    (home-page "https://github.com/willtownes/glmpca")
    (synopsis "Dimension Reduction of Non-Normally Distributed Data")
    (description
     "This package implements a generalized version of principal components
analysis (GLM-PCA) for dimension reduction of non-normally distributed data
such as counts or binary matrices.")
    (license license:lgpl3+)))

(define-public r-gmm
  (package
    (name "r-gmm")
    (version "1.8")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "gmm" version))
       (sha256
        (base32 "1n45dls7632b11bg6pipamp2zmp8j1hp4nlrj91r4schd9fgr6bh"))))
    (properties `((upstream-name . "gmm")))
    (build-system r-build-system)
    (propagated-inputs (list r-sandwich))
    (native-inputs (list gfortran r-knitr))
    (home-page "https://cran.r-project.org/package=gmm")
    (synopsis
     "Generalized method of moments and generalized empirical likelihood")
    (description
     "This is a complete suite to estimate models based on moment conditions.
It includes the two step Generalized method of moments (Hansen 1982;
<doi:10.2307/1912775>), the iterated GMM and continuous updated estimator
(Hansen, Eaton and Yaron 1996; <doi:10.2307/1392442>) and several methods that
belong to the Generalized Empirical Likelihood family of estimators (Smith
1997; <doi:10.1111/j.0013-0133.1997.174.x>, Kitamura 1997;
<doi:10.1214/aos/1069362388>, Newey and Smith 2004;
<doi:10.1111/j.1468-0262.2004.00482.x>, and Anatolyev 2005
<doi:10.1111/j.1468-0262.2005.00601.x>).")
    (license license:gpl2+)))

(define-public r-googledrive
  (package
    (name "r-googledrive")
    (version "2.1.1")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "googledrive" version))
       (sha256
        (base32
         "10pv70nvsqh1yc12g5fj7avfihjzpj02m8s9f8sb0c1np9s4z2qb"))))
    (properties
     '((upstream-name . "googledrive")
       (updater-extra-native-inputs . ("r-mockr"))))
    (build-system r-build-system)
    (propagated-inputs
     (list r-cli
           r-gargle
           r-glue
           r-httr
           r-jsonlite
           r-lifecycle
           r-magrittr
           r-pillar
           r-purrr
           r-rlang
           r-tibble
           r-uuid
           r-vctrs
           r-withr))
    (native-inputs
     (list r-knitr r-mockr r-testthat))
    (home-page "https://googledrive.tidyverse.org")
    (synopsis "Interface to Google Drive")
    (description "This package lets you manage Google Drive files from R.")
    (license license:expat)))

(define-public r-googlesheets
  (package
    (name "r-googlesheets")
    (version "0.3.0")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "googlesheets" version))
       (sha256
        (base32 "13n6vkdcbz78sbxq5xrj0zhq0dpriz6cyq13v3raa92152l88rm5"))))
    (build-system r-build-system)
    (propagated-inputs
     (list r-cellranger
           r-dplyr
           r-httr
           r-jsonlite
           r-purrr
           r-readr
           r-stringr
           r-tibble
           r-tidyr
           r-xml2))
    (native-inputs (list r-knitr r-testthat))
    (home-page "https://github.com/jennybc/googlesheets")
    (synopsis "Manage Google spreadsheets from R")
    (description "This package provides tools to interact with Google Sheets
from within R.")
    (license license:expat)))

(define-public r-googlevis
  (package
    (name "r-googlevis")
    (version "0.7.3")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "googleVis" version))
       (sha256
        (base32 "0swcf2vl3mvp2bsd7nra917pajyh27j2k3vmmrb6n8g55mazyisn"))))
    (properties `((upstream-name . "googleVis")))
    (build-system r-build-system)
    (propagated-inputs (list r-jsonlite))
    (native-inputs (list r-knitr r-rmarkdown))
    (home-page "https://mages.github.io/googleVis/")
    (synopsis "R interface to Google Charts")
    (description
     "The @code{googleVis} package provides an interface between R and the Google
Charts API.  Google Charts offer interactive charts which can be embedded into
web pages.  The functions of the @code{googleVis} package allow the user to
visualise data stored in R data frames with Google Charts without uploading
the data to Google.  The output of a @code{googleVis} function is HTML code
that contains the data and references to JavaScript functions hosted by
Google.  @code{googleVis} makes use of the internal R HTTP server to display
the output locally.")
    (license license:gpl2+)))

(define-public r-gpg
  (package
    (name "r-gpg")
    (version "1.3.0")
    (source (origin
              (method url-fetch)
              (uri (cran-uri "gpg" version))
              (sha256
               (base32
                "04hnmxvnxligd93vzvp38wpxpyxvqz5qd5084awklim846v3dg03"))))
    (properties
     '((upstream-name . "gpg")
       (updater-extra-inputs . ("gpgme"))))
    (build-system r-build-system)
    (inputs (list gpgme))
    (propagated-inputs (list r-askpass r-curl))
    (native-inputs (list pkg-config r-knitr))
    (home-page "https://github.com/jeroen/gpg")
    (synopsis "GNU Privacy Guard for R")
    (description
     "This package provides bindings to GnuPG for working with
OpenGPG (RFC4880) cryptographic methods.  It includes utilities for public key
encryption, creating and verifying digital signatures, and managing your local
keyring.  Some functionality depends on the version of GnuPG that is installed
on the system.")
    (license license:expat)))

(define-public r-gplots
  (package
    (name "r-gplots")
    (version "3.2.0")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "gplots" version))
       (sha256
        (base32
         "0isgbzsj0zkbzp5zvcz4nkc70rm33pcvcmfd6jiiqiw7nilirqqj"))))
    (build-system r-build-system)
    (propagated-inputs
     (list r-catools r-gtools r-kernsmooth))
    (native-inputs
     (list r-knitr))
    (home-page "https://cran.r-project.org/web/packages/gplots")
    (synopsis "Various R programming tools for plotting data")
    (description
     "This package provides various R programming tools for plotting data,
including:

@itemize
@item calculating and plotting locally smoothed summary function
@item enhanced versions of standard plots
@item manipulating colors
@item calculating and plotting two-dimensional data summaries
@item enhanced regression diagnostic plots
@item formula-enabled interface to @code{stats::lowess} function
@item displaying textual data in plots
@item balloon plots
@item plotting \"Venn\" diagrams
@item displaying Open-Office style plots
@item plotting multiple data on same region, with separate axes
@item plotting means and confidence intervals
@item spacing points in an x-y plot so they don't overlap
@end itemize\n")
    (license license:gpl2+)))

(define-public r-gridbase
  (package
    (name "r-gridbase")
    (version "0.4-7")
    (source (origin
              (method url-fetch)
              (uri (cran-uri "gridBase" version))
              (sha256
               (base32
                "09jzw4rzwf2y5lcz7b16mb68pn0fqigv34ff7lr6w3yi9k91i1xy"))))
    (build-system r-build-system)
    (home-page "https://cran.r-project.org/web/packages/gridBase")
    (synopsis "Integration of base and grid graphics")
    (description "This package provides an integration of base and grid
graphics for R.")
    (license license:gpl2+)))

(define-public r-gridextra
  (package
    (name "r-gridextra")
    (version "2.3")
    (source (origin
              (method url-fetch)
              (uri (cran-uri "gridExtra" version))
              (sha256
               (base32
                "0fwfk3cdwxxim7nd55pn7m31bcaqj48y06j7an2k1v1pybk0rdl1"))))
    (properties `((upstream-name . "gridExtra")))
    (build-system r-build-system)
    (propagated-inputs
     (list r-gtable))
    (native-inputs
     (list r-knitr r-testthat))         ;for building vignettes
    (home-page "https://github.com/baptiste/gridextra")
    (synopsis "Miscellaneous functions for \"Grid\" graphics")
    (description
     "This package provides a number of user-level functions to work with
@code{grid} graphics, notably to arrange multiple grid-based plots on a page,
and draw tables.")
    (license license:gpl2+)))

(define-public r-gsignal
  (package
    (name "r-gsignal")
    (version "0.3-7")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "gsignal" version))
       (sha256
        (base32 "1chkzv3bx1nas1yc6l5i3hgc8m40n1lm1y3c8577l8sqi89hnhs3"))))
    (properties `((upstream-name . "gsignal")))
    (build-system r-build-system)
    (propagated-inputs (list r-pracma r-rcpp))
    (native-inputs (list r-knitr r-testthat))
    (home-page "https://github.com/gjmvanboxtel/gsignal")
    (synopsis "Signal processing")
    (description
     "This package provides an R implementation of the Octave package
@code{signal}, containing a variety of signal processing tools, such as signal
generation and measurement, correlation and convolution, filtering, filter
design, filter analysis and conversion, power spectrum analysis, system
identification, decimation and sample rate change, and windowing.")
    (license license:gpl3)))

(define-public r-gson
  (package
    (name "r-gson")
    (version "0.1.0")
    (source (origin
              (method url-fetch)
              (uri (cran-uri "gson" version))
              (sha256
               (base32
                "10d3v543bvsyrwg3dm04xpzxjvmba1d1fhcf2zfb3l36pvjvxp8l"))))
    (properties `((upstream-name . "gson")))
    (build-system r-build-system)
    (propagated-inputs (list r-jsonlite r-rlang r-tidyr))
    (home-page "https://cran.r-project.org/package=gson")
    (synopsis "Base Class and Methods for 'gson' Format")
    (description
     "This package proposes a new file format named @code{gson} for storing
gene set and related information, and provides read, write and other utilities
to process this file format.")
    (license license:artistic2.0)))

(define-public r-gtable
  (package
    (name "r-gtable")
    (version "0.3.6")
    (source (origin
              (method url-fetch)
              (uri (cran-uri "gtable" version))
              (sha256
               (base32
                "1vz0kpj1hh3iz27yaax4i3l9n018py455p4f5nfn92r727xaa1fk"))))
    (properties `((upstream-name . "gtable")))
    (build-system r-build-system)
    (propagated-inputs
     (list r-cli r-glue r-lifecycle r-rlang))
    (native-inputs
     (list r-knitr r-testthat))
    (home-page "https://cran.r-project.org/web/packages/gtable")
    (synopsis "R library to arrange grobs in tables")
    (description
     "Gtable is a collection of tools to make it easier to work with
\"tables\" of grobs.")
    (license license:gpl2+)))

(define-public r-gtools
  (package
    (name "r-gtools")
    (version "3.9.5")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "gtools" version))
       (sha256
        (base32
         "0jqpvygxgr4m1rgaj5rzd048fwxvpcr4n1vx8bfabc9d2p0vdsfy"))))
    (build-system r-build-system)
    (home-page "https://cran.r-project.org/web/packages/gtools")
    (synopsis "Various R programming tools")
    (description
     "This package contains a collection of various functions to assist in R
programming, such as tools to assist in developing, updating, and maintaining
R and R packages, calculating the logit and inverse logit transformations,
tests for whether a value is missing, empty or contains only @code{NA} and
@code{NULL} values, and many more.")
    (license license:gpl2)))

(define-public r-guix-install
  (package
    (name "r-guix-install")
    (version "1.0.0")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "guix.install" version))
       (sha256
        (base32 "0s3wb5781yc43c9zwrn7i87zcbrlx7xr0ms0v9hvgs7qsv02id9j"))))
    (properties `((upstream-name . "guix.install")))
    (build-system r-build-system)
    (propagated-inputs (list r-runit))
    (home-page "https://github.com/BIMSBbioinfo/guix.install")
    (synopsis "Install R packages with GNU Guix")
    (description
     "This R package provides a single procedure @code{guix.install()}, which
allows users to install R packages via Guix right from within their running R
session.  If the requested R package does not exist in Guix at this time, the
package and all its missing dependencies will be imported recursively and the
generated package definitions will be written to @file{~/.Rguix/packages.scm}.
This record of imported packages can be used later to reproduce the
environment, and to add the packages in question to a proper Guix channel (or
Guix itself).  @code{guix.install()} not only supports installing packages
from CRAN, but also from Bioconductor or even arbitrary git or mercurial
repositories, replacing the need for installation via @code{devtools}.")
    (license license:gpl3+)))

(define-public r-gunifrac
  (package
    (name "r-gunifrac")
    (version "1.8")
    (source (origin
              (method url-fetch)
              (uri (cran-uri "GUniFrac" version))
              (sha256
               (base32
                "1yw0d8hb7s662xy0dny9ygvx9gwh7yj8dxw4897zy7zyjhzim95f"))))
    (properties `((upstream-name . "GUniFrac")))
    (build-system r-build-system)
    (propagated-inputs
     (list r-ape
           r-dirmult
           r-foreach
           r-ggplot2
           r-ggrepel
           r-inline
           r-mass
           r-matrix
           r-matrixstats
           r-modeest
           r-rcpp
           r-rmutil
           r-statmod
           r-vegan))
    (native-inputs (list r-knitr))
    (home-page "https://cran.r-project.org/package=GUniFrac")
    (synopsis
     "Generalized UniFrac distances and methods for microbiome data analysis")
    (description
     "This package provides a suite of methods for powerful and robust
microbiome data analysis, including data normalization, data simulation,
community-level association testing and differential abundance analysis.  It
implements generalized UniFrac distances, @dfn{Geometric Mean of Pairwise
Ratios} (GMPR) normalization, semiparametric data simulator, distance-based
statistical methods, and feature- based statistical methods.  The
distance-based statistical methods include three extensions of PERMANOVA:

@itemize
@item PERMANOVA using the Freedman-Lane permutation scheme,
@item PERMANOVA omnibus test using multiple matrices, and
@item analytical approach to approximating PERMANOVA p-value.
@end itemize

Feature-based statistical methods include linear model-based methods for
differential abundance analysis of zero-inflated high-dimensional
compositional data.")
    (license license:gpl3)))

(define-public r-gwasexacthw
  (package
    (name "r-gwasexacthw")
    (version "1.2")
    (source (origin
              (method url-fetch)
              (uri (cran-uri "GWASExactHW" version))
              (sha256
               (base32
                "1xzcvmbh27ibd7g9zlqyp215q4yfkhdypcvm5gjkvw1qhd3pl4yk"))))
    (properties `((upstream-name . "GWASExactHW")))
    (build-system r-build-system)
    (home-page "https://cran.r-project.org/package=GWASExactHW")
    (synopsis
     "Exact Hardy-Weinburg testing for Genome Wide Association Studies")
    (description
     "This package contains a function to do exact Hardy-Weinburg
testing (using Fisher's test) for SNP genotypes as typically obtained in a
@dfn{Genome Wide Association Study} (GWAS).")
    (license license:gpl3)))

(define-public r-gwidgets2
  (package
    (name "r-gwidgets2")
    (version "1.0-10")
    (source (origin
              (method url-fetch)
              (uri (cran-uri "gWidgets2" version))
              (sha256
               (base32
                "04wqyyk7wj808035862vsrmmhpvcailnscycpc83qfrkpqkr15v6"))))
    (properties `((upstream-name . "gWidgets2")))
    (build-system r-build-system)
    ;; Tests fail with: could not find function "gwindow"
    (arguments (list #:tests? #false))
    (propagated-inputs (list r-digest))
    (home-page "https://github.com/gWidgets3/gWidgets2")
    (synopsis "Rewrite of gWidgets API for simplified GUI construction")
    (description
     "This package provides a re-implementation of the @code{gWidgets} API.
The API is defined in this package.  A second, toolkit-specific package is
required to use it.")
    (license license:gpl3+)))

(define-public r-gwidgets2tcltk
  (package
    (name "r-gwidgets2tcltk")
    (version "1.0-8")
    (source (origin
              (method url-fetch)
              (uri (cran-uri "gWidgets2tcltk" version))
              (sha256
               (base32
                "02ic4avpa33dnqsnm1mzg7ci1psngk1p169pqf259szf6v39qf8h"))))
    (properties `((upstream-name . "gWidgets2tcltk")))
    (build-system r-build-system)
    (arguments
     (list
      #:phases
      #~(modify-phases %standard-phases
          (add-before 'install 'start-x-server
            (lambda _
              ;; Tests require a running X server.
              (system "Xvfb :1 +extension GLX &")
              (setenv "DISPLAY" ":1"))))))
    (propagated-inputs (list r-digest r-gwidgets2 r-memoise))
    (native-inputs
     (list r-testthat xorg-server-for-tests))
    (home-page "https://github.com/jverzani/gWidgets2tcltk")
    (synopsis "Toolkit implementation of gWidgets2 for tcltk")
    (description "This package is a port of the @code{gWidgets2} API for the
@code{tcltk} package.")
    (license license:gpl2+)))

(define-public r-ids
  (package
    (name "r-ids")
    (version "1.0.1")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "ids" version))
       (sha256
        (base32
         "1s6ga94gds5ydr9f8qbjfgfpg2dvbnkcrlybqlb33hk3c0c2l8dn"))))
    (properties `((upstream-name . "ids")))
    (build-system r-build-system)
    (propagated-inputs
     (list r-openssl r-uuid))
    (native-inputs (list r-knitr r-testthat))
    (home-page "https://github.com/richfitz/ids")
    (synopsis "Generate random identifiers")
    (description
     "This package lets you generate random or human readable and
pronounceable identifiers.")
    (license license:expat)))

(define-public r-irlba
  (package
    (name "r-irlba")
    (version "2.3.5.1")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "irlba" version))
       (sha256
        (base32
         "1ky5nlmyrnwz6121wwqd8p8r1ycnjkl5r290k4x2477rzs267zic"))))
    (build-system r-build-system)
    (propagated-inputs
     (list r-matrix))
    (home-page "https://cran.r-project.org/web/packages/irlba")
    (synopsis "Methods for eigendecomposition of large matrices")
    (description
     "This package provides fast and memory efficient methods for truncated
singular and eigenvalue decompositions, as well as for principal component
analysis of large sparse or dense matrices.")
    (license (list license:gpl2+ license:gpl3+))))

(define-public r-iterators
  (package
    (name "r-iterators")
    (version "1.0.14")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "iterators" version))
       (sha256
        (base32
         "0yv7rh6ghlfx727xy2aq64a7skyxp9msakaffs641q9h15d0gwyf"))))
    (build-system r-build-system)
    (native-inputs (list r-runit))
    (home-page "https://cran.r-project.org/web/packages/iterators")
    (synopsis "Iterator construct for R")
    (description
     "This package provides support for iterators, which allow a programmer to
traverse through all the elements of a vector, list, or other collection of
data.")
    (license license:asl2.0)))

(define-public r-googlesheets4
  (package
    (name "r-googlesheets4")
    (version "1.1.1")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "googlesheets4" version))
       (sha256
        (base32
         "1kzwhs9zrx1i4kqhdqrkzyhnwx25j8j2pcg7ja2dxfalihs67k65"))))
    (properties `((upstream-name . "googlesheets4")))
    (build-system r-build-system)
    (propagated-inputs
     (list r-cellranger
           r-cli
           r-curl
           r-gargle
           r-glue
           r-googledrive
           r-httr
           r-ids
           r-lifecycle
           r-magrittr
           r-purrr
           r-rematch2
           r-rlang
           r-tibble
           r-vctrs
           r-withr))
    (native-inputs (list r-testthat))
    (home-page "https://github.com/tidyverse/googlesheets4")
    (synopsis "Access Google Sheets using the Sheets API V4")
    (description
     "This package lets you interact with Google Sheets through the
@url{https://developers.google.com/sheets/api,Sheets API v4}.  This package
can read and write both the metadata and the cell data in a Sheet.")
    (license license:expat)))

(define-public r-pbapply
  (package
    (name "r-pbapply")
    (version "1.7-2")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "pbapply" version))
       (sha256
        (base32
         "04xf1p7c0066cwnxfmzaikbc322bxnw022ziv8kkhzlc6268rvdf"))))
    (build-system r-build-system)
    (native-inputs (list r-future))
    (home-page "https://github.com/psolymos/pbapply")
    (synopsis "Adding progress bar to apply functions")
    (description
     "This lightweight package that adds progress bar to vectorized R
functions apply.  The implementation can easily be added to functions where
showing the progress is useful e.g. bootstrap.")
    (license license:gpl2)))

(define-public r-pbkrtest
  (package
    (name "r-pbkrtest")
    (version "0.5.4")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "pbkrtest" version))
       (sha256
        (base32
         "08nq4fjgh4156cpw1y9x10bk13j98ix5xr36cdbhyd3cfvskyind"))))
    (build-system r-build-system)
    (propagated-inputs
     (list r-broom
           r-doby
           r-dplyr
           r-lme4
           r-mass
           r-matrix
           r-numderiv))
    (native-inputs
     (list r-knitr))
    (home-page "https://people.math.aau.dk/~sorenh/software/pbkrtest/")
    (synopsis "Methods for linear mixed model comparison")
    (description
     "This package implements a parametric bootstrap test and a Kenward Roger
modification of F-tests for linear mixed effects models and a parametric
bootstrap test for generalized linear mixed models.")
    (license license:gpl2+)))

(define-public r-pcapp
  (package
    (name "r-pcapp")
    (version "2.0-5")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "pcaPP" version))
       (sha256
        (base32
         "043w3g3f57j2d0irnrxm58mzzisg7xmnsl17v7wijsh1czcswkv7"))))
    (properties `((upstream-name . "pcaPP")))
    (build-system r-build-system)
    ;; Vignettes attempt to load the missing file "load.package.name.R".
    (arguments (list #:test-types '(list "tests")))
    (propagated-inputs
     (list r-mvtnorm))
    (home-page "https://cran.r-project.org/web/packages/pcaPP")
    (synopsis "Robust PCA by projection pursuit")
    (description
     "This package provides functions for robust @dfn{principal component
analysis} (PCA) by projection pursuit.")
    (license license:gpl3+)))

(define-public r-permute
  (package
   (name "r-permute")
   (version "0.9-7")
   (source
    (origin
     (method url-fetch)
     (uri (cran-uri "permute" version))
     (sha256
      (base32
       "1h4dyhcsv8p3h3qxsy98pib9v79dddvrnq7qx6abkblsazxqzy7g"))))
   (build-system r-build-system)
   (native-inputs (list r-knitr r-testthat))
   ;; Tests do not run correctly, but running them properly would entail a
   ;; circular dependency with vegan.
   (home-page "https://github.com/gavinsimpson/permute")
   (synopsis "Functions for generating restricted permutations of data")
   (description
    "This package provides a set of restricted permutation designs for freely
exchangeable, line transects (time series), spatial grid designs and permutation
of blocks (groups of samples).  @code{permute} also allows split-plot designs,
in which the whole-plots or split-plots or both can be freely exchangeable.")
   (license license:gpl2+)))

(define-public r-pkgconfig
  (package
    (name "r-pkgconfig")
    (version "2.0.3")
    (source (origin
              (method url-fetch)
              (uri (cran-uri "pkgconfig" version))
              (sha256
               (base32
                "0l1qph8zyi2sic3k2qcd7vlfl7rzfh1q7z7zvjkl5f7y1x2fy3rk"))))
    (build-system r-build-system)
    (native-inputs (list r-testthat))
    (home-page "https://github.com/gaborcsardi/pkgconfig")
    (synopsis "Private configuration for R packages")
    (description "This package provides the functionality to set configuration
options on a per-package basis.  Options set by a given package only apply to
that package, other packages are unaffected.")
    (license license:expat)))

(define-public r-pkgmaker
  (package
    (name "r-pkgmaker")
    (version "0.32.10")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "pkgmaker" version))
       (sha256
        (base32
         "0cr95vmsb4gkl917wg4wwq8jihvwasdg18qzhk2cq224lrrh8awp"))))
    (build-system r-build-system)
    (propagated-inputs
     (list r-assertthat
           r-codetools
           r-digest
           r-registry
           r-stringr
           r-withr
           r-xtable))
    (native-inputs (list r-testthat))
    (home-page "https://renozao.github.io/pkgmaker")
    (synopsis "Package development utilities")
    (description
     "This package provides some low-level utilities to use for R package
development.  It currently provides managers for multiple package specific
options and registries, vignette, unit test and bibtex related utilities.")
    (license license:gpl2+)))

(define-public r-plotly
  (package
    (name "r-plotly")
    (version "4.10.4")
    (source (origin
              (method url-fetch)
              (uri (cran-uri "plotly" version))
              (sha256
               (base32
                "0ryqcs9y7zan36zs6n1hxxy91pajldpax8q7cwcimlsmxnvrbafg"))
              (modules '((guix build utils)))
              (snippet
               '(with-directory-excursion "inst/htmlwidgets/lib/"
                  (for-each delete-file
                            '("plotlyjs/plotly-latest.min.js"
                              "colourpicker/colourpicker.min.js"
                              "typedarray/typedarray.min.js"
                              "selectize/selectize.min.js"))))))
    (build-system r-build-system)
    (arguments
     (list
      ;; Tests require internet access.
      #:tests? #false
      #:modules '((guix build utils)
                  (guix build r-build-system)
                  (srfi srfi-1))
      #:phases
      '(modify-phases %standard-phases
         (add-after 'unpack 'process-javascript
           (lambda* (#:key inputs #:allow-other-keys)
             (with-directory-excursion "inst/htmlwidgets/lib/"
               (symlink (string-append (assoc-ref inputs "js-selectize")
                                       "/share/javascript/selectize.min.js")
                        "selectize/selectize.min.js")
               (call-with-values
                   (lambda ()
                     (unzip2
                      `((,(assoc-ref inputs "js-plotly")
                         "plotlyjs/plotly-latest.min.js")
                        (,(string-append (assoc-ref inputs "js-colourpicker")
                                         "/js/colourpicker.js")
                         "colourpicker/colourpicker.min.js")
                        (,(string-append (assoc-ref inputs "js-typedarray")
                                         "/typedarray.js")
                         "typedarray/typedarray.min.js"))))
                 (lambda (sources targets)
                   (for-each (lambda (source target)
                               (format #t "Processing ~a --> ~a~%"
                                       source target)
                               (invoke "esbuild" source "--minify"
                                       (string-append "--outfile=" target)))
                             sources targets)))))))))
    (propagated-inputs
     (list r-base64enc
           r-crosstalk
           r-data-table
           r-digest
           r-dplyr
           r-ggplot2
           r-htmltools
           r-htmlwidgets
           r-httr
           r-jsonlite
           r-lazyeval
           r-magrittr
           r-promises
           r-purrr
           r-rcolorbrewer
           r-rlang
           r-scales
           r-tibble
           r-tidyr
           r-vctrs
           r-viridislite))
    (native-inputs
     `(("esbuild" ,esbuild)
       ("js-colourpicker"
        ,(let ((commit "27c2a266d51e18a9fe6d7542264152b27c7d34e0")
               (version "1.1")
               (revision "0"))
           (origin
             (method git-fetch)
             (uri (git-reference
                   (url "https://github.com/daattali/jquery-colourpicker")
                   (commit commit)))
             (file-name (git-file-name "jquery-colourpicker"
                                       (git-version version revision commit)))
             (sha256
              (base32
               "0lg8amh8xh6p246j38rqghrljd7v5z34i169ra6403z8ga33wiqb")))))
       ("js-plotly"
        ,(let ((version "2.11.1"))
           (origin
             (method url-fetch)
             (uri (string-append "https://raw.githubusercontent.com/plotly/plotly.js/v"
                                 version "/dist/plotly.js"))
             (sha256
              (base32
               "1mxd8s4v3i885w5i02cyzqsrvqfr9w0svdclvqxbd05dly4bdkbj")))))
       ("js-selectize" ,js-selectize)
       ;; This is not quite the same as the bundled minified script from 2016,
       ;; but it seems to be the original with fixes from late 2017.
       ("js-typedarray"
        ,(let ((commit "9f7d4168657e2c164d647a6959f402f2c33eb5b4")
               (version "0")
               (revision "0"))
           (origin
             (method git-fetch)
             (uri (git-reference
                   (url "https://github.com/inexorabletash/polyfill/")
                   (commit commit)))
             (file-name (git-file-name "typedarray-polyfill"
                                       (git-version version revision commit)))
             (sha256
              (base32
               "0f9np4mmyhny03n3xpwzs07rld30lnfqsnh97x1v7xm0qy0zjanf")))))))
    (home-page "https://plot.ly/r")
    (synopsis "Create interactive web graphics")
    (description
     "This package enables the translation of ggplot2 graphs to an interactive
web-based version and/or the creation of custom web-based visualizations
directly from R.  Once uploaded to a plotly account, plotly graphs (and the
data behind them) can be viewed and modified in a web browser.")
    (license license:x11)))

(define-public r-plotrix
  (package
    (name "r-plotrix")
    (version "3.8-4")
    (source (origin
              (method url-fetch)
              (uri (cran-uri "plotrix" version))
              (sha256
               (base32
                "1mp8mb79prgf5fzlaix4fvslr4q67hrzxqdv3kr7mik1mf9jv8p6"))))
    (build-system r-build-system)
    (home-page "https://cran.r-project.org/web/packages/plotrix")
    (synopsis "Various plotting functions")
    (description
     "This package provides lots of plotting, various labeling, axis and color
scaling functions for R.")
    (license license:gpl2+)))

(define-public r-plyr
  (package
    (name "r-plyr")
    (version "1.8.9")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "plyr" version))
       (sha256
        (base32 "00z1mvqisnzbbwcwax1gm9ilahpgp21kk4l7hqdz8fym27vygd8m"))))
    (build-system r-build-system)
    (properties
     '((updater-extra-native-inputs . ("r-abind"))))
    (propagated-inputs (list r-rcpp))
    (native-inputs (list r-abind r-testthat))
    (home-page "http://had.co.nz/plyr")
    (synopsis "Tools for splitting, applying and combining data")
    (description
     "Plyr is a set of tools that solves a common set of problems: you need to
break a big problem down into manageable pieces, operate on each piece and
then put all the pieces back together.  For example, you might want to fit a
model to each spatial location or time point in your study, summarise data by
panels or collapse high-dimensional arrays to simpler summary statistics.")
    (license license:expat)))

(define-public r-pma
  (package
    (name "r-pma")
    (version "1.2-4")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "PMA" version))
       (sha256
        (base32 "0mq0mchvl4zlj1sgnq7z5ccm0f4lhxajqvk9w265axs0s49g76ry"))))
    (properties `((upstream-name . "PMA")))
    (build-system r-build-system)
    (home-page "https://github.com/bnaras/PMA")
    (synopsis "Penalized multivariate analysis")
    (description
     "This package performs penalized multivariate analysis: a penalized
matrix decomposition, sparse principal components analysis, and sparse
canonical correlation analysis.")
    (license license:gpl2+)))

(define-public r-pmml
  (package
    (name "r-pmml")
    (version "2.5.2")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "pmml" version))
       (sha256
        (base32 "1faad5yqyh6dx40056w74vlyw4wxjgh41jv8b2vf2gh26laf22kk"))))
    (properties `((upstream-name . "pmml")))
    (build-system r-build-system)
    (propagated-inputs (list r-stringr r-xml))
    (native-inputs (list r-knitr r-testthat))
    (home-page "https://open-source.softwareag.com/r-pmml/")
    (synopsis "Generate PMML for various models")
    (description
     "The Predictive Model Markup Language (PMML) is an XML-based language
which provides a way for applications to define machine learning, statistical
and data mining models and to share models between PMML compliant
applications.  More information about the PMML industry standard and the Data
Mining Group can be found at @url{http://dmg.org/}.  The generated PMML can be
imported into any PMML consuming application, such as Zementis Predictive
Analytics products.")
    (license license:gpl3)))

(define-public r-prabclus
  (package
    (name "r-prabclus")
    (version "2.3-4")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "prabclus" version))
       (sha256
        (base32
         "0wmcw0iz0a4q0x83v36ldv8b67czcpw3g18v68i3v9284rbj6xnd"))))
    (build-system r-build-system)
    (propagated-inputs
     (list r-mass r-mclust))
    (native-inputs (list r-spatialreg r-spdep))
    (home-page "https://cran.r-project.org/web/packages/prabclus")
    (synopsis "Parametric bootstrap tests for spatial neighborhood clustering")
    (description
     "This package provides distance-based parametric bootstrap tests for
clustering with spatial neighborhood information.  It implements some distance
measures, clustering of presence-absence, abundance and multilocus genetical
data for species delimitation, nearest neighbor based noise detection.")
    (license license:gpl2+)))

(define-public r-praise
  (package
    (name "r-praise")
    (version "1.0.0")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "praise" version))
       (sha256
        (base32
         "1gfyypnvmih97p2r0php9qa39grzqpsdbq5g0fdsbpq5zms5w0sw"))))
    (properties
     ;; We can't have r-testthat among the inputs here to avoid a dependency
     ;; cycle.
     '((updater-ignored-native-inputs . ("r-testthat"))))
    (build-system r-build-system)
    ;; Tests require r-testthat, which depends on r-praise.
    (arguments (list #:tests? #false))
    (home-page "https://github.com/gaborcsardi/praise")
    (synopsis "Functions to praise users")
    (description
     "This package provides template functions to assist in building friendly
R packages that praise their users.")
    (license license:expat)))

(define-public r-propcis
  (package
    (name "r-propcis")
    (version "0.3-0")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "PropCIs" version))
       (sha256
        (base32 "1ywzi88igzaj2wnbrqa08cy7pw886z2m0x3j7rk45rin9mgpfdfd"))))
    (properties `((upstream-name . "PropCIs")))
    (build-system r-build-system)
    (home-page "https://github.com/shearer/PropCIs")
    (synopsis "Various confidence interval methods for proportions")
    (description
     "This package computes two-sample confidence intervals for single, paired
and independent proportions.")
    (license (list license:gpl2+ license:gpl3+))))

(define-public r-proto
  (package
    (name "r-proto")
    (version "1.0.0")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "proto" version))
       (sha256
        (base32 "1l843p8vckjckdhgv37ngv47fga5jzy0n00pmipvp05nnaixk54j"))))
    (build-system r-build-system)
    (native-inputs (list r-testthat))
    (home-page "https://github.com/hadley/proto")
    (synopsis "Prototype object-based programming")
    (description
     "Proto is an object oriented system using object-based, also called
prototype-based, rather than class-based object oriented ideas.")
    (license license:gpl2+)))

(define-public r-pryr
  (package
    (name "r-pryr")
    (version "0.1.6")
    (source (origin
              (method url-fetch)
              (uri (cran-uri "pryr" version))
              (sha256
               (base32
                "013p2xxd51kr9ddx051cvn45mzgj44fm47nkchdb13l0885a7hb8"))))
    (build-system r-build-system)
    (propagated-inputs
     (list r-codetools r-lobstr r-rcpp r-stringr))
    (native-inputs (list r-testthat))
    (home-page "https://github.com/hadley/pryr")
    (synopsis "Tools for computing on the R language")
    (description
     "This package provides useful tools to pry back the covers of R and
understand the language at a deeper level.")
    (license license:gpl2)))

(define-public r-puniform
  (package
    (name "r-puniform")
    (version "0.2.7")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "puniform" version))
       (sha256
        (base32
         "15q5wlcps7387rjz7p1f5kifg1fl5yxxy7gjx6fvspvqwjkjbs4z"))))
    (properties `((upstream-name . "puniform")))
    (build-system r-build-system)
    (propagated-inputs
     (list r-adgoftest r-metafor r-numderiv r-rcpp r-rcpparmadillo))
    (home-page
     "https://github.com/RobbievanAert/puniform")
    (synopsis
     "Meta-Analysis Methods Correcting for Publication Bias")
    (description
     "This package provides meta-analysis methods that correct for publication
bias and outcome reporting bias.  Four methods and a visual tool are currently
included in the package.

@enumerate
@item The p-uniform method as described in van Assen, van Aert, and Wicherts
(2015) @url{doi:10.1037/met0000025} can be used for estimating the average
effect size, testing the null hypothesis of no effect, and testing for
publication bias using only the statistically significant effect sizes of
primary studies.

@item The p-uniform* method as described in van Aert and van Assen (2019)
@url{doi:10.31222/osf.io/zqjr9}.  This method is an extension of the p-uniform
method that allows for estimation of the average effect size and the
between-study variance in a meta-analysis, and uses both the statistically
significant and nonsignificant effect sizes.

@item The hybrid method as described in van Aert and van Assen (2017)
@url{doi:10.3758/s13428-017-0967-6}.  The hybrid method is a meta-analysis
method for combining an original study and replication and while taking into
account statistical significance of the original study.  The p-uniform and
hybrid method are based on the statistical theory that the distribution of
p-values is uniform conditional on the population effect size.

@item The fourth method in the package is the Snapshot Bayesian Hybrid
Meta-Analysis Method as described in van Aert and van Assen (2018)
@url{doi:10.1371/journal.pone.0175302}.  This method computes posterior
probabilities for four true effect sizes (no, small, medium, and large) based
on an original study and replication while taking into account publication
bias in the original study.  The method can also be used for computing the
required sample size of the replication akin to power analysis in null
hypothesis significance testing.  @end enumerate

The meta-plot is a visual tool for meta-analysis that provides information on
the primary studies in the meta-analysis, the results of the meta-analysis,
and characteristics of the research on the effect under study (van Assen and
others, 2020).

Helper functions to apply the Correcting for Outcome Reporting Bias (CORB)
method to correct for outcome reporting bias in a meta-analysis (van Aert &
Wicherts, 2020).")
    (license license:gpl2+)))

(define-public r-purrr
  (package
    (name "r-purrr")
    (version "1.0.4")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "purrr" version))
       (sha256
        (base32
         "0m4fkd047z0p7pd0vp819h6x6n7rmrmi53kvdbjslp8wclj3f0bc"))))
    (build-system r-build-system)
    (propagated-inputs
     (list r-cli r-lifecycle r-magrittr r-rlang r-vctrs))
    (native-inputs
     (list r-knitr r-lubridate r-testthat r-tibble r-tidyselect))
    (home-page "https://github.com/hadley/purrr")
    (synopsis "Functional programming tools")
    (description
     "This package completes R's functional programming tools with missing
features present in other programming languages.")
    (license license:gpl3+)))

(define-public r-rcolorbrewer
  (package
    (name "r-rcolorbrewer")
    (version "1.1-3")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "RColorBrewer" version))
       (sha256
        (base32 "1h0s0f4vvlk40cagp3qwhd0layzkjcnqkiwjyhwqns257i1gahjg"))))
    (build-system r-build-system)
    (home-page "https://cran.r-project.org/web/packages/RColorBrewer")
    (synopsis "ColorBrewer palettes")
    (description
     "This package provides color schemes for maps (and other graphics)
designed by Cynthia Brewer as described at http://colorbrewer2.org")
    ;; Includes code licensed under bsd-4
    (license license:asl2.0)))

(define-public r-reshape2
  (package
    (name "r-reshape2")
    (version "1.4.4")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "reshape2" version))
       (sha256
        (base32 "1n0jrajpvc8hjkh9z4g8bwq63qy5vy5cgl2pzjardyih4ngcz3fq"))))
    (build-system r-build-system)
    (propagated-inputs
     (list r-plyr r-rcpp r-stringr))
    (native-inputs (list r-testthat))
    (home-page "https://github.com/hadley/reshape")
    (synopsis "Flexibly reshape data: a reboot of the \"reshape\" package")
    (description
     "Reshape2 is an R library to flexibly restructure and aggregate data
using just two functions: melt and dcast (or acast).")
    (license license:expat)))

(define-public r-robslopes
  (package
    (name "r-robslopes")
    (version "1.1.3")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "robslopes" version))
       (sha256
        (base32 "0hhdpp03ybf71x6wz766glqlq4ywc4v65mj0ca3idv69p488mvb5"))))
    (properties `((upstream-name . "robslopes")))
    (build-system r-build-system)
    (propagated-inputs (list r-rcpp r-rcpparmadillo))
    (home-page "https://cran.r-project.org/package=robslopes")
    (synopsis "Fast algorithms for robust slopes")
    (description
     "This package provides fast algorithms for the Theil-Sen estimator,
Siegel's repeated median slope estimator, and Passing-Bablok regression.  The
implementation is based on algorithms by Dillencourt et al. (1992)
<doi:10.1142/S0218195992000020> and Matousek et al. (1998)
<doi:10.1007/PL00009190>.  The implementations are detailed in
Raymaekers (2023) <doi:10.32614/RJ-2023-012> and Raymaekers J., Dufey
F. (2022) <@code{arXiv:2202.08060>}.  All algorithms run in quasilinear
time.")
    (license license:gpl2+)))

(define-public r-robustrankaggreg
  (package
    (name "r-robustrankaggreg")
    (version "1.2.1")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "RobustRankAggreg" version))
       (sha256
        (base32 "0p2nbgxv2132gcyx7zq2gzl6ipsxndx64i7y8v9nh5awcdy8v44p"))))
    (properties `((upstream-name . "RobustRankAggreg")))
    (build-system r-build-system)
    (home-page "https://cran.r-project.org/package=RobustRankAggreg")
    (synopsis "Methods for robust rank aggregation")
    (description
     "This tool provides methods for aggregating ranked lists, especially
lists of genes.  It implements the Robust Rank Aggregation and other simple
algorithms for the task.  RRA method uses a probabilistic model for
aggregation that is robust to noise and also facilitates the calculation of
significance probabilities for all the elements in the final ranking.")
    (license license:gpl2)))

(define-public r-rose
  (package
    (name "r-rose")
    (version "0.0-4")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "ROSE" version))
       (sha256
        (base32 "0y3v9zkgaxpv4f4zn22ra1gkkqg5hdz8js47ppciqahfydjbfl3p"))))
    (properties `((upstream-name . "ROSE")))
    (build-system r-build-system)
    (home-page "https://cran.r-project.org/package=ROSE")
    (synopsis "Random over-sampling examples")
    (description
     "This package provides functions to deal with binary classification
problems in the presence of imbalanced classes.  Synthetic balanced samples
are generated according to ROSE (Menardi and Torelli, 2013).  Functions that
implement more traditional remedies to the class imbalance are also provided,
as well as different metrics to evaluate a learner accuracy.  These are
estimated by holdout, bootstrap or cross-validation methods.")
    (license license:gpl2)))

(define-public r-rotor
  (package
    (name "r-rotor")
    (version "0.3.7")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "rotor" version))
       (sha256
        (base32 "02mzcwd94hykysz3cv0q3dlhbbd4k3rm1di7dcw6m4masgzy05zb"))))
    (properties
     `((upstream-name . "rotor")
       (updater-extra-native-inputs . ("r-data-table"))))
    (build-system r-build-system)
    (propagated-inputs (list r-dint r-r6))
    (native-inputs (list r-data-table r-testthat))
    (home-page "https://s-fleck.github.io/rotor/")
    (synopsis "Log rotation and conditional backups")
    (description
     "This package provides tools to conditionally rotate or back-up files
based on their size or the date of the last backup; inspired by the utility
@code{logrotate}'.")
    (license license:expat)))

(define-public r-rpart
  (package
    (name "r-rpart")
    (version "4.1.24")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "rpart" version))
       (sha256
        (base32
         "0a9gwwbq2ksx2v7kgrbn0liakkjbfvky1ahkjclpv1frcjknkcaa"))))
    (build-system r-build-system)
    (native-inputs (list r-survival))
    (home-page "https://cran.r-project.org/web/packages/rpart")
    (synopsis "Recursive partitioning and regression trees")
    (description
     "This package provides recursive partitioning functions for
classification, regression and survival trees.")
    (license (list license:gpl2+ license:gpl3+))))

(define-public r-rpresto
  (package
    (name "r-rpresto")
    (version "1.4.7")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "RPresto" version))
       (sha256
        (base32 "0r4ajzd3ciicvsydacvm8gywhcr64mh1g5p2hjl1lrxzj09x4ckw"))))
    (properties
     '((upstream-name . "RPresto")
       (updater-extra-native-inputs . ("tzdata-for-tests"))))
    (build-system r-build-system)
    (arguments
     (list
      #:phases
      '(modify-phases %standard-phases
         ;; We need this for failing tests, because lubridate needs these
         ;; variables.
         (add-before 'check 'set-timezone
           (lambda* (#:key inputs #:allow-other-keys)
             (setenv "TZ" "UTC")
             (setenv "TZDIR"
                     (search-input-directory inputs
                                             "share/zoneinfo")))))))
    (propagated-inputs
     (list r-bit64
           r-dbi
           r-dbplyr
           r-dplyr
           r-httr
           r-jsonlite
           r-lifecycle
           r-lubridate
           r-openssl
           r-progress
           r-purrr
           r-rlang
           r-stringi
           r-tibble
           r-vctrs))
    (native-inputs (list r-hms r-knitr r-testthat r-withr tzdata-for-tests))
    (home-page "https://github.com/prestodb/RPresto")
    (synopsis "DBI connector to Presto")
    (description
     "This package implements a DBI compliant interface to
@url{https://prestodb.io/, Presto}, a distributed SQL query engine for running
interactive analytic queries against data sources of all sizes ranging from
gigabytes to petabytes.")
    (license license:bsd-3)))

(define-public r-rpushbullet
  (package
    (name "r-rpushbullet")
    (version "0.3.4")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "RPushbullet" version))
       (sha256
        (base32 "1mx433hvx660a63s5dzn655zmqv1c1qij0hzddl9z38032brc4ii"))))
    (properties `((upstream-name . "RPushbullet")))
    (build-system r-build-system)
    (propagated-inputs (list r-curl r-jsonlite))
    (home-page "https://cran.r-project.org/package=RPushbullet")
    (synopsis "R interface to the Pushbullet messaging service")
    (description
     "An R interface to the Pushbullet messaging service which provides fast
and efficient notifications (and file transfer) between computers, phones and
tablets.")
    (license license:gpl2+)))

(define-public r-runner
  (package
    (name "r-runner")
    (version "0.4.4")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "runner" version))
       (sha256
        (base32 "0vhqjnwcx3z3i74p26divx6palx1rwvk4jpqn64jrqlzaw9qich4"))))
    (properties `((upstream-name . "runner")))
    (build-system r-build-system)
    (propagated-inputs (list r-rcpp))
    (native-inputs (list r-knitr))
    (home-page "https://cran.r-project.org/package=runner")
    (synopsis "Running operations for vectors")
    (description
     "This package provides a library for rolling windows operations.
The package enables full control over the window length, window lag, and time
indices.  With a runner one can apply any R function on rolling windows.  The
package eases work with equally and unequally spaced time series.")
    (license license:gpl2+)))

(define-public r-rush
  (package
    (name "r-rush")
    (version "0.2.0")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "rush" version))
       (sha256
        (base32 "115k13k6qj8pq0h58y7qcknfw53x0qv4z0nrs446knc90rcwjscx"))))
    (properties `((upstream-name . "rush")))
    (build-system r-build-system)
    (propagated-inputs (list r-checkmate
                             r-data-table
                             r-ids
                             r-jsonlite
                             r-lgr
                             r-mirai
                             r-mlr3misc
                             r-processx
                             r-r6
                             r-redux
                             r-uuid))
    (native-inputs (list r-testthat))
    (home-page "https://github.com/mlr-org/rush")
    (synopsis "Rapid parallel and distributed computing")
    (description
     "This is a package for parallel computing with a network of local and
remote workers.  It enables fast exchange of results between the workers
through a Redis database.  Key features include task queues, local caching,
and sophisticated error handling.")
    (license license:expat)))

(define-public r-prettydoc
  (package
    (name "r-prettydoc")
    (version "0.4.1")
    (source (origin
              (method url-fetch)
              (uri (cran-uri "prettydoc" version))
              (sha256
               (base32
                "0aa89jnqhz0l69inrgm1f1riq5bm3ksb8wjl8d4x2f320adsd50h"))
              (snippet
               '(for-each delete-file
                          '("inst/resources/js/auto-render.min.js"
                            "inst/resources/js/katex.min.js")))))
    (properties `((upstream-name . "prettydoc")))
    (build-system r-build-system)
    (arguments
     `(#:modules ((guix build utils)
                  (guix build r-build-system)
                  (srfi srfi-1))
       #:phases
       (modify-phases %standard-phases
         (add-after 'unpack 'process-javascript
           (lambda* (#:key inputs #:allow-other-keys)
             (with-directory-excursion "inst/resources/js/"
               (call-with-values
                   (lambda ()
                     (unzip2
                      `((,(search-input-file inputs "dist/katex.js")
                         "katex.min.js")
                        (,(search-input-file inputs "dist/contrib/auto-render.js")
                         "auto-render.min.js"))))
                 (lambda (sources targets)
                   (for-each (lambda (source target)
                               (format #true "Processing ~a --> ~a~%"
                                       source target)
                               (invoke "esbuild" source "--minify"
                                       (string-append "--outfile=" target)))
                             sources targets)))))))))
    (inputs (list pandoc))
    (propagated-inputs (list r-rmarkdown))
    (native-inputs
     (list esbuild
           r-knitr
           r-rmarkdown
           (let ((version "0.12.0"))
             (origin
               (method git-fetch)
               (uri (git-reference
                     (url "https://github.com/KaTeX/KaTeX")
                     (commit (string-append "v" version))))
               (file-name (git-file-name "js-katex" version))
               (sha256
                (base32
                 "0pdfw28affnfpqpnf244acf5rkxdy2gk63669myy7ysg4z0i1n8j"))))))
    (home-page "https://github.com/yixuan/prettydoc")
    (synopsis "Create pretty documents from R markdown")
    (description
     "This is a package for creating tiny yet beautiful documents and
vignettes from R Markdown.  The package provides the @code{html_pretty} output
format as an alternative to the @code{html_document} and @code{html_vignette}
engines that convert R Markdown into HTML pages.  Various themes and syntax
highlight styles are supported.")
    (license license:asl2.0)))

(define-public r-profmem
  (package
    (name "r-profmem")
    (version "0.7.0")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "profmem" version))
       (sha256
        (base32 "1jy3d7sxmy4nqlrcrqqahgiy0lf0cb7pmh2iknf92y2b7zqwbvqn"))))
    (properties `((upstream-name . "profmem")))
    (build-system r-build-system)
    (arguments
     (list
      #:phases
      '(modify-phases %standard-phases
         (add-before 'install 'set-HOME
           (lambda _
             ;; Needed for building vignettes
             (setenv "HOME" "/tmp"))))))
    (native-inputs
     (list r-r-rsp)) ;for vignettes
    (home-page "https://github.com/HenrikBengtsson/profmem")
    (synopsis "Simple memory profiling for R")
    (description
     "This package provides a simple and light-weight API for memory profiling
of R expressions.  The profiling is built on top of R's built-in memory
profiler @code{utils::Rprofmem()}, which records every memory allocation done
by R (also native code).")
    (license license:lgpl2.1+)))

(define-public r-proj4
  (package
    (name "r-proj4")
    (version "1.0-15")
    (source (origin
              (method url-fetch)
              (uri (cran-uri "proj4" version))
              (sha256
               (base32
                "056ki0z22wqsp5d89ihrsb3xf2h1jiabgy420vc51qcikl27vk7f"))))
    (properties
     '((upstream-name . "proj4")
       (updater-extra-inputs . ("proj"))
       (updater-ignored-inputs . ("curl" "openssh" "openssl"))))
    (build-system r-build-system)
    (inputs (list proj zlib))
    (native-inputs (list pkg-config))
    (home-page "https://www.rforge.net/proj4/")
    (synopsis "Simple interface to the PROJ.4 cartographic projections library")
    (description
     "This package provides a simple interface to lat/long projection and
datum transformation of the PROJ.4 cartographic projections library.  It
allows transformation of geographic coordinates from one projection and/or
datum to another.")
    (license license:gpl2)))

(define-public r-rocit
  (package
    (name "r-rocit")
    (version "2.1.2")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "ROCit" version))
       (sha256
        (base32 "17s7wi248vj6wbcxb6z0fdsw8bijjxva4sldlqcz4m73ccnrdikf"))))
    (properties `((upstream-name . "ROCit")))
    (build-system r-build-system)
    (native-inputs (list r-knitr r-testthat))
    (home-page "https://cran.r-project.org/package=ROCit")
    (synopsis "Performance Assessment of Binary Classifier with Visualization")
    (description
     "Sensitivity (or recall or true positive rate), false positive rate,
specificity, precision (or positive predictive value), negative predictive
value, misclassification rate, accuracy, F-score---these are popular metrics
for assessing performance of binary classifiers for certain thresholds.  These
metrics are calculated at certain threshold values.  @dfn{Receiver operating
characteristic} (ROC) curve is a common tool for assessing overall diagnostic
ability of the binary classifier.  Unlike depending on a certain threshold,
area under ROC curve (also known as AUC), is a summary statistic about how
well a binary classifier performs overall for the classification task.  The
ROCit package provides flexibility to easily evaluate threshold-bound
metrics.")
    (license license:gpl3)))

(define-public r-roi-plugin-lpsolve
  (package
    (name "r-roi-plugin-lpsolve")
    (version "1.0-2")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "ROI.plugin.lpsolve" version))
       (sha256
        (base32 "0xgg1fzq5sba3yvvrci3iw97p31walpnhv4zwnd39gw8v5z6f9dj"))))
    (properties `((upstream-name . "ROI.plugin.lpsolve")))
    (build-system r-build-system)
    (propagated-inputs (list r-lpsolveapi r-roi))
    (home-page "https://roigrp.gitlab.io")
    (synopsis "Plugin of lp_solve for the R optimization infrastructure")
    (description
     "This package enhances the @acronym{ROI, R Optimization Infrastructure} with
the lp_solve solver.")
    (license license:gpl3)))

(define-public r-rorcid
  (package
    (name "r-rorcid")
    (version "0.7.0")
    (source (origin
              (method url-fetch)
              (uri (cran-uri "rorcid" version))
              (sha256
               (base32
                "1d0s5w48ksyj152nc4xq5w0nsimab8jc5fgspdwnbas2g8a52igr"))))
    (properties `((upstream-name . "rorcid")))
    (build-system r-build-system)
    (propagated-inputs (list r-crul
                             r-data-table
                             r-fauxpas
                             r-httr
                             r-jsonlite
                             r-tibble
                             r-xml2))
    (native-inputs (list r-testthat r-vcr))
    (home-page "https://github.com/ropensci/rorcid")
    (synopsis "Interface to the @url{Orcid.org, https://orcid.org} API")
    (description
     "This package provides an API for @url{Orcid.org, https://orcid.org}.
Functions include searching for people, searching by DOI, or searching by
Orcid ID.")
    (license license:expat)))

(define-public r-rrna
  (package
    (name "r-rrna")
    (version "1.2")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "RRNA" version))
       (sha256
        (base32 "05ijsnxxylfan4c4hnl20655qjzix2l43i5qmdzm19wqcf4ipylp"))))
    (properties `((upstream-name . "RRNA")))
    (build-system r-build-system)
    (home-page "https://cran.r-project.org/package=RRNA")
    (synopsis "Secondary structure plotting for RNA")
    (description "This package facilitates RNA secondary structure plotting.")
    (license license:gpl3)))

(define-public r-ruv
  (package
    (name "r-ruv")
    (version "0.9.7.1")
    (source (origin
              (method url-fetch)
              (uri (cran-uri "ruv" version))
              (sha256
               (base32
                "1n4q9mrp9f644spbns6bbnzmlabrg90hwkdfg3hnm3rxp9b4xid0"))))
    (properties `((upstream-name . "ruv")))
    (build-system r-build-system)
    (propagated-inputs (list r-ggplot2 r-gridextra r-scales))
    (home-page "https://cran.r-project.org/web/packages/ruv/index.html")
    (synopsis "Detect and remove unwanted variation using negative controls")
    (description
     "This package implements the RUV (Remove Unwanted Variation) algorithms.
These algorithms attempt to adjust for systematic errors of unknown origin in
high-dimensional data.  The algorithms were originally developed for use with
genomic data, especially microarray data, but may be useful with other types
of high-dimensional data as well.  The algorithms require the user to specify
a set of negative control variables, as described in the references.  The
algorithms included in this package are RUV-2, RUV-4, RUV-inv, RUV-rinv,
RUV-I, and RUV-III, along with various supporting algorithms.")
    ;; Any version of the GPL.
    (license (list license:gpl2+ license:gpl3+))))

(define-public r-waldo
  (package
    (name "r-waldo")
    (version "0.6.1")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "waldo" version))
       (sha256
        (base32
         "1jbn3vfykyv8czwqs6wbb8m172cl2fqgggy86n3h1rrg59rz7hy9"))))
    (properties
     ;; We can't add testthat here because of a dependency cycle.
     '((updater-ignored-native-inputs . ("r-testthat"))
       (upstream-name . "waldo")))
    (build-system r-build-system)
    ;; Tests require r-testthat, which depends on this package.
    (arguments (list #:tests? #false))
    (propagated-inputs
     (list r-cli r-diffobj r-glue r-rlang))
    (home-page "https://github.com/r-lib/waldo")
    (synopsis "Find differences between R objects")
    (description
     "Compare complex R objects and reveal the key differences.  This package
was designed particularly for use in testing packages where being able to
quickly isolate key differences makes understanding test failures much
easier.")
    (license license:expat)))

;; We use the git repository, because it contains the JavaScript source code.
;; We have to use this seemingly arbitrary commit after 0.2.5, because the
;; sources for placeholder.js were not included in the latest release.
(define-public r-waiter
  (let ((commit "927501bfa41c37e33d13a90bbc329a2887e0cec0")
        (revision "1"))
    (package
      (name "r-waiter")
      (version (git-version "0.2.5" revision commit))
      (source (origin
                (method git-fetch)
                (uri (git-reference
                      (url "https://github.com/JohnCoene/waiter")
                      (commit commit)))
                (file-name (git-file-name name version))
                (sha256
                 (base32
                  "0s5d09srd1d1s35lp2fb93dvyfkjv1rasbl25ps1p137jv7zn079"))
                (modules '((guix build utils)))
                (snippet
                 '(delete-file-recursively "inst/packer"))))
      (properties `((upstream-name . "waiter")))
      (build-system r-build-system)
      (arguments
       (list
        #:modules
        '((guix build r-build-system)
          (guix build minify-build-system)
          (guix build utils))
        #:imported-modules
        `(,@%r-build-system-modules
          (guix build minify-build-system))
        #:phases
        '(modify-phases (@ (guix build r-build-system) %standard-phases)
           (add-after 'unpack 'process-javascript
             (lambda* (#:key inputs #:allow-other-keys)
               (mkdir-p "inst/packer")
               (call-with-output-file "build.js"
                 (lambda (port)
                   (display "\
const esbuild = require('esbuild');
const path = require('path');
const fs = require('fs');

// Define the entries and output directory
const entries = {
  'waiter': './srcjs/exts/waiter/waiter.js',
  'waitress': './srcjs/exts/waitress/waitress.js',
  'hostess': './srcjs/exts/hostess/hostess.js',
  'attendant': './srcjs/exts/attendant/attendant.js',
  'placeholder': './srcjs/exts/placeholder/placeholder.js'
};

// A little plugin to inject the CSS into the generated JavaScript file.
let style = {
  name: 'style',
  setup(build) {
    const cwd = process.cwd();
    const opt = {
      logLevel: 'silent',
      bundle: true,
      write: false,
      minify: true,
      charset: 'utf8'
    };

    build.onResolve({ filter: /\\.css$/, namespace: 'file' }, args => {
      const absPath = path.join(args.resolveDir, args.path);
      const relPath = path.relative(cwd, absPath);
      const resolved = fs.existsSync(absPath) ? relPath : args.path;
      return { path: resolved, namespace: 'style-stub' };
    });

    build.onResolve({ filter: /\\.css$/, namespace: 'style-stub' }, args => {
      return { path: args.path, namespace: 'style-content' };
    });

    build.onResolve({ filter: /^__style_helper__$/, namespace: 'style-stub' }, args => ({
      path: args.path,
      namespace: 'style-helper',
      sideEffects: false,
    }));

    build.onLoad({ filter: /.*/, namespace: 'style-helper' }, async () => ({
      contents: `
        export function injectStyle(text) {
          if (typeof document !== 'undefined') {
            var style = document.createElement('style')
            var node = document.createTextNode(text)
            style.appendChild(node)
            document.head.appendChild(style)
          }
        }
      `,
    }));

    build.onLoad({ filter: /.*/, namespace: 'style-stub' }, async args => ({
      contents: `
        import { injectStyle } from \"__style_helper__\"
        import css from ${JSON.stringify(args.path)}
        injectStyle(css)
      `,
    }));

    build.onLoad({ filter: /.*/, namespace: 'style-content' }, async args => {
      const options = { entryPoints: [args.path], ...opt };
      const { errors, warnings, outputFiles } = await esbuild.build(options);
      return { errors, warnings, contents: outputFiles[0].text, loader: \"text\" };
    });
  },
};

esbuild.build({
  entryPoints: Object.values(entries),
  entryNames: '[name]',
  outdir: './inst/packer',
  bundle: true,
  minify: true,
  format: 'iife',
  globalName: 'waiter',
  external: ['shiny', 'jquery'],
  loader: {
    '.js': 'js',
  },
  plugins: [style]
})
" port)))
               (install-file (search-input-file inputs "/dist/loading-bar.js")
                             "srcjs/exts/hostess")
               (install-file (search-input-file inputs "/dist/loading-bar.css")
                             "srcjs/exts/hostess")
               (substitute* "srcjs/exts/hostess/hostess.js"
                 (("@loadingio/loading-bar/lib/") "./")
                 (("@loadingio/loading-bar/dist/") "./"))
               (setenv "ESBUILD_BINARY_PATH" (search-input-file inputs "/bin/esbuild"))
               (invoke "node" "build.js")

               ;; Almost forgot this one...
               (minify (search-input-file inputs "loadgo-nojquery.js")
                       #:target
                       "inst/assets/garcon/garcon.min.js"))))))
      (propagated-inputs (list r-htmltools r-r6 r-shiny))
      (native-inputs
       (list node-esbuild node-lts r-knitr
             (origin
               (method git-fetch)
               (uri (git-reference
                     (url "https://github.com/loadingio/loading-bar")
                     (commit "0.1.0")))
               (file-name (git-file-name "js-loading-bar" "0.1.0"))
               (sha256
                (base32
                 "12z8m362k3gldkjhx3l65zrw7ifqkz21zgv9b2hw6ai5blkd33nv")))
             (origin
               (method git-fetch)
               (uri (git-reference
                     (url "https://github.com/franverona/loadgo")
                     (commit "2.2.1")))
               (file-name (git-file-name "js-loadgo" "2.2.1"))
               (sha256
                (base32
                 "1n11lhlv5i48xm0x7hj296lv363dbx4cldg12vr07q01pvj5fbdl")))))
      (home-page "https://waiter.john-coene.com/")
      (synopsis "Loading screen for Shiny")
      (description
       "This package provides full screen and partial loading screens for
Shiny with spinners, progress bars, and notifications.")
      (license license:expat))))

(define-public r-wheatmap
  (package
    (name "r-wheatmap")
    (version "0.2.0")
    (source (origin
              (method url-fetch)
              (uri (cran-uri "wheatmap" version))
              (sha256
               (base32
                "064idlrnb85xxav39gp3n854fic6514khvazrf5d0x48crpzyvdp"))))
    (properties `((upstream-name . "wheatmap")))
    (build-system r-build-system)
    (propagated-inputs (list r-colorspace r-rcolorbrewer))
    (native-inputs (list r-knitr))
    (home-page "https://github.com/zwdzwd/wheatmap")
    (synopsis "Incrementally build complex plots using natural semantics")
    (description
     "This package lets you build complex plots, heatmaps in particular, using
natural semantics.  Bigger plots can be assembled using directives such as
@code{LeftOf}, @code{RightOf}, @code{TopOf}, and @code{Beneath} and more.
Other features include clustering, dendrograms and integration with ggplot2
generated grid objects.  This package is particularly designed for
bioinformaticians to assemble complex plots for publication.")
    (license license:gpl3)))

(define-public r-whoami
  (package
    (name "r-whoami")
    (version "1.3.0")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "whoami" version))
       (sha256
        (base32 "19fwl7z55s4kl2xzwqwh8iwg13kdrv222vyl3kibxgwrjcjwj2y2"))))
    (properties `((upstream-name . "whoami")))
    (build-system r-build-system)
    (propagated-inputs (list r-httr r-jsonlite))
    (native-inputs (list r-mockery r-testthat r-withr))
    (home-page "https://github.com/r-lib/whoami#readme")
    (synopsis
     "Username, full name, email address, GitHub username of the current user")
    (description
     "Look up the username and full name of the current user, the current
user's email address and GitHub username, using various sources of system and
configuration information.")
    (license license:expat)))

(define-public r-rtdists
  (package
    (name "r-rtdists")
    (version "0.11-5")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "rtdists" version))
       (sha256
        (base32 "1v8yhyvliw3dm3ciwxxaa9spfw05wp334l7gmvgv20mab2kjxkwp"))))
    (properties `((upstream-name . "rtdists")))
    (build-system r-build-system)
    (propagated-inputs (list r-evd r-gsl r-msm r-rcpp))
    (native-inputs (list r-devtools r-glba r-knitr r-rwiener r-testthat))
    (home-page "https://github.com/rtdists/rtdists/")
    (synopsis "Response Time Distributions")
    (description
     "This package provides response time distributions (density/PDF,
distribution function/CDF, quantile function, and random generation):

@itemize
@item Ratcliff diffusion model (Ratcliff & @code{McKoon}, 2008,
<doi:10.1162/neco.2008.12-06-420>) based on C code by Andreas and Jochen Voss
and
@item linear ballistic accumulator (LBA; Brown & Heathcote, 2008,
<doi:10.1016/j.cogpsych.2007.12.002>) with different distributions underlying
the drift rate.
@end itemize
")
    (license license:gpl3+)))

(define-public r-rticles
  (package
    (name "r-rticles")
    (version "0.27")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "rticles" version))
       (sha256
        (base32
         "1a5i8vzcf058dqk30yir3ngs02f17s4d0b0px31pxa0d1ak1yfh7"))))
    (properties `((upstream-name . "rticles")))
    (build-system r-build-system)
    (propagated-inputs
     (list r-knitr r-lifecycle r-rmarkdown r-tinytex r-xfun r-yaml))
    (native-inputs (list r-testit r-testthat r-withr))
    (home-page "https://github.com/rstudio/rticles")
    (synopsis "Article formats for R Markdown")
    (description
     "This package provides a suite of custom R Markdown formats and templates
for authoring journal articles and conference submissions.")
    (license license:gpl3)))

(define-public r-rtk
  (package
    (name "r-rtk")
    (version "0.2.6.1")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "rtk" version))
       (sha256
        (base32 "1xafmp5y5p8fnsh16wj8n08x69v2hawnsvsy7g4dcz1i5xkhyc0m"))))
    (properties `((upstream-name . "rtk")))
    (build-system r-build-system)
    (propagated-inputs (list r-rcpp zlib))
    (native-inputs (list r-testthat))
    (home-page "https://cran.r-project.org/package=rtk")
    (synopsis "Rarefaction tool kit")
    (description "This package lets you rarefy data, calculate diversity and
plot the results.")
    (license license:gpl2+)))

(define-public r-babelwhale
  (package
    (name "r-babelwhale")
    (version "1.2.0")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "babelwhale" version))
       (sha256
        (base32 "0m5q83ykz5w1fsjsk2vyrnv21cg4n075kbvfvw4k22c61p78shdl"))))
    (properties `((upstream-name . "babelwhale")))
    (build-system r-build-system)
    (propagated-inputs
     (list r-crayon
           r-digest
           r-dplyr
           r-dynutils
           r-fs
           r-glue
           r-processx
           r-purrr))
    (native-inputs (list r-testthat))
    (home-page "https://github.com/dynverse/babelwhale")
    (synopsis "Talking to Docker and Singularity containers")
    (description
     "This package provides a unified interface to interact with Docker and
Singularity containers.  You can execute a command inside a container, mount a
volume or copy a file.")
    (license license:expat)))

(define-public r-bench
  (package
    (name "r-bench")
    (version "1.1.4")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "bench" version))
       (sha256
        (base32 "10yhn778l8am8fq9gfb6n5gfd4nf6bls9k3da5mwrvldcjvza8mq"))))
    (properties `((upstream-name . "bench")))
    (build-system r-build-system)
    (propagated-inputs (list r-glue r-pillar r-profmem r-rlang r-tibble))
    (native-inputs (list r-ggplot2 r-testthat r-tidyr r-vctrs r-withr))
    (home-page "https://bench.r-lib.org/")
    (synopsis "High precision timing of R expressions")
    (description
     "This package provides tools to accurately benchmark and analyze execution
times for R expressions.")
    (license license:expat)))

(define-public r-benchmarkmedata
  (package
    (name "r-benchmarkmedata")
    (version "1.0.4")
    (source (origin
              (method url-fetch)
              (uri (cran-uri "benchmarkmeData" version))
              (sha256
               (base32
                "1n4vjkagqlm6kw2hilf4gjfcdjad0bcg652j9nl2ygbq3kdnh1vf"))))
    (build-system r-build-system)
    (propagated-inputs
     (list r-dplyr r-tibble))
    (native-inputs (list r-testthat))
    (home-page "https://github.com/csgillespie/benchmarkme-data")
    (synopsis "Data set for the @code{benchmarkme} package")
    (description "This package contains the data set for the crowd-sourced
benchmarks from running the @code{benchmarkme} package.")
    (license license:gpl2+)))

(define-public r-benchmarkme
  (package
    (name "r-benchmarkme")
    (version "1.0.8")
    (source (origin
              (method url-fetch)
              (uri (cran-uri "benchmarkme" version))
              (sha256
               (base32
                "0qaz8wy3n08k9lr8qljk5i8z8db18scbdc8m734aymd307h00w8x"))))
    (build-system r-build-system)
    (native-inputs
     (list r-knitr r-testthat))
    (propagated-inputs
     (list r-benchmarkmedata
           r-doparallel
           r-dplyr
           r-foreach
           r-httr
           r-matrix
           r-stringr
           r-tibble))
    (home-page "https://csgillespie.github.io/benchmarkme/")
    (synopsis "Crowd-sourced system benchmarks")
    (description "This package provides functionality to benchmark your CPU
and compare against other CPUs.  Also provides functions for obtaining system
specifications, such as RAM, CPU type, and R version.")
    (license license:gpl2+)))

(define-public r-bestnormalize
  (package
    (name "r-bestnormalize")
    (version "1.9.1")
    (source (origin
              (method url-fetch)
              (uri (cran-uri "bestNormalize" version))
              (sha256
               (base32
                "1lryl23jvf51n7ka58ncwhjglk0zzm18wik962h403j4mph1jjly"))))
    (properties `((upstream-name . "bestNormalize")))
    (build-system r-build-system)
    (propagated-inputs (list r-butcher
                             r-doparallel
                             r-dorng
                             r-dplyr
                             r-foreach
                             r-generics
                             r-lambertw
                             r-nortest
                             r-purrr
                             r-recipes
                             r-tibble))
    (native-inputs (list r-knitr r-testthat))
    (home-page "https://petersonr.github.io/bestNormalize/")
    (synopsis "Normalizing transformation functions")
    (description
     "Estimate a suite of normalizing transformations, including a new
adaptation of a technique based on ranks which can guarantee normally
distributed transformed data if there are no ties: @dfn{ordered quantile
normalization} (ORQ).  ORQ normalization combines a rank-mapping approach with
a shifted logit approximation that allows the transformation to work on data
outside the original domain.  It is also able to handle new data within the
original domain via linear interpolation.  The package is built to estimate
the best normalizing transformation for a vector consistently and accurately.
It implements the Box-Cox transformation, the Yeo-Johnson transformation,
three types of Lambert WxF transformations, and the ordered quantile
normalization transformation.  It estimates the normalization efficacy of
other commonly used transformations, and it allows users to specify custom
transformations or normalization statistics.  Finally, functionality can be
integrated into a machine learning workflow via recipes.")
    (license license:gpl3)))

(define-public r-bezier
  (package
    (name "r-bezier")
    (version "1.1.2")
    (source (origin
              (method url-fetch)
              (uri (cran-uri "bezier" version))
              (sha256
               (base32
                "1vw5128v8h973xwa1fdm9cw2jvrldj87nd55lddlp3qsz3ag4br6"))))
    (build-system r-build-system)
    (home-page "https://cran.r-project.org/web/packages/bezier/")
    (synopsis "Bezier curve and spline toolkit")
    (description
     "This package is a toolkit for working with Bezier curves and splines.
The package provides functions for point generation, arc length estimation,
degree elevation and curve fitting.")
    (license license:gpl2+)))

(define-public r-bife
  (package
    (name "r-bife")
    (version "0.7.2")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "bife" version))
       (sha256
        (base32 "0xikxniwzcv6jc64rgx39hddqchxk6c43h45algssbz2vaxvc4zg"))))
    (properties `((upstream-name . "bife")))
    (build-system r-build-system)
    (propagated-inputs (list r-data-table r-formula r-rcpp r-rcpparmadillo))
    (native-inputs (list r-knitr))
    (home-page "https://github.com/amrei-stammann/bife")
    (synopsis "Binary choice models with fixed effects")
    (description
     "This package lets you estimate fixed effects binary choice models (logit
and probit) with potentially many individual fixed effects and compute average
partial effects.  Incidental parameter bias can be reduced with an asymptotic
bias correction proposed by Fernandez-Val (2009)
<doi:10.1016/j.jeconom.2009.02.007>.")
    (license license:gpl2+)))

(define-public r-biglm
  (package
    (name "r-biglm")
    (version "0.9-3")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "biglm" version))
       (sha256
        (base32 "0n0dkazq74s3lml0ds9l38kzgapckjrvwyi62qb1y14cqlylhpc0"))))
    (properties `((upstream-name . "biglm")))
    (build-system r-build-system)
    (propagated-inputs (list r-dbi))
    (native-inputs (list gfortran))
    (home-page "https://cran.r-project.org/package=biglm")
    (synopsis "Bounded memory linear and generalized linear models")
    (description "The biglm package lets you create a linear model object that
uses only code{p^2} memory for @code{p} variables.  It can be updated with
more data using @code{update}. This allows linear regression on data sets
larger than memory.")
    ;; Expanded from GPL
    (license (list license:gpl2+ license:gpl3+))))

(define-public r-bipartite
  (package
    (name "r-bipartite")
    (version "2.21")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "bipartite" version))
       (sha256
        (base32 "191jr9675fjjhsrk5kvs0qngq7sg6yr8wsh78g5zk0g4qi6rbrwx"))))
    (properties `((upstream-name . "bipartite")))
    (build-system r-build-system)
    (propagated-inputs (list r-corpcor
                             r-fields
                             r-igraph
                             r-mass
                             r-permute
                             r-sna
                             r-vegan))
    (native-inputs (list r-devtools r-hmisc r-knitr))
    (home-page "https://github.com/biometry/bipartite")
    (synopsis
     "Visualising bipartite networks and calculating ecological indices")
    (description
     "This package provides functions to visualise webs and calculate a series
of indices commonly used to describe pattern in (ecological) webs.  It focuses
on webs consisting of only two levels (bipartite), e.g. pollination webs or
predator-prey-webs.  Visualisation is important to get an idea of what we are
actually looking at, while the indices summarise different aspects of the
web's topology.")
    (license (list license:gpl2+ license:gpl3+))))

(define-public r-bwstest
  (package
    (name "r-bwstest")
    (version "0.2.3")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "BWStest" version))
       (sha256
        (base32 "1chlszmshda84000jj4q5j2swflj512vfj3h97361aphzhkwri2b"))))
    (properties `((upstream-name . "BWStest")))
    (build-system r-build-system)
    (propagated-inputs (list r-memoise r-rcpp))
    (native-inputs (list r-testthat))
    (home-page "https://github.com/shabbychef/BWStest")
    (synopsis "Baumgartner Weiss Schindler Test of equal distributions")
    (description
     "This package performs the Baumgartner-Weiss-Schindler two-sample test of
equal probability distributions (doi:10.2307/2533862).  It also performs
similar rank-based tests for equal probability distributions due to Neuhauser
(doi:10.1080/10485250108832874) and Murakami
(doi:10.1080/00949655.2010.551516).")
    (license license:lgpl3)))

(define-public r-v8
  (package
    (name "r-v8")
    (version "6.0.3")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "V8" version))
       (sha256
        (base32
         "1kwwmgnn2qbr8avgmaxdp0gg4rwqzra8x5w13bhd4vfw9jh5mpvv"))))
    (properties
     `((upstream-name . "V8")
       (updater-extra-inputs . ("libnode"))))
    (build-system r-build-system)
    (arguments
     `(#:phases
       (modify-phases %standard-phases
         (add-after 'unpack 'find-v8
           (lambda* (#:key inputs #:allow-other-keys)
             (substitute* "configure"
               (("^PKG_LIBS=.*")
                (string-append "PKG_LIBS="
                               (assoc-ref inputs "libnode")
                               "/lib/libnode.so.127\n")))
             (setenv "INCLUDE_DIR"
                     (string-append
                      (assoc-ref inputs "libnode")
                      "/include/node"))
             (setenv "LIB_DIR"
                     (string-append
                      (assoc-ref inputs "libnode") "/lib")))))))
    (inputs
     (list libnode zlib))
    (propagated-inputs
     (list r-curl r-jsonlite r-rcpp))
    (native-inputs
     (list r-knitr r-testthat))
    (home-page "https://jeroen.cran.dev/V8")
    (synopsis "Embedded JavaScript and WebAssembly engine for R")
    (description
     "This package provides an R interface to V8: Google's JavaScript and
WebAssembly engine.")
    (license license:expat)))

(define-public r-vcr
  (package
    (name "r-vcr")
    (version "1.7.0")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "vcr" version))
       (sha256
        (base32 "0spz4wfglj7gd3fh1cv4bc1lf98m1ialay3vzyhzb1n2fq6812k7"))))
    (properties '((upstream-name . "vcr")))
    (build-system r-build-system)
    ;; Some tests require Internet access.
    (arguments (list #:tests? #false))
    (propagated-inputs (list r-base64enc
                             r-crul
                             r-httr
                             r-httr2
                             r-r6
                             r-rprojroot
                             r-urltools
                             r-webmockr
                             r-yaml))
    (native-inputs (list r-curl
                         r-jsonlite
                         r-knitr
                         r-testthat
                         r-webfakes
                         r-withr))
    (home-page "https://github.com/ropensci/vcr/")
    (synopsis "Record HTTP calls to disk")
    (description
     "This package lets you record test suite HTTP requests and replay them
during future runs.  It works by hooking into the @code{webmockr} R package
for matching HTTP requests by various rules, and then caching real HTTP
responses on disk in cassettes.  Subsequent HTTP requests matching any
previous requests in the same cassette use a cached HTTP response.")
    (license license:expat)))

(define-public r-venn
  (package
    (name "r-venn")
    (version "1.12")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "venn" version))
       (sha256
        (base32 "07bjv0m21gljdr3sj1z9rp6xhgxspah9j1m3a8rskvlwv6dvd1pd"))))
    (properties `((upstream-name . "venn")))
    (build-system r-build-system)
    (propagated-inputs (list r-admisc))
    (home-page "https://github.com/dusadrian/venn")
    (synopsis "Draw Venn diagrams")
    (description
     "This package provides a close to zero dependency package to draw and
display Venn diagrams up to 7 sets, and any Boolean union of set
intersections.")
    (license license:gpl3+)))

(define-public r-rvenn
  (package
    (name "r-rvenn")
    (version "1.1.0")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "RVenn" version))
       (sha256
        (base32
         "016m00xv59lkwm2is32v5nr4lw5a1ymdnz34r3ffflcv9bfrc6n4"))))
    (properties `((upstream-name . "RVenn")))
    (build-system r-build-system)
    (propagated-inputs
     (list r-ggforce
           r-ggplot2
           r-magrittr
           r-pheatmap
           r-purrr
           r-rlang
           r-vegan))
    (native-inputs (list r-knitr r-testthat))
    (home-page "https://cran.r-project.org/package=RVenn")
    (synopsis "Set operations for many sets")
    (description
     "The base functions for set operations in @code{R} can be used for only two
sets.  This package @code{RVenn} provides functions for dealing with multiple sets.
It uses @code{purr} to find the union, intersection and difference of three or
more sets.  This package also provides functions for pairwise set operations among
several sets.  Further, based on @code{ggplot2} and @code{ggforce}, a Venn diagram
can be drawn for two or three sets.  For bigger data sets, a clustered heatmap
showing the presence or absence of the elements of the sets can be drawn based on
the @code{pheatmap} package.  Finally, enrichment test can be applied to two sets
whether an overlap is statistically significant or not.")
    (license license:gpl3)))

(define-public r-dot
  (package
    (name "r-dot")
    (version "0.1")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "DOT" version))
       (sha256
        (base32
         "0qh5n57cp9c2n5yn59q4wggz82943pwfanp3kx869aba2x3sj30i"))))
    (properties `((upstream-name . "DOT")))
    (build-system r-build-system)
    (propagated-inputs
     (list r-v8))
    (home-page "http://haghish.com/dot")
    (synopsis "Render and Export DOT Graphs in R")
    (description
     "This package provides tools to render DOT diagram markup language in R
and also provides the possibility to export the graphs in PostScript and
SVG (Scalable Vector Graphics) formats.  In addition, it supports literate
programming packages such as @code{knitr} and @code{rmarkdown}.")
    (license license:expat)))

(define-public r-carrier
  (package
    (name "r-carrier")
    (version "0.1.1")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "carrier" version))
       (sha256
        (base32 "155zna5bv6ybb6hr3lsv8dn67lkbbvn3dbihfw2s6ajkzvms9x13"))))
    (properties `((upstream-name . "carrier")))
    (build-system r-build-system)
    (propagated-inputs
     (list r-lobstr r-rlang))
    (native-inputs (list r-testthat))
    (home-page "https://github.com/r-lib/carrier")
    (synopsis "Isolate functions for remote execution")
    (description
     "Sending functions to remote processes can be wasteful of resources
because they carry their environments with them.  With this package, it is
easy to create functions that are isolated from their environment.  These
isolated functions, also called crates, print to the console with their total
size and can be easily tested locally before being sent to a remote.")
    (license license:gpl3)))

(define-public r-class
  (package
    (name "r-class")
    (version "7.3-23")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "class" version))
       (sha256
        (base32
         "1wci521c81q500rwcsm8q1s307fxfx8pjvai85bg2ig0x89dn6jd"))))
    (build-system r-build-system)
    (propagated-inputs
     (list r-mass))
    (home-page "https://www.stats.ox.ac.uk/pub/MASS4/")
    (synopsis "R functions for classification")
    (description
     "This package provides various functions for classification, including
k-nearest neighbour, Learning Vector Quantization and Self-Organizing Maps.")
    ;; Either of the two versions can be picked.
    (license (list license:gpl2 license:gpl3))))

(define-public r-climaemet
  (package
    (name "r-climaemet")
    (version "1.4.1")
    (source (origin
              (method url-fetch)
              (uri (cran-uri "climaemet" version))
              (sha256
               (base32
                "0pf4xck985hin5qsvg3yyh4sqainjm47ml19fla6z08l3q1qvyx7"))))
    (properties
     '((upstream-name . "climaemet")
       (updater-ignored-native-inputs . ("r-mapspain"))))
    (build-system r-build-system)
    (propagated-inputs
     (list r-cli
           r-dplyr
           r-ggplot2
           r-httr2
           r-jsonlite
           r-rappdirs
           r-readr
           r-rlang
           r-tibble
           r-tidyr
           r-xml2))
    (native-inputs (list r-knitr r-sf r-terra r-testthat))
    (home-page "https://ropenspain.github.io/climaemet/")
    (synopsis "Climate AEMET Tools")
    (description
     "This package provides tools to download the climatic data of the Spanish
Meteorological Agency (AEMET) directly from R using their API and create
scientific graphs (climate charts, trend analysis of climate time series,
temperature and precipitation anomalies maps, warming stripes graphics,
climatograms, etc.).")
    (license license:gpl3)))

(define-public r-climatol
  (package
    (name "r-climatol")
    (version "4.2-0")
    (source (origin
              (method url-fetch)
              (uri (cran-uri "climatol" version))
              (sha256
               (base32
                "0xg433g07mzjyqj6lxy0xmzvj2pq9s3kxxjzgdghji7d1hdxiz63"))))
    (properties `((upstream-name . "climatol")))
    (build-system r-build-system)
    (home-page "http://www.climatol.eu/")
    (synopsis "Climate tools")
    (description
     "This package provides functions for the quality control, homogenization
and missing data infilling of climatological series, and to obtain
climatological summaries and grids from the results.  Also functions to draw
wind-roses and Walter&Lieth climate diagrams are included.")
    (license license:gpl2+)))

(define-public r-clipr
  (package
    (name "r-clipr")
    (version "0.8.0")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "clipr" version))
       (sha256
        (base32
         "1s9vvv3cxnz8w11gsi8z9ddv9jzib5qf5qqxnwqrrv7vj8cr7hij"))))
    (build-system r-build-system)
    (native-inputs
     (list r-knitr r-testthat))
    (home-page "https://github.com/mdlincoln/clipr")
    (synopsis "Read and write from the system clipboard")
    (description
     "This package provides simple utility functions to read from and write to
the system clipboards.")
    (license license:gpl3)))

(define-public r-clock
  (package
    (name "r-clock")
    (version "0.7.3")
    (source (origin
              (method url-fetch)
              (uri (cran-uri "clock" version))
              (sha256
               (base32
                "0vjni8ci8y5aih104rbca5dqrsdsnpxwrqahmr3ncv3qp0krx82s"))))
    (properties
     '((upstream-name . "clock")
       (updater-extra-native-inputs . ("tzdata-for-tests"))))
    (build-system r-build-system)
    (arguments
     (list
      #:phases
      '(modify-phases %standard-phases
         ;; We need this for tests.
         (add-before 'check 'set-timezone
           (lambda* (#:key inputs #:allow-other-keys)
             (setenv "TZ" "UTC")
             (setenv "TZDIR"
                     (search-input-directory inputs
                                             "share/zoneinfo")))))))
    (propagated-inputs
     (list r-cli
           r-cpp11
           r-lifecycle
           r-rlang
           r-tzdb
           r-vctrs))
    (native-inputs (list r-knitr r-slider r-testthat tzdata-for-tests))
    (home-page "https://clock.r-lib.org")
    (synopsis "Date-Time types and tools")
    (description
     "This package provides a comprehensive library for date-time
manipulations using a new family of orthogonal date-time
classes (durations, time points, zoned-times, and calendars) that
partition responsibilities so that the complexities of time zones are
only considered when they are really needed.  Capabilities include:
date-time parsing, formatting, arithmetic, extraction and updating of
components, and rounding.")
    (license license:expat)))

(define-public r-cluster
  (package
    (name "r-cluster")
    (version "2.1.8.1")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "cluster" version))
       (sha256
        (base32
         "0mqy8izwf6j5w09fphv15znh9h2kqy0b22yw5skxqzdi167bg5ab"))))
    (properties
     '((updater-extra-native-inputs . ("r-matrix"))))
    (build-system r-build-system)
    (arguments
     (list
      #:phases
      '(modify-phases %standard-phases
         (add-after 'unpack 'fix-tests
           (lambda _
             ;; Tests insist on loading Matrix not from the locations
             ;; specified with R_LIBS_SITE.
             (substitute* "inst/test-tools.R"
               ((", lib.loc = .Library") "")))))))
    (native-inputs
     (list r-matrix))
    (home-page "https://cran.r-project.org/web/packages/cluster")
    (synopsis "Methods for cluster analysis")
    (description
     "This package provides methods for cluster analysis.  It is a much
extended version of the original from Peter Rousseeuw, Anja Struyf and Mia
Hubert, based on Kaufman and Rousseeuw (1990) \"Finding Groups in Data\".")
    (license license:gpl2+)))

(define-public r-clustmixtype
  (package
    (name "r-clustmixtype")
    (version "0.4-2")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "clustMixType" version))
       (sha256
        (base32 "1clby7x9jz0jpzmzni6g8zicysnf7ccxliglxr6ljigvkf747bg1"))))
    (properties `((upstream-name . "clustMixType")))
    (build-system r-build-system)
    (propagated-inputs (list r-combinat r-dplyr r-rcolorbrewer r-rlang
                             r-tibble))
    (native-inputs (list r-testthat))
    (home-page "https://cran.r-project.org/package=clustMixType")
    (synopsis "k-prototypes clustering for mixed variable-type data")
    (description
     "This package provides functions to perform k-prototypes partitioning
clustering for mixed variable-type data according to Z.Huang (1998):
Extensions to the k-Means Algorithm for Clustering Large Data Sets with
Categorical Variables, Data Mining and Knowledge Discovery 2, 283-304.")
    (license license:gpl2+)))

(define-public r-clvalid
  (package
    (name "r-clvalid")
    (version "0.7")
    (source (origin
              (method url-fetch)
              (uri (cran-uri "clValid" version))
              (sha256
               (base32
                "18aiyjhnh5mfdxbzns4cy0r8bymfikhwkybpn4g04qhli5ls8z83"))))
    (properties `((upstream-name . "clValid")))
    (build-system r-build-system)
    (propagated-inputs (list r-class r-cluster))
    (home-page "https://cran.r-project.org/package=clValid")
    (synopsis "Validation of clustering results")
    (description
     "Statistical and biological validation of clustering results.  This
package implements Dunn Index, Silhouette, Connectivity, Stability, BHI and
BSI.  Further information can be found in Brock, G et al. (2008) <doi:
10.18637/jss.v025.i04>.")
    (license license:lgpl3)))

(define-public r-dlm
  (package
    (name "r-dlm")
    (version "1.1-6.1")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "dlm" version))
       (sha256
        (base32 "0hsz1xavzbylqb33c0qzalcqmq4g4i1c38wd351zjj88dvg73qvk"))))
    (properties `((upstream-name . "dlm")))
    (build-system r-build-system)
    (home-page "https://cran.r-project.org/package=dlm")
    (synopsis "Bayesian and Likelihood Analysis of Dynamic Linear Models")
    (description
     "This package provides routines for Maximum likelihood, Kalman filtering
and smoothing, and Bayesian analysis of Normal linear State Space models, also
known as Dynamic Linear Models.")
    (license license:gpl2+)))

(define-public r-zcompositions
  (package
    (name "r-zcompositions")
    (version "1.5.0-4")
    (source (origin
              (method url-fetch)
              (uri (cran-uri "zCompositions" version))
              (sha256
               (base32
                "1bvaw6m95hz8hd5p8h1d482b45r3w82dyj3sxlijf12s0qg8w63k"))))
    (properties `((upstream-name . "zCompositions")))
    (build-system r-build-system)
    (propagated-inputs
     (list r-mass r-nada r-truncnorm))
    (home-page "https://github.com/Japal/zCompositions")
    (synopsis
     "Treatment of zeros, left-censored and missing values in compositional data")
    (description
     "This is an R package for the imputation of left-censored data
under a compositional approach.  The implemented methods consider
aspects of relevance for a compositional approach such as scale
invariance, subcompositional coherence or preserving the multivariate
relative structure of the data.  Based on solid statistical
frameworks, it comprises the ability to deal with single and varying
censoring thresholds, consistent treatment of closed and non-closed
data, exploratory tools, multiple imputation, @dfn{Markov Chain Monte
Carlo} (MCMC), robust and non-parametric alternatives, and recent
proposals for count data.")
    (license license:gpl2+)))

(define-public r-zoo
  (package
    (name "r-zoo")
    (version "1.8-14")
    (source (origin
              (method url-fetch)
              (uri (cran-uri "zoo" version))
              (sha256
               (base32
                "15i784lcbd5m02l00bjr0c081b5zzqjgjy684nqlias2bi9vcax8"))))
    (properties
     '((updater-ignored-native-inputs . ("r-strucchange" "r-tseries"))))
    (build-system r-build-system)
    (arguments
     (list
      ;; Vignettes require r-tseries, which depends on r-zoo.
      #:test-types '(list "tests")
      #:phases
      '(modify-phases %standard-phases
         (add-after 'unpack 'delete-bad-tests
           (lambda _
             ;; These tests require r-tseries, which depends on r-zoo.
             (for-each delete-file
                       '("tests/vignette-zoo-quickref.R"
                         "tests/vignette-zoo.R")))))))
    (propagated-inputs
     (list r-lattice))
    (native-inputs (list r-chron
                         r-mondate
                         r-quantreg
                         r-timedate
                         r-timeseries
                         r-tis))
    (home-page "https://zoo.R-Forge.R-project.org/")
    (synopsis "S3 infrastructure for regular and irregular time series")
    (description "This package contains an S3 class with methods for totally
ordered indexed observations.  It is particularly aimed at irregular time
series of numeric vectors/matrices and factors.")
    (license license:gpl2+)))

(define-public r-fontawesome
  (package
    (name "r-fontawesome")
    (version "0.5.3")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "fontawesome" version))
       (sha256
        (base32 "0kzvh7xlq8lpx1l7x5gs99a3vncvbccqlqjwixjlrv6mzb80j68v"))))
    (properties `((upstream-name . "fontawesome")))
    (build-system r-build-system)
    ;; Some tests require r-dplyr; adding it to the inputs would lead to a
    ;; dependency cycle.
    (arguments (list #:tests? #false))
    (propagated-inputs
     (list r-htmltools r-rlang))
    (home-page "https://github.com/rstudio/fontawesome")
    (synopsis "Easily work with Font Awesome icons")
    (description
     "Easily and flexibly insert Font Awesome icons into R Markdown documents
and Shiny apps.  These icons can be inserted into HTML content through inline
SVG tags or @code{i} tags.  There is also a utility function for exporting
Font Awesome icons as PNG images for those situations where raster graphics
are needed.")
    (license license:expat)))

(define-public r-foreign
  (package
    (name "r-foreign")
    (version "0.8-90")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "foreign" version))
       (sha256
        (base32
         "15m1g7khwv73psrs194ip7zfc3s5qb020bbs48a902x50a07kihx"))))
    (build-system r-build-system)
    (home-page "https://cran.r-project.org/web/packages/foreign")
    (synopsis "Read data stored by other statistics software")
    (description
     "This package provides functions for reading and writing data stored by
some versions of Epi Info, Minitab, S, SAS, SPSS, Stata, Systat and Weka and
for reading and writing some dBase files.")
    (license license:gpl2+)))

(define-public r-fingerprint
  (package
    (name "r-fingerprint")
    (version "3.5.7")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "fingerprint" version))
       (sha256
        (base32 "04jcwkydjrs31pia6kq8z2n9s54im950q08hs2ay15xjxxkmb8ic"))))
    (properties `((upstream-name . "fingerprint")))
    (build-system r-build-system)
    (native-inputs (list r-runit))
    (home-page "https://cran.r-project.org/package=fingerprint")
    (synopsis "Functions to Operate on Binary Fingerprint Data")
    (description
     "This package provides functions to manipulate binary fingerprints of
arbitrary length.  A fingerprint is represented by an object of S4 class
@code{fingerprint}.  The bitwise logical functions in R are overridden so that
they can be used directly with @code{fingerprint} objects.  A number of
distance metrics are also available.  Fingerprints can be converted to
Euclidean vectors (i.e., points on the unit hypersphere) and can also be
folded.  Arbitrary fingerprint formats can be handled via line handlers.
Currently handlers are provided for CDK, MOE and BCI fingerprint data.")
    ;; Any version of the GPL
    (license (list license:gpl2+ license:gpl3+))))

(define-public r-fishmethods
  (package
    (name "r-fishmethods")
    (version "1.13-1")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "fishmethods" version))
       (sha256
        (base32 "07y58zr4m2nb9q3m3rqjxbxysf9br6ss22l4857w59mcnjfrx8c7"))))
    (properties `((upstream-name . "fishmethods")))
    (build-system r-build-system)
    (propagated-inputs (list r-boot
                             r-bootstrap
                             r-data-table
                             r-lme4
                             r-mass
                             r-numderiv
                             r-tmb))
    (home-page "https://cran.r-project.org/package=fishmethods")
    (synopsis "Fishery science methods and models")
    (description
     "This package provides functions for applying a wide range of fisheries
stock assessment methods.")
    (license license:gpl2+)))

(define-public r-fixest
  (package
    (name "r-fixest")
    (version "0.12.1")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "fixest" version))
       (sha256
        (base32 "1pqkwzcv8mjh00k0cl0na7izwhwsp6qpimbxmq5005vbhnwimrvw"))))
    (properties `((upstream-name . "fixest")))
    (build-system r-build-system)
    (propagated-inputs (list r-dreamerr
                             r-nlme
                             r-numderiv
                             r-rcpp
                             r-sandwich
                             r-stringmagic))
    (native-inputs (list r-data-table
                         r-knitr
                         r-mass))
    (home-page "https://lrberge.github.io/fixest/")
    (synopsis "Fast fixed-effects estimations")
    (description
     "This is a package for fast and user-friendly estimation of econometric
models with multiple fixed-effects.  It includes ordinary least squares (OLS),
generalized linear models (GLM) and the negative binomial.  The core of the
package is based on optimized parallel C++ code, scaling especially well for
large data sets.  The method to obtain the fixed-effects coefficients is based
on Berge (2018).  It further provides tools to export and view the results of
several estimations with intuitive design to cluster the standard-errors.")
    (license license:gpl3)))

(define-public r-fpeek
  (package
    (name "r-fpeek")
    (version "0.1.2")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "fpeek" version))
       (sha256
        (base32 "0kv46g21ndxchg3q8ynq7hjjkh6i2zlc21axn5y1jjzigrw047ii"))))
    (properties `((upstream-name . "fpeek")))
    (build-system r-build-system)
    (propagated-inputs (list r-rcpp))
    (native-inputs (list r-testthat))
    (home-page "https://github.com/davidgohel/fpeek")
    (synopsis "Check text files content at a glance")
    (description
     "This package provides tools to help working with text files.  It can
return the number of lines; print the first and last lines; convert encoding.
Operations are made without reading the entire file before starting, resulting
in good performances with large files.")
    (license license:expat)))

(define-public r-ggalluvial
  (package
   (name "r-ggalluvial")
   (version "0.12.5")
   (source (origin
            (method url-fetch)
            (uri (cran-uri "ggalluvial" version))
            (sha256
             (base32
              "0wax853pi3ghqv5alfkx9rgfb3sm3sqh3miklwvn22bh1s44q14h"))))
   (properties
    '((upstream-name . "ggalluvial")
      (updater-extra-native-inputs . ("r-alluvial"))))
   (build-system r-build-system)
   (propagated-inputs
    (list r-dplyr
          r-ggplot2
          r-lazyeval
          r-rlang
          r-tidyr
          r-tidyselect))
   (native-inputs
    (list r-alluvial r-knitr r-testthat))
   (home-page "https://corybrunson.github.io/ggalluvial/")
   (synopsis "Alluvial plots for ggplot2")
   (description "This package provides alluvial plots for @code{ggplot2}.
Alluvial plots use variable-width ribbons and stacked bar plots to represent
multi-dimensional or repeated-measures data with categorical or ordinal
variables.")
   (license license:gpl3)))

(define-public r-ggpp
  (package
    (name "r-ggpp")
    (version "0.5.8-1")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "ggpp" version))
       (sha256
        (base32
         "1jk3x679rvkj3if14cai99w5sk0nj07rhppwwd7i7a1daal0grh5"))))
    (properties
     '((upstream-name . "ggpp")
       (updater-extra-native-inputs . ("r-vdiffr"))))
    (build-system r-build-system)
    (propagated-inputs
     (list r-dplyr
           r-ggplot2
           r-glue
           r-gridextra
           r-lubridate
           r-magrittr
           r-mass
           r-polynom
           r-rlang
           r-scales
           r-stringr
           r-tibble
           r-vctrs
           r-xts
           r-zoo))
    (native-inputs
     (list r-knitr r-testthat r-vdiffr))
    (home-page "https://docs.r4photobiology.info/ggpp/")
    (synopsis "Grammar extensions to ggplot2")
    (description
     "This package contains extensions to ggplot2.

@enumerate
@item Geomas: @code{geom_table}, @code{geom_plot} and @code{geom_grob} add
  insets to plots using native data coordinates, while @code{geom_table_npc},
  @code{geom_plot_npc} and @code{geom_grob_npc} do the same using @code{npc}
  coordinates through new aesthetics @code{npcx} and @code{npcy}.
@item Statistics: select observations based on 2D density.
@item Positions: radial nudging away from a center point and nudging away from
  a line or curve.
@end enumerate
")
    (license license:gpl2+)))

(define-public r-ggprism
  (package
    (name "r-ggprism")
    (version "1.0.6")
    (source (origin
              (method url-fetch)
              (uri (cran-uri "ggprism" version))
              (sha256
               (base32
                "1jp6vxydcs1hqg2p11x3llpnrkxdky0lixsywrhyncw44y18mid3"))))
    (properties `((upstream-name . "ggprism")))
    (build-system r-build-system)
    (propagated-inputs
     (list r-digest
           r-ggplot2
           r-glue
           r-gtable
           r-rlang
           r-scales
           r-tibble))
    (native-inputs (list r-knitr r-tinytest))
    (home-page "https://csdaw.github.io/ggprism/")
    (synopsis "ggplot2 extension inspired by GraphPad Prism")
    (description
     "This package provides various themes, palettes, and other functions that are
used to customise ggplots to look like they were made in GraphPad Prism.  The
Prism-look is achieved with @code{theme_prism()} and
@code{scale_fill|colour_prism()}, axes can be changed with custom guides like
@code{guide_prism_minor()}, and significance indicators added with
@code{add_pvalue()}.")
    (license license:gpl3+)))

(define-public r-ggrastr
  (package
    (name "r-ggrastr")
    (version "1.0.2")
    (source (origin
              (method url-fetch)
              (uri (cran-uri "ggrastr" version))
              (sha256
               (base32
                "1l90mlb6bqq98ifmlbs5481vch9inmzdnvnz192adklrr9nl09yb"))))
    (properties `((upstream-name . "ggrastr")))
    (build-system r-build-system)
    (propagated-inputs (list r-cairo r-ggbeeswarm r-ggplot2 r-png r-ragg))
    (native-inputs (list r-knitr))
    (home-page "https://github.com/VPetukhov/ggrastr")
    (synopsis "Rasterize layers for ggplot2")
    (description
     "Rasterize only specific layers of a ggplot2 plot while simultaneously keeping
all labels and text in vector format.  This allows users to keep plots within
the reasonable size limit without losing vector properties of the
scale-sensitive information.")
    (license license:expat)))

(define-public r-ggvenn
  (package
    (name "r-ggvenn")
    (version "0.1.10")
    (source (origin
              (method url-fetch)
              (uri (cran-uri "ggvenn" version))
              (sha256
               (base32
                "0gl7z8hrn2wmmb59fvfv2hsw40p629aj086dv0kwlv162zqidqfd"))))
    (properties `((upstream-name . "ggvenn")))
    (build-system r-build-system)
    (propagated-inputs (list r-dplyr r-ggplot2))
    (home-page "https://cran.r-project.org/package=ggvenn")
    (synopsis "Draw Venn diagram with ggplot2")
    (description
     "This package offers an easy to use way to draw a Venn diagram with
@code{ggplot2}.")
    (license license:expat)))

(define-public r-ggvenndiagram
  (package
    (name "r-ggvenndiagram")
    (version "1.5.2")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "ggVennDiagram" version))
       (sha256
        (base32
         "0hzjbpd3f3zn169s5nvnv7b4wlrwdn3r0pk0vgkdnhchl75g0qni"))))
    (properties `((upstream-name . "ggVennDiagram")))
    (build-system r-build-system)
    (propagated-inputs
     (list r-aplot
           r-dplyr
           r-forcats
           r-ggplot2
           r-tibble
           r-venn
           r-yulab-utils))
    (native-inputs (list r-knitr r-testthat))
    (home-page "https://github.com/gaospecial/ggVennDiagram")
    (synopsis "Implementention of the Venn diagram using ggplot2")
    (description
     "This package implements easy-to-use functions to generate 2-7 sets Venn
plot in publication quality.  @code{ggVennDiagram} plot Venn using
well-defined geometry dataset and @code{ggplot2}.  The shapes of 2-4 sets Venn
use circles and ellipses, while the shapes of 4-7 sets Venn use irregular
polygons (4 has both forms), which are developed and imported from another
package @code{venn}.  We provide internal functions to integrate shape data
with user provided sets data, and calculated the geometry of every
regions/intersections of them, then separately plot Venn in three components:
set edges, set labels, and regions.  From version 1.0, it is possible to
customize these components as you demand in ordinary @code{ggplot2} grammar.")
    (license license:gpl3)))

(define-public r-labeling
  (package
    (name "r-labeling")
    (version "0.4.3")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "labeling" version))
       (sha256
        (base32 "1wk4wa1s8f17b5lf8vs5hxsmyadp2ccmyg4hamq7sdvlrk14yby6"))))
    (build-system r-build-system)
    (home-page "https://cran.r-project.org/web/packages/labeling")
    (synopsis "Axis labeling algorithms")
    (description "The labeling package provides a range of axis labeling
algorithms.")
    (license license:expat)))

(define-public r-laf
  (package
    (name "r-laf")
    (version "0.8.6")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "LaF" version))
       (sha256
        (base32 "1738v1jc3diz72dc0g0fzad6pa8fyahz1qd66izj437s0xy249q6"))))
    (properties
     '((upstream-name . "LaF")
       (updater-extra-native-inputs . ("r-yaml"))))
    (build-system r-build-system)
    (propagated-inputs (list r-rcpp))
    (native-inputs (list r-testthat r-yaml))
    (home-page "https://github.com/djvanderlaan/LaF")
    (synopsis "Fast access to large ASCII files")
    (description
     "This package provides methods for fast access to large ASCII files.
Currently the following file formats are supported: comma separated
format (CSV) and fixed width format.  It is assumed that the files are too
large to fit into memory, although the package can also be used to efficiently
access files that do fit into memory.  Methods are provided to access and
process files blockwise.  Furthermore, an opened file can be accessed as one
would an ordinary data.frame.  The @code{LaF} vignette gives an overview of
the functionality provided.")
    (license license:gpl3)))

(define-public r-lambda-r
  (package
    (name "r-lambda-r")
    (version "1.2.4")
    (source (origin
              (method url-fetch)
              (uri (cran-uri "lambda.r" version))
              (sha256
               (base32
                "1mh1g0gsd58gng0hb29vww2yqb2jfs07kba5kxnnqck5j3izwlnj"))))
    (properties `((upstream-name . "lambda.r")))
    (build-system r-build-system)
    (propagated-inputs
     (list r-formatr))
    (native-inputs (list r-testit))
    (home-page "https://cran.r-project.org/web/packages/lambda.r")
    (synopsis "Functional programming extension for R")
    (description
     "This package provides a language extension to efficiently write
functional programs in R.  Syntax extensions include multi-part function
definitions, pattern matching, guard statements, built-in (optional) type
safety.")
    (license license:lgpl3+)))

(define-public r-lars
  (package
    (name "r-lars")
    (version "1.3")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "lars" version))
       (sha256
        (base32
         "17al1g0pvfz9frs2kxicqr8dyp7ciz3x87yx2l4lqd53ls6nm7n6"))))
    (build-system r-build-system)
    (inputs
     (list gfortran))
    (home-page "https://web.stanford.edu/~hastie/Papers/LARS/")
    (synopsis "Least angle regression software")
    (description
     "Least Angle Regression (\"LAR\") is a model selection algorithm; a
useful and less greedy version of traditional forward selection methods.  A
simple modification of the LAR algorithm implements Tibshirani's Lasso; the
Lasso modification of LARS calculates the entire Lasso path of coefficients
for a given problem at the cost of a single least squares fit.  Another LARS
modification efficiently implements epsilon Forward Stagewise linear
regression.")
    (license license:gpl2)))

(define-public r-lattice
  (package
    (name "r-lattice")
    (version "0.22-7")
    (source (origin
              (method url-fetch)
              (uri (cran-uri "lattice" version))
              (sha256
               (base32
                "1xzrpy30irlzf3dy6pz5jnbd8p82xgfy5kin5bai0179jlmsc3s0"))))
    (build-system r-build-system)
    (native-inputs (list r-mass))
    (home-page "https://lattice.r-forge.r-project.org/")
    (synopsis "High-level data visualization system")
    (description
     "The lattice package provides a powerful and elegant high-level data
visualization system inspired by Trellis graphics, with an emphasis on
multivariate data.  Lattice is sufficient for typical graphics needs, and is
also flexible enough to handle most nonstandard requirements.")
    (license license:gpl2+)))

(define-public r-latticeextra
  (package
    (name "r-latticeextra")
    (version "0.6-30")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "latticeExtra" version))
       (sha256
        (base32
         "1vcy4xr6c53nbvnxikjnlf5kd3n5hf4d8dzj5d41hj322dlsfl65"))))
    (properties `((upstream-name . "latticeExtra")))
    (build-system r-build-system)
    (propagated-inputs
     (list r-interp
           r-jpeg
           r-lattice
           r-mass
           r-png
           r-rcolorbrewer))
    (home-page "https://latticeextra.r-forge.r-project.org/")
    (synopsis "Extra graphical utilities based on lattice")
    (description
     "Building on the infrastructure provided by the lattice package, this
package provides several new high-level graphics functions and methods, as
well as additional utilities such as panel and axis annotation functions.")
    (license license:gpl2+)))

(define-public r-lazyeval
  (package
    (name "r-lazyeval")
    (version "0.2.2")
    (source (origin
              (method url-fetch)
              (uri (cran-uri "lazyeval" version))
              (sha256
               (base32
                "1m10i059csrcqkcn59a8wspn784alxsq3symzhn24mhhl894346n"))))
    (build-system r-build-system)
    (native-inputs (list r-knitr r-testthat))
    (home-page "https://github.com/hadley/lazyeval")
    (synopsis "Lazy (non-standard) evaluation in R")
    (description
     "This package provides the tools necessary to do non-standard
evaluation (NSE) in R.")
    (license license:gpl3+)))

(define-public r-lbfgsb3c
  (package
    (name "r-lbfgsb3c")
    (version "2024-3.5")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "lbfgsb3c" version))
       (sha256
        (base32 "0rgikv5p05rv4r55mihlbk1953jiwd95wp2rn05xqi4ix33y3vxj"))))
    (properties `((upstream-name . "lbfgsb3c")))
    (build-system r-build-system)
    (propagated-inputs (list r-numderiv r-rcpp r-rcpparmadillo))
    (native-inputs (list gfortran r-knitr r-testthat))
    (home-page "https://nlmixr2.github.io/lbfgsb3c/")
    (synopsis "Limited memory BFGS minimizer with bounds on parameters")
    (description
     "This package lets you interface to Nocedal et al. L-BFGS-B.3.0 limited
memory BFGS minimizer with bounds on parameters.  This registers a R
compatible C interface to L-BFGS-B.3.0 that uses the same function types and
optimization as the @code{optim()} function.  This package also adds more
stopping criteria as well as allowing the adjustment of more tolerances.")
    (license license:gpl2)))

(define-public r-lfc
  (package
    (name "r-lfc")
    (version "0.2.3")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "lfc" version))
       (sha256
        (base32 "1fh3i5mhzgz8k6y32m2y7lilxvm10kjkp5b70zm06iygazsk8bvz"))))
    (properties `((upstream-name . "lfc")))
    (build-system r-build-system)
    (native-inputs (list r-knitr))
    (home-page "https://github.com/erhard-lab/lfc")
    (synopsis
     "Log fold change distribution tools for working with ratios of counts")
    (description
     "This is a package for ratios of count data such as obtained from RNA-seq
are modelled using Bayesian statistics to derive posteriors for effects sizes.
This approach is described in Erhard & Zimmer (2015) <doi:10.1093/nar/gkv696>
and Erhard (2018) <doi:10.1093/bioinformatics/bty471>.")
    (license license:asl2.0)))

(define-public r-lmds
  (package
    (name "r-lmds")
    (version "0.1.0")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "lmds" version))
       (sha256
        (base32 "130azb0nc2wwxv0qi8v5s4rd02p9lc92zwn634pv7b8awbw81i65"))))
    (properties `((upstream-name . "lmds")))
    (build-system r-build-system)
    (propagated-inputs
     (list r-assertthat r-dynutils r-irlba r-matrix))
    (native-inputs (list r-testthat))
    (home-page "https://github.com/dynverse/lmds")
    (synopsis "Landmark multi-dimensional scaling")
    (description
     "This package provides a fast dimensionality reduction method scalable
to large numbers of samples.  @dfn{Landmark Multi-Dimensional Scaling} (LMDS)
is an extension of classical Torgerson MDS, but rather than calculating a
complete distance matrix between all pairs of samples, only the distances
between a set of landmarks and the samples are calculated.")
    (license license:gpl3)))

(define-public r-lme4
  (package
    (name "r-lme4")
    (version "1.1-37")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "lme4" version))
       (sha256
        (base32
         "037hprzv9skjcp07lhgdy9ymaihnms6pjibr61ls1paz8in7bnyg"))))
    (build-system r-build-system)
    (properties
     '((updater-ignored-native-inputs . ("r-car" "r-gamm4"))))
    (propagated-inputs
     (list r-boot
           r-lattice
           r-mass
           r-matrix
           r-minqa
           r-nlme
           r-nloptr
           r-rcpp
           r-rcppeigen
           r-reformulas))
    (native-inputs
     (list r-devtools
           r-ggplot2
           r-knitr
           r-mgcv
           r-optimx
           r-statmod
           r-testthat
           r-tibble))
    (home-page "https://cran.r-project.org/web/packages/lme4")
    (synopsis "Linear mixed-effects models using eigen and S4")
    (description
      "This package provides fit linear and generalized linear mixed-effects
models.  The models and their components are represented using S4 classes and
methods.  The core computational algorithms are implemented using the Eigen
C++ library for numerical linear algebra and RcppEigen glue.")
    (license license:gpl2+)))

(define-public r-lmeinfo
  (package
    (name "r-lmeinfo")
    (version "0.3.2")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "lmeInfo" version))
       (sha256
        (base32 "11sqfb9bj7npngli4h0mzjd2pqjjkza2zmq4b9g2fhmm9r2b0zvd"))))
    (properties
     `((upstream-name . "lmeInfo")
       ;; Avoid dependency cycles.
       (updater-ignored-native-inputs . ("r-lmeinfo" "r-scdhlm"))))
    (build-system r-build-system)
    (propagated-inputs (list r-nlme))
    (native-inputs (list r-knitr r-lme4 r-testthat))
    (home-page "https://jepusto.github.io/lmeInfo/")
    (synopsis "Information matrices for lmeStruct and glsStruct objects")
    (description
     "This package provides analytic derivatives and information matrices for
fitted @dfn{linear mixed effects} (lme) models and generalized least
squares (gls) models estimated using @code{lme()} (from package @code{nlme})
and @code{gls()} (from package @code{nlme}), respectively.  The package
includes functions for estimating the sampling variance-covariance of variance
component parameters using the inverse Fisher information.  The variance
components include the parameters of the random effects structure (for lme
models), the variance structure, and the correlation structure.  The expected
and average forms of the Fisher information matrix are used in the
calculations, and models estimated by full maximum likelihood or restricted
maximum likelihood are supported.  The package also includes a function for
estimating standardized mean difference effect sizes based on fitted lme or
gls models.")
    (license license:gpl3)))

(define-public r-lmodel2
  (package
    (name "r-lmodel2")
    (version "1.7-4")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "lmodel2" version))
       (sha256
        (base32 "1rclwaq2hqn6qpkzl686sikkwc5lrmbbdgpsf8qxwqkn2f0xia4f"))))
    (properties `((upstream-name . "lmodel2")))
    (build-system r-build-system)
    (home-page "https://cran.r-project.org/package=lmodel2")
    (synopsis "Model II regression")
    (description
     "This package computes model II simple linear regression using
@dfn{ordinary least squares} (OLS), @dfn{major axis} (MA), @dfn{standard major
axis} (SMA), and @dfn{ranged major axis} (RMA).")
    (license license:gpl2)))

(define-public r-lmom
  (package
    (name "r-lmom")
    (version "3.2")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "lmom" version))
       (sha256
        (base32 "165dqz8yv3wak77935shz8axcck6jg5h7fnyy0ih9dzin3npng6s"))))
    (properties `((upstream-name . "lmom")))
    (build-system r-build-system)
    (native-inputs (list gfortran))
    (home-page "https://cran.r-project.org/package=lmom")
    (synopsis "L-Moments for R")
    (description
     "This package provides functions related to L-moments: computation of
L-moments and trimmed L-moments of distributions and data samples; parameter
estimation; L-moment ratio diagram; plot vs. quantiles of an extreme-value
distribution.")
    (license license:cpl1.0)))

(define-public r-locfit
  (package
    (name "r-locfit")
    (version "1.5-9.12")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "locfit" version))
       (sha256
        (base32
         "0hwklfvkrqx372y60z4ahvxscckan7bwn1birdpplmgk0zabjcgs"))))
    (build-system r-build-system)
    (propagated-inputs
     (list r-lattice))
    (home-page "https://cran.r-project.org/web/packages/locfit")
    (synopsis "Local regression, likelihood and density estimation")
    (description
     "This package provides functions used for local regression, likelihood
and density estimation.")
    (license (list license:gpl2+ license:gpl3+))))

(define-public r-logspline
  (package
    (name "r-logspline")
    (version "2.1.22")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "logspline" version))
       (sha256
        (base32
         "00pdcfj1hmafxzs7gqw3n072p6pxp9hvsdm062n0xkiby6igffkp"))))
    (properties `((upstream-name . "logspline")))
    (build-system r-build-system)
    (native-inputs (list gfortran))
    (home-page "https://cran.r-project.org/web/packages/logspline/")
    (synopsis "Routines for Logspline density estimation")
    (description
     "This package contains routines for logspline density estimation.  The
function @code{oldlogspline()} uses the same algorithm as the logspline
package version 1.0.x; i.e., the Kooperberg and Stone (1992) algorithm (with
an improved interface).  The recommended routine @code{logspline()} uses an
algorithm from @url{doi:10.1214/aos/1031594728,Stone et al (1997)}.")
    (license license:asl2.0)))

(define-public r-lubridate
  (package
    (name "r-lubridate")
    (version "1.9.4")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "lubridate" version))
       (sha256
        (base32
         "1ha68ri36gcq573j7s71m284166qd1ywran62h9d88nn4gi7wjw6"))))
    (build-system r-build-system)
    (properties
     '((updater-extra-native-inputs . ("tzdata-for-tests"))))
    (arguments
     (list
      #:phases
      '(modify-phases %standard-phases
         ;; We need this for one failing test.
         (add-before 'check 'set-timezone
           (lambda* (#:key inputs #:allow-other-keys)
             (setenv "LOCALTIME"
                     (search-input-file inputs
                                        "share/zoneinfo/localtime"))
             (setenv "TZ" "UTC")
             (setenv "TZDIR"
                     (search-input-directory inputs
                                             "share/zoneinfo")))))))
    (propagated-inputs
     (list r-generics r-timechange))
    (native-inputs
     (list r-knitr r-testthat r-vctrs tzdata-for-tests))
    (home-page "https://cran.r-project.org/web/packages/lubridate/")
    (synopsis "Make dealing with dates a little easier")
    (description
     "This package provides functions to work with date-times and time-spans:
fast and user friendly parsing of date-time data, extraction and updating of
components of a date-time (years, months, days, hours, minutes, and seconds),
algebraic manipulation on date-time and time-span objects.  The
@code{lubridate} package has a consistent and memorable syntax that makes
working with dates easy and fun.")
    (license license:gpl2)))

(define-public r-ggpmisc
  (package
    (name "r-ggpmisc")
    (version "0.6.1")
    (source (origin
              (method url-fetch)
              (uri (cran-uri "ggpmisc" version))
              (sha256
               (base32
                "1ipi8dsxql94gk9h020shbvy26arpwjqlmkplyy746vmhkc03ma8"))))
    (properties
     '((updater-extra-native-inputs . ("r-vdiffr"))))
    (build-system r-build-system)
    (propagated-inputs
     (list r-confintr
           r-dplyr
           r-generics
           r-ggplot2
           r-ggpp
           r-lmodel2
           r-lubridate
           r-mass
           r-multcomp
           r-multcompview
           r-plyr
           r-polynom
           r-quantreg
           r-rlang
           r-scales
           r-splus2r
           r-tibble))
    (native-inputs
     (list r-knitr r-testthat r-vdiffr))
    (home-page "https://www.r4photobiology.info/")
    (synopsis "Miscellaneous Extensions to @code{ggplot2}")
    (description "This package provides extensions to @code{ggplot2},
respecting the grammar of its graphics paradigm.")
    (license license:gpl2+)))

(define-public r-ggside
  (package
    (name "r-ggside")
    (version "0.3.1")
    (source (origin
              (method url-fetch)
              (uri (cran-uri "ggside" version))
              (sha256
               (base32
                "1r36hsnha9bqzfb3rhpj11zg307wzacnkn4i6hi627xrx4knj5cl"))))
    (properties `((upstream-name . "ggside")))
    (build-system r-build-system)
    (propagated-inputs
     (list r-cli
           r-ggplot2
           r-glue
           r-gtable
           r-rlang
           r-scales
           r-tibble
           r-vctrs))
    (native-inputs
     (list r-dplyr
           r-ggdendro
           r-knitr
           r-testthat
           r-tidyr
           r-vdiffr
           r-viridis))
    (home-page "https://cran.r-project.org/package=ggside")
    (synopsis "Side grammar graphics that extends @code{ggplot2}")
    (description
     "The grammar of graphics as shown in @code{ggplot2} has provided an
expressive API for users to build plots.  This package @code{ggside} extends
@code{ggplot2} by allowing users to add graphical information about one of the
main panel's axis using a familiar @code{ggplot2} style API with tidy data.
This package is particularly useful for visualizing metadata on a discrete
axis, or summary graphics on a continuous axis such as a boxplot or a density
distribution.")
    (license license:expat)))

(define-public r-gparotation
  (package
    (name "r-gparotation")
    (version "2025.3-1")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "GPArotation" version))
       (sha256
        (base32 "12w24c0lllk9fmlaaw8j0lfz0vnggn55kcqs7qsbv6h683pdfaxz"))))
    (properties `((upstream-name . "GPArotation")))
    (build-system r-build-system)
    (home-page "https://optimizer.r-forge.r-project.org/GPArotation_www/")
    (synopsis "Gradient projection factor rotation")
    (description
     "This package provides gradient projection algorithms for factor
rotation.  For details see @code{?GPArotation}.")
    (license license:gpl2+)))

(define-public r-gprofiler
  (package
    (name "r-gprofiler")
    (version "0.7.0")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "gProfileR" version))
       (sha256
        (base32
         "1h1v0kgpsn04ald2izznh7fr2riwisj5hcgz4k7h3qc931rf0r4k"))))
    (properties `((upstream-name . "gProfileR")))
    (build-system r-build-system)
    (propagated-inputs
     (list r-plyr r-rcurl))
    (home-page "https://cran.r-project.org/web/packages/gProfileR/")
    (synopsis "Interface to the g:Profiler toolkit")
    (description
     "This package provides tools for functional enrichment analysis,
gene identifier conversion and mapping homologous genes across related
organisms via the @code{g:Profiler} toolkit.")
    (license license:gpl2+)))

(define-public r-gprofiler2
  (package
    (name "r-gprofiler2")
    (version "0.2.3")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "gprofiler2" version))
       (sha256
        (base32
         "1klmg0zj5kr663dzgfzpy1yn161znmjcjq8pl3rahjh2lwaahbmh"))))
    (properties `((upstream-name . "gprofiler2")))
    (build-system r-build-system)
    (propagated-inputs
     (list r-crosstalk
           r-dplyr
           r-ggplot2
           r-gridextra
           r-jsonlite
           r-plotly
           r-rcurl
           r-tidyr
           r-viridislite))
    (native-inputs (list r-knitr r-rmarkdown))
    (home-page "https://cran.r-project.org/web/packages/gprofiler2/")
    (synopsis "Interface to the g:Profiler toolset")
    (description
     "This package provides a toolset for functional enrichment analysis and
visualization, gene/protein/SNP identifier conversion and mapping orthologous
genes across species via @url{https://biit.cs.ut.ee/gprofiler,g:Profiler}.
The main tools are:

@enumerate
@item @code{g:GOSt}, functional enrichment analysis and visualization of gene
  lists;
@item @code{g:Convert}, gene/protein/transcript identifier conversion across
  various namespaces;
@item @code{g:Orth}, orthology search across species;
@item @code{g:SNPense}, mapping SNP rs identifiers to chromosome positions,
  genes and variant effects.
@end enumerate

This package is an R interface corresponding to the 2019 update of
@code{g:Profiler} and provides access to versions @code{e94_eg41_p11} and
higher.")
    (license license:gpl2+)))

(define-public r-oenb
  (package
    (name "r-oenb")
    (version "0.0.2")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "oenb" version))
       (sha256
        (base32
         "1jgxw7ycx2lcdzglg9nix8k08fs4r6i5jdsjzrd6w1dg6smsinl5"))))
    (properties `((upstream-name . "oenb")))
    (build-system r-build-system)
    (propagated-inputs
     (list r-dplyr r-xml))
    (native-inputs (list r-knitr))
    (home-page "https://github.com/franzmohr/oenb")
    (synopsis "Tools for the OeNB Data Web Service")
    (description
     "Tools to access data from the data web service of the
@acronym{OeNB, Oesterreichische Nationalbank},
@url{https://www.oenb.at/en/Statistics/User-Defined-Tables/webservice.html}.")
    (license license:gpl2+)))

(define-public r-oompadata
  (package
    (name "r-oompadata")
    (version "3.1.5")
    (source (origin
              (method url-fetch)
              (uri (cran-uri "oompaData" version))
              (sha256
               (base32
                "1rx5k1mgb0wsibiirfni5p143688h9nybl7sgp146zn0gg7983g4"))))
    (properties `((upstream-name . "oompaData")))
    (build-system r-build-system)
    (home-page "https://oompa.r-forge.r-project.org/")
    (synopsis "Data to illustrate OOMPA algorithms")
    (description
     "OOMPA offers R packages for gene expression and proteomics analysis.
OOMPA uses S4 classes to construct object-oriented tools with a consistent
user interface.  All higher level analysis tools in OOMPA are compatible with
the eSet classes defined in BioConductor.  The lower level processing tools
offer an alternative to parts of BioConductor, but can also be used to enhance
existing BioConductor packages.")
    (license license:asl2.0)))

(define-public r-oompabase
  (package
    (name "r-oompabase")
    (version "3.2.10")
    (source (origin
              (method url-fetch)
              (uri (cran-uri "oompaBase" version))
              (sha256
               (base32
                "026jd50ypwxxq29nfwx337s4x8rx8rmkjqv027apz4zqpsn94l95"))))
    (properties `((upstream-name . "oompaBase")))
    (build-system r-build-system)
    (propagated-inputs (list r-cluster))
    (home-page "https://oompa.r-forge.r-project.org/")
    (synopsis "Class unions, matrix operations, and color schemes for OOMPA")
    (description
     "This package preloads class unions for defining/loading core OOMPA tools.
It also includes vectorized operations for row-by-row means, variances, and
t-tests.  Finally, it provides new colorschemes.")
    (license license:asl2.0)))

(define-public r-openssl
  (package
    (name "r-openssl")
    (version "2.3.3")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "openssl" version))
       (sha256
        (base32
         "0ndzlw5whjayxiw59rn565dlyk46y3c39hmdb7n4gpn3inlhkdxn"))))
    (properties
     `((upstream-name . "openssl")
       (updater-extra-inputs . ("openssl"))))
    (build-system r-build-system)
    (arguments
     (list
      #:phases
      '(modify-phases %standard-phases
         (add-after 'unpack 'do-not-use-versioned-linking
           (lambda _
             (substitute* "configure"
               (("PKG_LIBS=\"\\$\\{PKG_LIBS_VERSIONED\\}\"")
                "PKG_LIBS=\"${PKG_LIBS}\"")))))))
    (inputs
     (list openssl))
    (native-inputs
     (list pkg-config r-curl r-knitr r-sodium r-testthat))
    (propagated-inputs
     (list r-askpass))
    (home-page "https://github.com/jeroenooms/openssl")
    (synopsis "Toolkit for encryption, signatures and certificates")
    (description
     "This package provides R bindings to OpenSSL libssl and libcrypto, plus
custom SSH pubkey parsers.  It supports RSA, DSA and NIST curves P-256, P-384
and P-521.  Cryptographic signatures can either be created and verified
manually or via x509 certificates.  AES block cipher is used in CBC mode for
symmetric encryption; RSA for asymmetric (public key) encryption.  High-level
envelope functions combine RSA and AES for encrypting arbitrary sized data.
Other utilities include key generators, hash functions (md5, sha1, sha256,
etc), base64 encoder, a secure random number generator, and @code{bignum} math
methods for manually performing crypto calculations on large multibyte
integers.")
    (license license:expat)))

(define-public r-orgmassspecr
  (package
    (name "r-orgmassspecr")
    (version "0.5-3")
    (source (origin
              (method url-fetch)
              (uri (cran-uri "OrgMassSpecR" version))
              (sha256
               (base32
                "1dx9d8rb1dfqyhyc26zhfnxiv3rz2ikvs2mwqnsrq3lsjs9dvyc8"))))
    (properties `((upstream-name . "OrgMassSpecR")))
    (build-system r-build-system)
    (native-inputs (list r-knitr))
    (home-page "https://OrgMassSpec.github.io/")
    (synopsis "Organic or biological mass spectrometry data analysis")
    (description
     "This package @code{OrgMassSpecR} is an extension of the @code{R}
statistical computing language.  It contains functions to assist with organic
or biological mass spectrometry data analysis.  Mass spectral libraries are
available as companion packages.")
    (license license:bsd-2)))

(define-public r-scales
  (package
    (name "r-scales")
    (version "1.4.0")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "scales" version))
       (sha256
        (base32 "1vnfhg4bg328vmvja6rzhwbsn8s70a27b8ngjmx2srcjikqgapnm"))))
    (properties
     '((updater-extra-native-inputs . ("r-stringi" "tzdata-for-tests"))))
    (build-system r-build-system)
    (arguments
     (list
      #:phases
      '(modify-phases %standard-phases
         ;; We need this for one failing test.
         (add-before 'check 'set-timezone
           ;; This package is picky about timezones.
           (lambda* (#:key inputs #:allow-other-keys)
             (setenv "TZ" "UTC+1")
             (setenv "TZDIR"
                     (search-input-directory inputs
                                             "share/zoneinfo")))))))
    (propagated-inputs
     (list r-cli
           r-farver
           r-glue
           r-labeling
           r-lifecycle
           r-r6
           r-rcolorbrewer
           r-rlang
           r-viridislite))
    (native-inputs (list r-bit64 r-hms r-stringi r-testthat tzdata-for-tests))
    (home-page "https://github.com/hadley/scales")
    (synopsis "Scale functions for visualization")
    (description
     "This package provides graphical scales that map data to aesthetics, and
provides methods for automatically determining breaks and labels for axes and
legends.")
    (license license:expat)))

(define-public r-sendmailr
  (package
    (name "r-sendmailr")
    (version "1.4-0")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "sendmailR" version))
       (sha256
        (base32
         "1balci88r2ci51xdh5zaqm3ss3vnry8pbkx2qngppc7n2gy932sv"))))
    (properties `((upstream-name . "sendmailR")))
    (build-system r-build-system)
    (propagated-inputs
     (list r-base64enc))
    (native-inputs (list r-knitr))
    (home-page "https://cran.r-project.org/web/packages/sendmailR")
    (synopsis "Send email using R")
    (description
     "This package contains a simple SMTP client which provides a portable
solution for sending email, including attachments, from within R.")
    (license license:gpl2+)))

(define-public r-skat
  (package
    (name "r-skat")
    (version "2.2.5")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "SKAT" version))
       (sha256
        (base32 "1x2iyvzc66lmzwjdr8hy5gf3nxc7ik5vhbs40w00d2m7nr3glh8l"))))
    (properties `((upstream-name . "SKAT")))
    (build-system r-build-system)
    (propagated-inputs (list r-matrix r-rspectra r-spatest))
    (home-page "https://cran.r-project.org/package=SKAT")
    (synopsis "SNP-Set (Sequence) kernel association test")
    (description
     "This package provides functions for kernel-regression-based association
tests including Burden test, SKAT and SKAT-O.  These methods aggregate
individual SNP score statistics in a SNP set and efficiently compute SNP-set
level p-values.")
    (license license:gpl2+)))

(define-public r-spatial
  (package
    (name "r-spatial")
    (version "7.3-18")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "spatial" version))
       (sha256
        (base32
         "0m9hljg8xz996rr2a3fwd7gna62fxslffmxmjpnghnkld4ynjinc"))))
    (build-system r-build-system)
    (home-page "https://www.stats.ox.ac.uk/pub/MASS4/")
    (synopsis "Functions for kriging and point pattern analysis")
    (description
     "This package provides functions for kriging and point pattern
analysis.")
    ;; Either version may be picked.
    (license (list license:gpl2 license:gpl3))))

(define-public r-stringi
  (package
    (name "r-stringi")
    (version "1.8.7")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "stringi" version))
       (sha256
        (base32
         "1in8sn7d7lxm2zcpzm7xlrmvcb2c752nkadcg0ic9ds1rp6xw9h5"))))
    (build-system r-build-system)
    (inputs (list icu4c))
    (native-inputs (list pkg-config))
    (home-page "http://stringi.rexamine.com/")
    (synopsis "Character string processing facilities")
    (description
     "This package allows for fast, correct, consistent, portable, as well as
convenient character string/text processing in every locale and any native
encoding.  Owing to the use of the ICU library, the package provides R users
with platform-independent functions known to Java, Perl, Python, PHP, and Ruby
programmers.  Among available features there are: pattern searching
 (e.g.  via regular expressions), random string generation, string collation,
transliteration, concatenation, date-time formatting and parsing, etc.")
    (license license:bsd-3)))

(define-public r-stringr
  (package
    (name "r-stringr")
    (version "1.5.1")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "stringr" version))
       (sha256
        (base32 "1pj5xwg8kq2jllmszgkw96qj37wlb0x0vx4f3m5j211zpd8yrbd4"))))
    (build-system r-build-system)
    (propagated-inputs
     (list r-cli r-glue r-lifecycle r-magrittr r-rlang r-stringi r-vctrs))
    (native-inputs (list r-knitr r-testthat))
    (home-page "https://github.com/hadley/stringr")
    (synopsis "Simple, consistent wrappers for common string operations")
    (description
     "Stringr is a consistent, simple and easy to use set of wrappers around
the fantastic @code{stringi} package.  All function and argument names (and
positions) are consistent, all functions deal with \"NA\"'s and zero length
vectors in the same way, and the output from one function is easy to feed into
the input of another.")
    (license license:gpl2+)))

(define-public r-survival
  (package
    (name "r-survival")
    (version "3.8-3")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "survival" version))
       (sha256
        (base32
         "05crwnjvdx2z6asjipc04534zp2jk3a16qkg8b3n399pgnjhbayw"))))
    (build-system r-build-system)
    (propagated-inputs
     (list r-matrix))
    (home-page "https://github.com/therneau/survival")
    (synopsis "Survival analysis")
    (description
     "This package contains the core survival analysis routines, including
definition of Surv objects, Kaplan-Meier and Aalen-Johansen (multi-state)
curves, Cox models, and parametric accelerated failure time models.")
    (license license:lgpl2.0+)))

(define-public r-svglite
  (package
    (name "r-svglite")
    (version "2.2.1")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "svglite" version))
       (sha256
        (base32 "1hbgad7cgkyl6swxx69wgkva46px43fqfw9562f1g77sgi4sbvb4"))))
    (properties `((upstream-name . "svglite")))
    (build-system r-build-system)
    (inputs (list libpng zlib))
    (propagated-inputs (list r-base64enc
                             r-cli
                             r-cpp11
                             r-lifecycle
                             r-rlang
                             r-systemfonts
                             r-textshaping))
    (native-inputs (list r-fontquiver r-knitr r-testthat r-xml2))
    (home-page "https://svglite.r-lib.org")
    (synopsis "SVG graphics device")
    (description
     "@code{svglite} is a graphics device that produces clean
@dfn{SVG} (Scalable Vector Graphics) output, suitable for use on the web, or
hand editing.  Compared to the built-in @code{svg()}, @code{svglite} is
considerably faster, produces smaller files, and leaves text as is.")
    (license license:gpl2+)))

(define-public r-swagger
  (package
    (name "r-swagger")
    (version "5.17.14.1")
    (source (origin
              (method url-fetch)
              (uri (cran-uri "swagger" version))
              (sha256
               (base32
                "0ykmz3j1n06w1injcnlkb3xv79vwiyv94j74m950rfrbv97dda58"))))
    (properties `((upstream-name . "swagger")))
    (build-system r-build-system)
    (native-inputs (list r-testthat))
    (home-page "https://github.com/rstudio/swagger")
    (synopsis
     "Dynamically generate documentation from a Swagger-compliant API")
    (description
     "This package provides a collection of HTML, JavaScript, and CSS assets
that dynamically generate beautiful documentation from a Swagger compliant
API.")
    (license license:asl2.0)))

(define-public r-pacman
  (package
    (name "r-pacman")
    (version "0.5.1")
    (source (origin
              (method url-fetch)
              (uri (cran-uri "pacman" version))
              (sha256
               (base32
                "0z7gngd6h83cpjhq1vg75wvzhdjbgjh7gj5d4zvvi9gd2lmagjcy"))))
    (build-system r-build-system)
    (propagated-inputs
     (list r-remotes))
    (native-inputs (list r-testthat))
    (home-page "https://github.com/trinker/pacman")
    (synopsis "Package Management Tool")
    (description "This package provides tools to more conveniently perform
tasks associated with add-on packages.  @code{pacman} conveniently wraps
library and package related functions and names them in an intuitive and
consistent fashion.  It seeks to combine functionality from lower level
functions which can speed up workflow.")
    (license license:gpl2)))

(define-public r-pagoda2
  (package
    (name "r-pagoda2")
    (version "1.0.12")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "pagoda2" version))
       (sha256
        (base32 "1kck12ri52nwsrxhjs8ghjji3rv1dxxjy8bxn1kk1hbg30265fsw"))))
    (properties `((upstream-name . "pagoda2")))
    (build-system r-build-system)
    (propagated-inputs
     (list r-dendsort
           r-drat
           r-fastcluster
           r-igraph
           r-irlba
           r-magrittr
           r-mass
           r-matrix
           r-mgcv
           r-n2r
           r-plyr
           r-r-utils
           r-r6
           r-rcpp
           r-rcpparmadillo
           r-rcppeigen
           r-rcppprogress
           r-rjson
           r-rlang
           r-rmtstat
           r-rook
           r-rtsne
           r-sccore
           r-urltools))
    (native-inputs (list r-testthat))
    (home-page "https://github.com/kharchenkolab/pagoda2")
    (synopsis "Single cell analysis and differential expression")
    (description
     "The package offers functions for analyzing and interactively exploring
large-scale single-cell RNA-seq datasets.  Pagoda2 primarily performs
normalization and differential gene expression analysis, with an interactive
application for exploring single-cell RNA-seq datasets.  It performs basic
tasks such as cell size normalization, gene variance normalization, and can be
used to identify subpopulations and run differential expression within
individual samples.  pagoda2 was written to rapidly process modern large-scale
scRNAseq datasets of approximately 1e6 cells.  The companion web application
allows users to explore which gene expression patterns form the different
subpopulations within your data.  The package also serves as the primary
method for preprocessing data for conos.")
    (license license:gpl3)))

(define-public r-pals
  (package
    (name "r-pals")
    (version "1.10")
    (source (origin
              (method url-fetch)
              (uri (cran-uri "pals" version))
              (sha256
               (base32
                "0gavg41kddy1i68rz2l5c9ldvvf8cw88mskdml9hxhnvnh93ff9r"))))
    (properties `((upstream-name . "pals")))
    (build-system r-build-system)
    (propagated-inputs
     (list r-colorspace r-dichromat r-mapproj r-maps))
    (native-inputs (list r-knitr r-testthat))
    (home-page "https://kwstat.github.io/pals/")
    (synopsis "Color palettes, color maps, and tools to evaluate them")
    (description
     "This package provides a comprehensive collection of color
palettes, color maps, and tools to evaluate them.")
    (license license:gpl3)))

(define-public r-papaja
  (package
    (name "r-papaja")
    (version "0.1.3")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "papaja" version))
       (sha256
        (base32 "0lknj3r4kd8i4jlfi8q7p7fi2s009q8rryf0r44zxfxvr9nkmyxv"))))
    (properties `((upstream-name . "papaja")))
    (build-system r-build-system)
    (arguments
     (list
      #:phases
      '(modify-phases %standard-phases
         ;; This is needed for vignettes.
         (add-before 'check 'set-HOME
           (lambda _ (setenv "HOME" "/tmp")))
         (add-after 'unpack 'delete-bad-tests
           (lambda _
             ;; 6 tests fail because of slight format differences.  The values
             ;; are all fine.
             (for-each delete-file
                       '("tests/testthat/test_apa_print_glm.R"
                         "tests/testthat/test_apa_print_model_comp.R")))))))
    (propagated-inputs
     (list r-bookdown
           r-broom
           r-glue
           r-knitr
           r-rmarkdown
           r-rmdfiltr
           r-tinylabels
           r-yaml
           r-zip
           texlive-amsmath
           texlive-apa6
           texlive-booktabs
           texlive-caption
           texlive-csquotes
           texlive-endfloat
           texlive-environ
           texlive-etoolbox
           texlive-fancyhdr
           texlive-framed
           texlive-geometry
           texlive-graphics
           texlive-grfext
           texlive-hyperref
           texlive-lineno
           texlive-multirow
           texlive-threeparttable
           texlive-threeparttablex
           texlive-titlesec
           texlive-tools
           texlive-trimspaces
           texlive-was                  ; upgreek.sty
           texlive-xcolor
           texlive-xpatch
           (texlive-local-tree (list
                                texlive-amsfonts
                                texlive-times
                                texlive-lm))))
    (native-inputs
     (list r-afex
           r-bayesfactor
           r-beeswarm
           r-effectsize
           r-emmeans
           r-multcomp
           r-knitr
           r-r-rsp
           r-testthat
           r-vgam))
    (home-page "https://github.com/crsh/papaja")
    (synopsis
     "Prepare American Psychological Association journal articles with R Markdown")
    (description
     "This package provides tools to create dynamic, submission-ready
manuscripts, which conform to American Psychological Association manuscript
guidelines.  It provides R Markdown document formats for manuscripts (PDF and
Word) and revision letters (PDF).  Helper functions facilitate reporting
statistical analyses or create publication-ready tables and plots.")
    (license license:expat)))

(define-public r-paralleldist
  (package
    (name "r-paralleldist")
    (version "0.2.6")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "parallelDist" version))
       (sha256
        (base32 "01ly4hxwa64a0ya5gla8rvv72s9mcknsfznivjkh937pbjwb7iih"))))
    (properties `((upstream-name . "parallelDist")))
    (build-system r-build-system)
    (propagated-inputs (list r-rcpp r-rcpparmadillo r-rcppparallel))
    (native-inputs (list r-dtw r-ggplot2 r-proxy r-rcppxptrutils r-testthat))
    (home-page "https://github.com/alexeckert/parallelDist")
    (synopsis "Parallel Distance Matrix Computation using multiple threads")
    (description
     "This package provides a fast parallelized alternative to R's native
@code{dist} function to calculate distance matrices for continuous, binary,
and multi-dimensional input matrices, which supports a broad variety of
predefined distance functions from other R packages, as well as user- defined
functions written in C++.  For ease of use, the @code{parDist} function
extends the signature of the @code{dist} function and uses the same parameter
naming conventions as distance methods of existing R packages.")
    (license license:gpl2+)))

(define-public r-paramhelpers
  (package
    (name "r-paramhelpers")
    (version "1.14.2")
    (source (origin
              (method url-fetch)
              (uri (cran-uri "ParamHelpers" version))
              (sha256
               (base32
                "0x938sblzzfn7m19xcc6v9z1cpqwg0xngshnyc4hph9gs6r5js5b"))))
    (properties
     '((upstream-name . "ParamHelpers")
       (updater-extra-native-inputs
        . ("r-eaf" "r-emoa" "r-ggally" "r-gridextra" "r-plyr"))))
    (build-system r-build-system)
    (arguments
     (list
      #:phases
      '(modify-phases %standard-phases
         (add-after 'unpack 'disable-bad-tests
           ;; This one test fails for unclear reasons.
           (lambda _ (delete-file "tests/testthat/test_plotEAF.R"))))))
    (propagated-inputs (list r-backports r-bbmisc r-checkmate r-fastmatch))
    (native-inputs
     (list r-eaf
           r-emoa
           r-ggally
           r-ggplot2
           r-gridextra
           r-plyr
           r-irace
           r-lhs
           r-testthat))
    (home-page "https://paramhelpers.mlr-org.com")
    (synopsis
     "Helpers for parameters in black-box optimization, tuning, and machine learning")
    (description
     "This is a package for parameter description and operations in
optimization, tuning and machine learning.  Parameters can be described (type,
constraints, defaults, etc.), combined to parameter sets and can in general be
programmed on.  A useful @code{OptPath} object (archive) to log function
evaluations is also provided.")
    (license license:bsd-2)))

(define-public r-parallelmap
  (package
    (name "r-parallelmap")
    (version "1.5.1")
    (source (origin
              (method url-fetch)
              (uri (cran-uri "parallelMap" version))
              (sha256
               (base32
                "1qg7zpz5sd9jp8wzjqahkhipwj1jn192llwg06q4gv9mlcsac261"))))
    (properties `((upstream-name . "parallelMap")))
    (build-system r-build-system)
    (propagated-inputs (list r-bbmisc r-checkmate))
    (native-inputs (list r-batchjobs r-batchtools r-rpart r-testthat))
    (home-page "https://parallelmap.mlr-org.com")
    (synopsis "Unified interface to parallelization backends")
    (description
     "This package provides a unified parallelization framework for multiple
backends.  This package is designed for internal package and interactive
usage.  The main operation is parallel mapping over lists.  It supports local,
multicore, mpi and BatchJobs mode.  It allows tagging of the parallel
operation with a level name that can be later selected by the user to switch
on parallel execution for exactly this operation.")
    (license license:bsd-2)))

(define-public r-pheatmap
  (package
    (name "r-pheatmap")
    (version "1.0.12")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "pheatmap" version))
       (sha256
        (base32
         "1hdh74az3vyzz6dqa311rhxdm74n46lyr03p862kn80p0kp9d7ap"))))
    (build-system r-build-system)
    (propagated-inputs
     (list r-gtable r-rcolorbrewer r-scales))
    (home-page "https://cran.r-project.org/web/packages/pheatmap")
    (synopsis "Pretty heatmaps")
    (description
     "This package provides an implementation of heatmaps that offers more
control over dimensions and appearance.")
    (license license:gpl2+)))

(define-public r-philentropy
  (package
    (name "r-philentropy")
    (version "0.9.0")
    (source (origin
              (method url-fetch)
              (uri (cran-uri "philentropy" version))
              (sha256
               (base32
                "04rmhfslim3vwxi14qllp9kzjcl7fwyzczar0lb72j5vd07mmns0"))))
    (properties `((upstream-name . "philentropy")))
    (build-system r-build-system)
    (propagated-inputs (list r-kernsmooth r-poorman r-rcpp))
    (native-inputs (list r-knitr r-testthat))
    (home-page "https://github.com/drostlab/philentropy")
    (synopsis
     "Similarity and distance quantification between probability functions")
    (description
     "This package computes optimized distance and similarity measures for
comparing probability functions (Drost (2018) <doi:10.21105/joss.00765>).
These comparisons between probability functions have their foundations in a
broad range of scientific disciplines from mathematics to ecology.  The aim of
this package is to provide a core framework for clustering, classification,
statistical inference, goodness-of-fit, non-parametric statistics, information
theory, and machine learning tasks that are based on comparing univariate or
multivariate probability functions.")
    (license license:gpl2)))

(define-public r-pnwcolors
  (package
    (name "r-pnwcolors")
    (version "0.1.0")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "PNWColors" version))
       (sha256
        (base32
         "1phplnclkficfv8s6wsyrckk4ixzbayiy5iix6dddg40485l9nyj"))))
    (properties `((upstream-name . "PNWColors")))
    (build-system r-build-system)
    (home-page "https://github.com/jakelawlor/PNWColors")
    (synopsis "Color palettes for data visualizations")
    (description
     "This package provides color palettes.  They are checked for colorblind
accessibility from hue, saturation, and lightness value scaling using the
Chroma.js Color Palette Helper.  See @url{https://gka.github.io/palettes}.")
    (license license:cc0)))

(define-public r-plm
  (package
    (name "r-plm")
    (version "2.6-6")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "plm" version))
       (sha256
        (base32 "1cq0hj6csfxsrm6k4qw5rds018div26mw6m34wjj45gj34l87a9m"))))
    (properties `((upstream-name . "plm")))
    (build-system r-build-system)
    (propagated-inputs (list r-bdsmatrix
                             r-collapse
                             r-formula
                             r-lattice
                             r-lmtest
                             r-mass
                             r-maxlik
                             r-nlme
                             r-rdpack
                             r-sandwich
                             r-zoo))
    (native-inputs (list r-knitr))
    (home-page "https://cran.r-project.org/package=plm")
    (synopsis "Linear Models for panel data")
    (description
     "This package provides a set of estimators for models and (robust)
covariance matrices, and tests for panel data econometrics, including
within/fixed effects, random effects, between, first-difference, nested random
effects as well as instrumental-variable (IV) and Hausman-Taylor-style models,
panel generalized method of moments (GMM) and general FGLS models, mean
groups (MG), demeaned MG, and common correlated effects (CCEMG) and
pooled (CCEP) estimators with common factors, variable coefficients and
limited dependent variables models.  Test functions include model
specification, serial correlation, cross-sectional dependence, panel unit root
and panel Granger (non-)causality.  Typical references are general
econometrics text books such as Baltagi (2021), Econometric Analysis of Panel
Data (<doi:10.1007/978-3-030-53953-5>), Hsiao
(2014), Analysis of Panel Data (<doi:10.1017/CBO9781139839327>), and Croissant
and Millo (2018), Panel Data Econometrics with
R (<doi:10.1002/9781119504641>).")
    (license license:gpl2+)))

(define-public r-plotfunctions
  (package
    (name "r-plotfunctions")
    (version "1.4")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "plotfunctions" version))
       (sha256
        (base32 "0asmxw8283fpvl83h478j5nyg59xqifqaa8f2f6l199gvvswhhg2"))))
    (properties `((upstream-name . "plotfunctions")))
    (build-system r-build-system)
    (native-inputs (list r-knitr))
    (home-page "https://jacolienvanrij.com/tutorials.html")
    (synopsis "Various functions to facilitate visualization of data and analysis")
    (description
     "When analyzing data, plots are a helpful tool for visualizing data and
interpreting statistical models.  This package provides a set of simple tools
for building plots incrementally, starting with an empty plot region, and
adding bars, data points, regression lines, error bars, gradient legends,
density distributions in the margins, and even pictures.  The package builds
further on R graphics by simply combining functions and settings in order to
reduce the amount of code to produce for the user.  As a result, the package
does not use formula input or special syntax, but can be used in combination
with default R plot functions.")
    (license license:gpl2+)))

(define-public r-plotmo
  (package
    (name "r-plotmo")
    (version "3.6.4")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "plotmo" version))
       (sha256
        (base32 "0wl2xlidib4r54nm1q5zndr9iilagpyc3xlxs0cpd487hdh3zcn8"))))
    (properties `((upstream-name . "plotmo")))
    (build-system r-build-system)
    (propagated-inputs (list r-formula r-plotrix))
    (native-inputs (list r-rpart))
    (home-page "http://www.milbo.users.sonic.net")
    (synopsis
     "Plot a model's residuals, response, and partial dependence plots")
    (description
     "This package lets you plot model surfaces for a wide variety of models
using partial dependence plots and other techniques.  Also plot model
residuals and other information on the model.")
    (license license:gpl3)))

(define-public r-plumber
  (package
    (name "r-plumber")
    (version "1.3.0")
    (source (origin
              (method url-fetch)
              (uri (cran-uri "plumber" version))
              (sha256
               (base32
                "0z9dzlmvsbqn1cykia07kpa88w5lcgrp39bqqm2d3bhnzkr5kj1s"))))
    (properties
     '((upstream-name . "plumber")
       (updater-extra-native-inputs
        . ("r-htmlwidgets" "r-readxl"))))
    (build-system r-build-system)
    (propagated-inputs (list r-crayon
                             r-httpuv
                             r-jsonlite
                             r-lifecycle
                             r-magrittr
                             r-mime
                             r-promises
                             r-r6
                             r-rlang
                             r-sodium
                             r-stringi
                             r-swagger
                             r-webutils))
    (native-inputs
     (list r-arrow
           r-base64enc
           r-covr
           r-geojsonsf
           r-htmlwidgets
           r-knitr
           r-later
           r-mockery
           r-readr
           r-readxl
           r-rmarkdown
           r-sf
           r-spelling
           r-testthat
           r-visnetwork
           r-writexl
           r-yaml))
    (home-page "https://www.rplumber.io")
    (synopsis "API generator for R")
    (description
     "This package gives you the ability to automatically generate and serve
an HTTP API from R functions using the annotations in the R documentation
around your functions.")
    (license license:expat)))

(define-public r-polychrome
  (package
    (name "r-polychrome")
    (version "1.5.4")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "Polychrome" version))
       (sha256
        (base32 "18lxkdfw37ci0y0l0wya7kr57hwn3yh2r88gjimpp4x1z833vxrw"))))
    (properties `((upstream-name . "Polychrome")))
    (build-system r-build-system)
    (propagated-inputs
     (list r-colorspace r-scatterplot3d))
    (native-inputs
     (list r-knitr))
    (home-page "https://oompa.r-forge.r-project.org/")
    (synopsis "Qualitative palettes with many colors")
    (description
     "This package provides tools for creating, viewing, and assessing
qualitative palettes with many (20-30 or more) colors.  See Coombes and
colleagues (2019) @url{https://doi:10.18637/jss.v090.c01}.")
    (license license:asl2.0)))

(define-public r-polylabelr
  (package
    (name "r-polylabelr")
    (version "0.3.0")
    (source (origin
              (method url-fetch)
              (uri (cran-uri "polylabelr" version))
              (sha256
               (base32
                "1wxr2mhbsq7sm3byb4jn6dskmlxxjywhj453qhs0z40aaiphd49c"))))
    (properties `((upstream-name . "polylabelr")))
    (build-system r-build-system)
    (propagated-inputs (list r-rcpp))
    (native-inputs (list r-sf r-spelling r-testthat))
    (home-page "https://github.com/jolars/polylabelr")
    (synopsis "Finding pole of inaccessibility (visual center) of a polygon")
    (description
     "This package provides a wrapper around the @code{C++} library @code{
polylabel} from @code{Mapbox}, providing an efficient routine for finding the
approximate pole of inaccessibility of a polygon, which usually serves as an
excellent candidate for labeling of a polygon.")
    (license license:expat)))

(define-public r-poorman
  (package
    (name "r-poorman")
    (version "0.2.7")
    (source (origin
              (method url-fetch)
              (uri (cran-uri "poorman" version))
              (sha256
               (base32
                "1amlcbgfnm6yh7lmlzhs7aalv4mdm2ir3s2kpx33ppnz7hlii508"))))
    (properties `((upstream-name . "poorman")))
    (build-system r-build-system)
    (native-inputs (list r-knitr))
    (home-page "https://nathaneastwood.github.io/poorman/")
    (synopsis "Dependency-free recreation of dplyr")
    (description
     "This package provides a replication of key functionality from
@code{dplyr} and the wider @code{tidyverse} using only @code{base}.")
    (license license:expat)))

(define-public r-ecdat
  (package
    (name "r-ecdat")
    (version "0.4-2")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "Ecdat" version))
       (sha256
        (base32 "1vyc4ynkd65mng2x8wvzn47crsvaqfz97n89jxn12xv13bpsbs7c"))))
    (properties `((upstream-name . "Ecdat")))
    (build-system r-build-system)
    (propagated-inputs (list r-ecfun))
    (home-page "https://www.r-project.org")
    (synopsis "Data sets for econometrics")
    (description "This package provides data sets for econometrics, including
political science.")
    (license license:gpl2+)))

(define-public r-ecfun
  (package
    (name "r-ecfun")
    (version "0.3-6")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "Ecfun" version))
       (sha256
        (base32 "0651vbb040y17sizh927vq4jfidpxilmwdgkhmr7z8p24yb588rc"))))
    (properties `((upstream-name . "Ecfun")))
    (build-system r-build-system)
    (propagated-inputs (list r-bma
                             r-fda
                             r-jpeg
                             r-mass
                             r-mvtnorm
                             r-readr
                             r-rvest
                             r-rworldmap
                             r-stringi
                             r-tis
                             r-xml2))
    (native-inputs (list r-knitr))
    (home-page "https://www.r-project.org")
    (synopsis "Functions for Ecdat")
    (description
     "This package provides functions and vignettes to update data sets in
Ecdat and to create, manipulate, plot, and analyze those and similar data
sets.")
    (license license:gpl2+)))

(define-public r-ecosolver
  (package
    (name "r-ecosolver")
    (version "0.5.5")
    (source (origin
              (method url-fetch)
              (uri (cran-uri "ECOSolveR" version))
              (sha256
               (base32
                "1izc8dwj438wpkmdmhwnnhkijz5skig4gwxgr6f1bzmj08bfv515"))))
    (properties `((upstream-name . "ECOSolveR")))
    (build-system r-build-system)
    (native-inputs (list r-knitr r-matrix r-testthat))
    (home-page "https://bnaras.github.io/ECOSolveR/")
    (synopsis "Embedded conic solver in R")
    (description
     "This package provides an R interface to the @dfn{Embedded COnic
Solver} (ECOS), an efficient and robust C library for convex problems.
Conic and equality constraints can be specified in addition to integer
and boolean variable constraints for mixed-integer problems.  This R
interface is inspired by the Python interface and has similar calling
conventions.")
    (license license:gpl3+)))

(define-public r-ecp
  (package
    (name "r-ecp")
    (version "3.1.6")
    (source (origin
              (method url-fetch)
              (uri (cran-uri "ecp" version))
              (sha256
               (base32
                "1imahvby3nj1b5d1x7hq6gkfg0fyyd27ghls0v35456imy1fmhz5"))))
    (build-system r-build-system)
    (propagated-inputs
     (list r-rcpp))
    (native-inputs (list r-r-rsp))
    (home-page "https://cran.r-project.org/web/packages/ecp/")
    (synopsis "Multiple change-point analysis of multivariate data")
    (description
     "This package implements various procedures for finding multiple
change-points.  Two methods make use of dynamic programming and pruning, with
no distributional assumptions other than the existence of certain absolute
moments in one method.  Hierarchical and exact search methods are included.
All methods return the set of estimated change-points as well as other summary
information.")
    (license license:gpl2+)))

(define-public r-ellipsis
  (package
    (name "r-ellipsis")
    (version "0.3.2")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "ellipsis" version))
       (sha256
        (base32
         "0n0mm9jngklv7j9wa64jdji035z0smmnsp2dfwcz9isrxgjnc0m9"))))
    (build-system r-build-system)
    (propagated-inputs
     (list r-rlang))
    (native-inputs (list r-testthat))
    (home-page "https://github.com/hadley/ellipsis")
    (synopsis "Tools for working with additional arguments")
    (description
     "In S3 generics, it's useful to take @code{...} so that methods can have
additional arguments.  But this flexibility comes at a cost: misspelled
arguments will be silently ignored.  The @code{ellipsis} package is an
experiment that allows a generic to warn if any arguments passed in @code{...}
are not used.")
    (license license:gpl3)))

(define-public r-ga
  (package
    (name "r-ga")
    (version "3.2.4")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "GA" version))
       (sha256
        (base32 "1gc1n2xdzrkc9cvrm6a50c9xpwvf0isdgvs1qpm8x1afacw6d7z5"))))
    (properties `((upstream-name . "GA")))
    (build-system r-build-system)
    (propagated-inputs
     (list r-cli
           r-crayon
           r-foreach
           r-iterators
           r-rcpp
           r-rcpparmadillo))
    (native-inputs
     (list r-knitr))
    (home-page "https://luca-scr.github.io/GA/")
    (synopsis "Genetic algorithms for stochastic optimisation")
    (description
     "Flexible general-purpose toolbox implementing genetic algorithms (GAs)
for stochastic optimisation.  Binary, real-valued, and permutation
representations are available to optimize a fitness function, i.e., a function
provided by users depending on their objective function.  Several genetic
operators are available and can be combined to explore the best settings for
the current task.  Furthermore, users can define new genetic operators and
easily evaluate their performances.  Local search using general-purpose
optimisation algorithms can be applied stochastically to exploit interesting
regions.  GAs can be run sequentially or in parallel, using an explicit
master-slave parallelisation or a coarse-grain islands approach.")
    (license license:gpl2+)))

(define-public r-gap
  (package
    (name "r-gap")
    (version "1.6")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "gap" version))
       (sha256
        (base32 "1pz0j3vglccrwm3p9lj6wbq58varb8b0xg5r97gmz8c3biprpzww"))))
    (properties `((upstream-name . "gap")))
    (build-system r-build-system)
    (propagated-inputs (list r-dplyr r-gap-datasets r-ggplot2 r-plotly
                             r-rdpack))
    (native-inputs (list gfortran r-knitr))
    (home-page "https://github.com/jinghuazhao/R")
    (synopsis "Genetic analysis package")
    (description
     "This package is designed as an integrated package for genetic data
analysis of both population and family data.  Currently, it contains functions
for sample size calculations of both population-based and family-based
designs, probability of familial disease aggregation, kinship calculation,
statistics in linkage analysis, and association analysis involving genetic
markers including haplotype analysis with or without environmental covariates.
Over years, the package has been developed in-between many projects hence also
in line with the name (gap).")
    (license license:gpl2+)))

(define-public r-gap-datasets
  (package
    (name "r-gap-datasets")
    (version "0.0.6")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "gap.datasets" version))
       (sha256
        (base32 "1jwpsb66sgj2zzgrpgwxc22df66gbhi278ywbmaicc10mipv050y"))))
    (properties `((upstream-name . "gap.datasets")))
    (build-system r-build-system)
    (home-page "https://jinghuazhao.github.io/R/")
    (synopsis "Datasets for gap")
    (description
     "This package provides datasets associated with the gap package.
Currently, it includes an example data for regional association plot (CDKN),
an example data for a genomewide association meta-analysis (OPG), data in
studies of Parkinson's diease (PD), ALHD2 markers and alcoholism (aldh2),
APOE/APOC1 markers and Schizophrenia (apoeapoc), cystic fibrosis (cf), a
Olink/INF panel (inf1), Manhattan plots with
(hr1420, mhtdata) and without (w4) gene annotations.")
    (license license:gpl2+)))

(define-public r-grandr
  (package
    (name "r-grandr")
    (version "0.2.6")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "grandR" version))
       (sha256
        (base32 "058cvcjrqhgm14vyhlm1mdhs3z0kfpjlfc3msadsvlhlb7p676sn"))))
    (properties `((upstream-name . "grandR")))
    (build-system r-build-system)
    (propagated-inputs (list r-cowplot
                             r-ggplot2
                             r-labeling
                             r-lfc
                             r-mass
                             r-matrix
                             r-minpack-lm
                             r-numderiv
                             r-patchwork
                             r-plyr
                             r-rcurl
                             r-reshape2
                             r-rlang
                             r-scales))
    (native-inputs (list r-knitr))
    (home-page "https://github.com/erhard-lab/grandR")
    (synopsis
     "Comprehensive analysis of nucleotide conversion sequencing data")
    (description
     "Nucleotide conversion sequencing experiments have been developed to add
a temporal dimension to RNA-seq and single-cell RNA-seq.  Such experiments
require specialized tools for primary processing such as GRAND-SLAM, and
specialized tools for downstream analyses. @code{grandR} provides a
comprehensive toolbox for quality control, kinetic modeling, differential gene
expression analysis and visualization of such data.")
    (license license:asl2.0)))

(define-public r-greg
  (package
    (name "r-greg")
    (version "2.0.2")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "Greg" version))
       (sha256
        (base32 "13rsah8vf9s8wpkr5hlayyqa8v728cz80bvpg8vmlvnam8isb30s"))))
    (properties `((upstream-name . "Greg")))
    (build-system r-build-system)
    (propagated-inputs (list r-broom
                             r-dplyr
                             r-epi
                             r-forestplot
                             r-glue
                             r-gmisc
                             r-hmisc
                             r-htmltable
                             r-knitr
                             r-nlme
                             r-purrr
                             r-rlang
                             r-rms
                             r-sandwich
                             r-stringr
                             r-tibble
                             r-tidyr
                             r-tidyselect))
    (native-inputs (list r-boot r-knitr r-testthat r-tidyverse))
    (home-page "http://gforge.se")
    (synopsis "Regression helper functions")
    (description
     "This package provides methods for manipulating regression models and for
describing these in a style adapted for medical journals.  It contains
functions for generating an HTML table with crude and adjusted estimates,
plotting hazard ratio, plotting model estimates and confidence intervals using
forest plots, extending this to comparing multiple models in a single forest
plots.  In addition to the descriptive methods, there are functions for the
robust covariance matrix provided by the sandwich package, a function for
adding non-linearities to a model, and a wrapper around the Epi package's
@code{Lexis()} functions for time-splitting a dataset when modeling
non-proportional hazards in Cox regressions.")
    (license license:gpl3+)))

(define-public r-grr
  (package
    (name "r-grr")
    (version "0.9.5")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "grr" version))
       (sha256
        (base32
         "0arbcgrvhkwb5xk4nry1ffg2qj0v8ivhjghdr505ib4357g0c9i9"))))
    (build-system r-build-system)
    (home-page "https://cran.r-project.org/web/packages/grr")
    (synopsis "Alternative implementations of base R functions")
    (description
     "This package provides alternative implementations of some base R
functions, including @code{sort}, @code{order}, and @code{match}.  The
functions are simplified but can be faster or have other advantages.")
    (license license:gpl3)))

(define-public r-magrittr
  (package
    (name "r-magrittr")
    (version "2.0.3")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "magrittr" version))
       (sha256
        (base32 "1ljmrrm36y31db5z4cl863ap8k3jcaxk0qzy3f0cn6iag4zzigx2"))))
    (properties
     ;; We can't have r-knitr or r-testthat among the inputs here, because
     ;; that would lead to dependency cycles.
     '((updater-ignored-native-inputs . ("r-knitr" "r-testthat"))))
    (build-system r-build-system)
    ;; Tests require r-testthat, which uses this package.
    (arguments (list #:tests? #false))
    (home-page "https://cran.r-project.org/web/packages/magrittr/index.html")
    (synopsis "Forward-pipe operator for R")
    (description
     "Magrittr provides a mechanism for chaining commands with a new
forward-pipe operator, @code{%>%}.  This operator will forward a value, or the
result of an expression, into the next function call/expression.  There is
flexible support for the type of right-hand side expressions.  For more
information, see package vignette.  To quote Rene Magritte, \"Ceci n'est pas
un pipe.\"")
    (license license:expat)))

(define-public r-marginaleffects
  (package
    (name "r-marginaleffects")
    (version "0.26.0")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "marginaleffects" version))
       (sha256
        (base32 "1l78j10y1fv59wijwahb1hz919g5b0w1mi8snvb8mcrgdbwrd60j"))))
    (properties `((upstream-name . "marginaleffects")))
    (build-system r-build-system)
    (propagated-inputs (list r-backports
                             r-checkmate
                             r-data-table
                             r-formula
                             r-generics
                             r-insight
                             r-rcpp
                             r-rcppeigen
                             r-rlang))
    (native-inputs (list r-knitr r-quarto r-spelling r-tinytest))
    (home-page "https://marginaleffects.com/")
    (synopsis
     "Predictions, comparisons, slopes, marginal means, and hypothesis tests")
    (description
     "This package lets you compute and plot predictions, slopes, marginal
means, and comparisons (contrasts, risk ratios, odds, etc.) for over 100
classes of statistical and machine learning models in R.  Conduct linear and
non-linear hypothesis tests, or equivalence tests.  Calculate uncertainty
estimates using the delta method, bootstrapping, or simulation-based
inference.  Details can be found in Arel-Bundock, Greifer, and Heiss (2024)
<doi:10.18637/jss.v111.i09>.")
    (license license:gpl3+)))

(define-public r-markdown
  (package
    (name "r-markdown")
    (version "2.0")
    (source (origin
              (method url-fetch)
              (uri (cran-uri "markdown" version))
              (sha256
               (base32
                "0hcmpy4x2rwq061ybq1xyqxbc76jm0zfzgzy70g90y38zdsxwq55"))))
    (build-system r-build-system)
    ;; Skip check phase because the tests require the r-knitr package to be
    ;; installed. This prevents installation failures. Knitr normally
    ;; shouldn't be available since r-markdown is a dependency of the r-knitr
    ;; package.
    (arguments `(#:tests? #f))
    (propagated-inputs
     (list r-litedown r-xfun))
    (home-page "https://github.com/rstudio/markdown")
    (synopsis "Markdown rendering for R")
    (description
     "This package provides R bindings to the Sundown Markdown rendering
library (https://github.com/vmg/sundown).  Markdown is a plain-text formatting
syntax that can be converted to XHTML or other formats.")
    (license license:gpl2)))

(define-public r-mass
  (package
    (name "r-mass")
    (version "7.3-65")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "MASS" version))
       (sha256
        (base32
         "0bqp73z8qmxv6ws2k4agamvci1wzricpg2jakck5dkk4qgiz2zmh"))))
    (properties `((upstream-name . "MASS")))
    (build-system r-build-system)
    (home-page "https://www.stats.ox.ac.uk/pub/MASS4/")
    (synopsis "Support functions and datasets for Venables and Ripley's MASS")
    (description
     "This package provides functions and datasets for the book \"Modern
Applied Statistics with S\" (4th edition, 2002) by Venables and Ripley.")
    ;; Either version may be picked.
    (license (list license:gpl2 license:gpl3))))

(define-public r-matrix
  (package
    (name "r-matrix")
    (version "1.7-3")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "Matrix" version))
       (sha256
        (base32
         "0kml1zq2vsbipwwx3hn54p4vvvgp9dimmzbj342jmwyxikdyjhk6"))))
    (properties
     `((upstream-name . "Matrix")
       ;; Needed for vignettes.
       (updater-extra-native-inputs . ("r-mass"))))
    (build-system r-build-system)
    (arguments
     (list
      #:phases
      (if (or (target-x86-32?) (target-arm32?))
          '(modify-phases %standard-phases
             (add-after 'unpack 'disable-bad-tests
               (lambda _
                 ;; Some of these tests fail on 32 bit architectures.
                 (delete-file "tests/matprod.R"))))
          '%standard-phases)))
    (propagated-inputs
     (list r-lattice))
    (native-inputs (list r-codetools r-mass r-sfsmisc r-sparsem))
    (home-page "https://Matrix.R-forge.R-project.org/")
    (synopsis "Sparse and dense matrix classes and methods")
    (description
     "This package provides classes and methods for dense and sparse matrices
and operations on them using LAPACK and SuiteSparse.")
    (license license:gpl2+)))

(define-public r-matrixmodels
  (package
    (name "r-matrixmodels")
    (version "0.5-4")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "MatrixModels" version))
       (sha256
        (base32
         "0g7k3kag492rbacnm6d11q6xxiy6h9j88ihfg5vylgsslghgjypm"))))
    (properties `((upstream-name . "MatrixModels")))
    (build-system r-build-system)
    (propagated-inputs (list r-matrix))
    (home-page "https://cran.r-project.org/web/packages/MatrixModels")
    (synopsis "Modelling with sparse and dense matrices")
    (description
     "This package models with sparse and dense matrix matrices,
using modular prediction and response module classes.")
    (license license:gpl2+)))

(define-public r-matrixstats
  (package
    (name "r-matrixstats")
    (version "1.5.0")
    (source (origin
              (method url-fetch)
              (uri (cran-uri "matrixStats" version))
              (sha256
               (base32
                "05fcbpwrrs3y5ia15x88x7br7ympf5mg31qh7sj05hkg7rgnr68j"))))
    (properties `((upstream-name . "matrixStats")))
    (build-system r-build-system)
    (arguments
     `(#:phases
       (modify-phases %standard-phases
         (add-after 'unpack 'set-HOME
           (lambda _ (setenv "HOME" "/tmp"))))))
    (native-inputs
     (list r-covr r-r-rsp)) ;used to build vignettes
    (home-page "https://github.com/HenrikBengtsson/matrixStats")
    (synopsis "Methods applying to vectors and matrix rows and columns")
    (description
     "This package provides methods operating on rows and columns of matrices,
e.g.  @code{rowMedians()}, @code{rowRanks()}, and @code{rowSds()}.  There are
also some vector-based methods, e.g. @code{binMeans()}, @code{madDiff()} and
@code{weightedMedians()}.  All methods have been optimized for speed and
memory usage.")
    (license license:artistic2.0)))

(define-public r-matrixtests
  (package
    (name "r-matrixtests")
    (version "0.2.3")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "matrixTests" version))
       (sha256
        (base32 "0d7i00cxzszfdnjm8q5b72ildic8nig6fbw7rba6acdnllpp7sza"))))
    (properties `((upstream-name . "matrixTests")))
    (build-system r-build-system)
    (propagated-inputs (list r-matrixstats))
    (native-inputs
     (list r-car r-cosinor r-cosinor2 r-moments r-nortest r-pmcmrplus))
    (home-page "https://github.com/karoliskoncevicius/matrixTests")
    (synopsis "Statistical hypothesis tests on rows and columns of matrices")
    (description
     "This package offers quick statistical hypothesis testing for matrix
rows/columns.  The main goals are speed through vectorization, detailed and
user-friendly output, and compatibility with tests implemented in R.")
    (license license:gpl2)))

(define-public r-matrix-utils
  (package
    (name "r-matrix-utils")
    (version "0.9.8")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "Matrix.utils" version))
       (sha256
        (base32
         "0a5fq1scykqk0kc9j051j6fix6j2dqwz5wbgb0amaxsiywz9vigb"))))
    (properties `((upstream-name . "Matrix.utils")))
    (build-system r-build-system)
    (propagated-inputs
     (list r-grr r-matrix))
    (native-inputs (list r-testthat))
    (home-page "https://github.com/cvarrichio/Matrix.utils")
    (synopsis
     "Data.frame-Like Operations on Sparse and Dense Matrix Objects")
    (description
     "This package implements data manipulation methods such as @code{cast},
@code{aggregate}, and @code{merge}/@code{join} for Matrix and Matrix-like
objects.")
    (license license:gpl3)))

(define-public r-mblm
  (package
    (name "r-mblm")
    (version "0.12.1")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "mblm" version))
       (sha256
        (base32 "1fipb3bryaimr30lcxsxrn0ymv24z39swca7s4z7p9xcfg3ban1b"))))
    (properties `((upstream-name . "mblm")))
    (build-system r-build-system)
    (home-page "https://cran.r-project.org/web/packages/mblm/index.html")
    (synopsis "Median-based linear models")
    (description
     "This package provides linear models based on Theil-Sen single median and
Siegel repeated medians.  They are very robust (29 or 50 percent breakdown
point, respectively), and if no outliers are present, the estimators are very
similar to OLS.")
    (license license:gpl2+)))

(define-public r-mboost
  (package
   (name "r-mboost")
   (version "2.9-11")
   (source (origin
            (method url-fetch)
            (uri (cran-uri "mboost" version))
            (sha256
             (base32
              "0n5wpyayhdyd46vl87c9r70m13y48khmlwii58rvi57mgw6aadwz"))))
   (build-system r-build-system)
   (propagated-inputs
    (list r-lattice
          r-matrix
          r-nnls
          r-partykit
          r-quadprog
          r-stabs
          r-survival))
   (native-inputs (list r-testthat))
   (home-page "https://github.com/boost-R/mboost")
   (synopsis "Model-based boosting")
   (description
    "This package provides a functional gradient descent algorithm (boosting)
for optimizing general risk functions utilizing component-wise (penalised)
least squares estimates or regression trees as base-learners for fitting
generalized linear, additive and interaction models to potentially
high-dimensional data.")
   (license license:gpl2)))

(define-public r-mc2d
  (package
    (name "r-mc2d")
    (version "0.2.1")
    (source (origin
              (method url-fetch)
              (uri (cran-uri "mc2d" version))
              (sha256
               (base32
                "06kva55vm2cldd95caw5hfx0xjadyhgkqi0y9pyz7hs3zg0zq9xy"))))
    (properties `((upstream-name . "mc2d")))
    (build-system r-build-system)
    (propagated-inputs (list r-ggplot2 r-ggpubr r-mvtnorm))
    (native-inputs (list r-testthat))
    (home-page "https://cran.r-project.org/package=mc2d")
    (synopsis "Tools for two-dimensional monte-carlo simulations")
    (description
     "This is a framework for construction and analysis of 2D Monte-Carlo
simulations.  In addition, this package includes various distributions.")
    (license license:gpl2+)))

(define-public r-mclogit
  (package
    (name "r-mclogit")
    (version "0.9.6")
    (source (origin
              (method url-fetch)
              (uri (cran-uri "mclogit" version))
              (sha256
               (base32
                "0sbglgak6jhhpx65jnj59hbpvzs8qjsdjc4w02z0m5j9hrnmzp4s"))))
    (properties `((upstream-name . "mclogit")))
    (build-system r-build-system)
    (propagated-inputs (list r-matrix r-memisc))
    (home-page "https://www.elff.eu/software/mclogit/")
    (synopsis
     "Multinomial logit models, with or without random effects or overdispersion")
    (description
     "This package provides estimators for multinomial logit models in their
conditional logit and baseline logit variants, with or without random effects,
with or without overdispersion.  Random effects models are estimated using the
PQL technique (based on a Laplace approximation) or the MQL technique (based
on a Solomon-Cox approximation).  Estimates should be treated with caution if
the group sizes are small.")
    (license license:gpl2)))

(define-public r-mclust
  (package
    (name "r-mclust")
    (version "6.1.1")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "mclust" version))
       (sha256
        (base32
         "0xb726ssy224mzfg37nq5hffkdwi2hwjp1y9gwngk9vfbs703myx"))))
    (build-system r-build-system)
    (native-inputs
     (list gfortran r-knitr))
    (home-page "https://www.stat.washington.edu/mclust/")
    (synopsis "Gaussian mixture modelling for model-based clustering etc.")
    (description
     "This package provides Gaussian finite mixture models fitted via EM
algorithm for model-based clustering, classification, and density estimation,
including Bayesian regularization, dimension reduction for visualisation, and
resampling-based inference.")
    (license license:gpl2+)))

(define-public r-mcmcglmm
  (package
    (name "r-mcmcglmm")
    (version "2.36")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "MCMCglmm" version))
       (sha256
        (base32 "1wca9x5c9x88cryj1pkhl73chmnbc1653j08faz7lp03z2mdkzv6"))))
    (properties `((upstream-name . "MCMCglmm")))
    (build-system r-build-system)
    (propagated-inputs (list r-ape
                             r-coda
                             r-corpcor
                             r-cubature
                             r-matrix
                             r-tensora))
    (home-page "https://github.com/jarrodhadfield/MCMCglmm")
    (synopsis "MCMC generalised linear mixed models")
    (description
     "This package fits multivariate generalized linear mixed models and
related models.  This is done using Markov chain Monte Carlo techniques.")
    (license license:gpl2+)))

(define-public r-mcr
  (package
    (name "r-mcr")
    (version "1.3.3.1")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "mcr" version))
       (sha256
        (base32 "0gbpnbs8mgqpyiayddcaf1xwh908gk1n375bqpnvfppyj0wz3yr9"))))
    (properties `((upstream-name . "mcr")))
    (build-system r-build-system)
    (propagated-inputs (list r-robslopes))
    (native-inputs (list gfortran))
    (home-page "https://cran.r-project.org/package=mcr")
    (synopsis "Method comparison regression")
    (description
     "Regression methods to quantify the relation between two measurement
methods are provided by this package.  In particular it addresses regression
problems with errors in both variables and without repeated measurements.  It
implements the CLSI recommendations (see J. A. Budd et al. (2018,
@url{https://clsi.org/standards/products/method-evaluation/documents/ep09/})
for analytical method comparison and bias estimation using patient samples.
Furthermore, algorithms for Theil-Sen and equivariant Passing-Bablok
estimators are implemented, see F. Dufey (2020, <doi:10.1515/ijb-2019-0157>)
and J. Raymaekers and F. Dufey (2022, <@code{arXiv:2202:08060>}).  A
comprehensive overview over the implemented methods and references can be
found in the manual pages @code{mcr-package} and @code{mcreg}.")
    (license license:gpl3+)))

(define-public r-memoise
  (package
    (name "r-memoise")
    (version "2.0.1")
    (source (origin
              (method url-fetch)
              (uri (cran-uri "memoise" version))
              (sha256
               (base32
                "1srdzv2bp0splislrabmf1sfbqfi3hn189nq7kxhgjn8k3p38l7q"))))
    (build-system r-build-system)
    (propagated-inputs
     (list r-cachem r-rlang))
    (native-inputs (list r-testthat))
    (home-page "https://github.com/hadley/memoise")
    (synopsis "Memoise functions for R")
    (description
     "This R package caches the results of a function so that when
you call it again with the same arguments it returns the pre-computed value.")
    (license license:expat)))

(define-public r-mgcv
  (package
    (name "r-mgcv")
    (version "1.9-3")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "mgcv" version))
       (sha256
        (base32 "079gv1gm8gvsmpkccr3hr6y1ybi2b440m6mygcfhm2bnl7dwrw23"))))
    (build-system r-build-system)
    (propagated-inputs
     (list r-matrix r-nlme))
    (home-page "https://cran.r-project.org/web/packages/mgcv")
    (synopsis "Mixed generalised additive model computation")
    (description
     "GAMs, GAMMs and other generalized ridge regression with multiple smoothing
parameter estimation by GCV, REML or UBRE/AIC.  The library includes a
@code{gam()} function, a wide variety of smoothers, JAGS support and
distributions beyond the exponential family.")
    (license license:gpl2+)))

(define-public r-microbenchmark
  (package
    (name "r-microbenchmark")
    (version "1.5.0")
    (source (origin
              (method url-fetch)
              (uri (cran-uri "microbenchmark" version))
              (sha256
               (base32
                "0pvn94zfv50imz5g39wyqbqaa7fkl0h5sy98ic9as4b842lr47ix"))))
    (build-system r-build-system)
    (native-inputs (list r-runit))
    (home-page "https://cran.r-project.org/web/packages/microbenchmark/")
    (synopsis "Accurate timing functions for R")
    (description
     "This package provides infrastructure to accurately measure and compare
the execution time of R expressions.")
    (license license:bsd-2)))

(define-public r-mime
  (package
    (name "r-mime")
    (version "0.13")
    (source (origin
              (method url-fetch)
              (uri (cran-uri "mime" version))
              (sha256
               (base32
                "1szkqzily5sr1qlnrlrprid2gy5wkzb7dlxs2bzqwf63yd686cki"))))
    (build-system r-build-system)
    (home-page "https://github.com/yihui/mime")
    (synopsis "R package to map filenames to MIME types")
    (description
     "This package guesses the MIME type from a filename extension using the
data derived from /etc/mime.types in UNIX-type systems.")
    (license license:gpl2)))

(define-public r-minqa
  (package
    (name "r-minqa")
    (version "1.2.8")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "minqa" version))
       (sha256
        (base32
         "0rslvg4imaijzb5z6vzsx4zqhrna1jk6qkp2kxnzqy0rn2wy8har"))))
    (build-system r-build-system)
    (propagated-inputs (list r-rcpp))
    (native-inputs (list gfortran))
    (home-page "https://optimizer.r-forge.r-project.org")
    (synopsis "Derivative-free optimization algorithms by quadratic approximation")
    (description
     "This package provides a derivative-free optimization by quadratic
approximation based on an interface to Fortran implementations by
M. J. D. Powell.")
    (license license:gpl2)))

(define-public r-mirai
  (package
    (name "r-mirai")
    (version "2.3.0")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "mirai" version))
       (sha256
        (base32 "0cczacjlwrr5m2drpa62sp9bixw39qbjp5n1cihkfj1jj9jal5wz"))))
    (properties `((upstream-name . "mirai")))
    (build-system r-build-system)
    (propagated-inputs (list r-nanonext))
    (native-inputs (list r-litedown r-promises))
    (home-page "https://shikokuchuo.net/mirai/")
    (synopsis "Minimalist async evaluation framework for R")
    (description
     "Designed for simplicity, a mirai evaluates an R expression
asynchronously in a parallel process, locally or distributed over the network.
The result is automatically available upon completion.  Modern networking and
concurrency, built on nanonext and NNG (Nanomsg Next Gen), ensures reliable
and efficient scheduling over fast inter-process communications or TCP/IP
secured by TLS.  Distributed computing can launch remote resources via SSH or
cluster managers.  An inherently queued architecture handles many more tasks
than available processes, and requires no storage on the file system.
Innovative features include support for otherwise non-exportable reference
objects, event-driven promises, and asynchronous parallel map.")
    (license license:gpl3+)))

(define-public r-mixtools
  (package
    (name "r-mixtools")
    (version "2.0.0.1")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "mixtools" version))
       (sha256
        (base32
         "1hcpijmddibhfxhq6d8lgi7m1x6ylf97y9ns0l8li3a1bvc438ws"))))
    (build-system r-build-system)
    (propagated-inputs
     (list r-kernlab
           r-mass
           r-plotly
           r-scales
           r-segmented
           r-survival))
    (home-page "https://cran.r-project.org/web/packages/mixtools")
    (synopsis "Tools for analyzing finite mixture models")
    (description
     "This package provides a collection of R functions for analyzing finite
mixture models.")
    (license license:gpl2+)))

(define-public r-mnormt
  (package
    (name "r-mnormt")
    (version "2.1.1")
    (source
     (origin
       (method url-fetch)
        (uri (cran-uri "mnormt" version))
        (sha256
          (base32
           "020ka48jsxm9l109ksvy2l17xcpm51avm0l971dgs2mgg01sgz4m"))))
    (build-system r-build-system)
    (native-inputs
     (list gfortran))
    (home-page "http://azzalini.stat.unipd.it/SW/Pkg-mnormt")
    (synopsis "Multivariate normal and \"t\" distributions")
    (description
     "This package provides functions for computing the density and the
distribution function of multivariate normal and \"t\" random variables, and
for generating random vectors sampled from these distributions.  Probabilities
are computed via non-Monte Carlo methods.")
    (license license:gpl2+)))

(define-public r-modelmetrics
  (package
    (name "r-modelmetrics")
    (version "1.2.2.2")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "ModelMetrics" version))
       (sha256
        (base32
         "0mrlsw4c5y1vdsqynxr2dcvmhh5h37pnd71jw5a5djpbda9g21jy"))))
    (properties `((upstream-name . "ModelMetrics")))
    (build-system r-build-system)
    (propagated-inputs
     (list r-data-table r-rcpp))
    (native-inputs (list r-testthat))
    (home-page "https://cran.r-project.org/web/packages/ModelMetrics")
    (synopsis "Rapid calculation of model metrics")
    (description
     "Written in C++ using @code{Rcpp}, this package provides a collection of
metrics for evaluating models.")
    (license license:gpl2+)))

(define-public r-modeltools
  (package
    (name "r-modeltools")
    (version "0.2-24")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "modeltools" version))
       (sha256
        (base32
         "1bqyrslar36ja8gjdj3y5b82vqc2y5kbyw3vqgr2cmakgj4qbcpq"))))
    (build-system r-build-system)
    (home-page "https://cran.r-project.org/web/packages/modeltools")
    (synopsis "Tools and classes for statistical models")
    (description
     "This package provides a collection of tools to deal with statistical
models.  The functionality is experimental and the user interface is likely to
change in the future.")
    (license license:gpl2)))

(define-public r-multilevel
  (package
    (name "r-multilevel")
    (version "2.7")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "multilevel" version))
       (sha256
        (base32 "0ds7q3q2ncldb4iik24xisyxyyv1yv8l1yz7zd7cy036bna1yp5i"))))
    (properties `((upstream-name . "multilevel")))
    (build-system r-build-system)
    (propagated-inputs (list r-mass r-nlme))
    (home-page "https://www.r-project.org")
    (synopsis "Multilevel functions")
    (description
     "This package provides tools used by organizational researchers for the
analysis of multilevel data.  It includes four broad sets of tools.

@enumerate
@item functions for estimating within-group agreement and reliability indices.
@item functions for manipulating multilevel and longitudinal (panel) data.
@item simulations for estimating power and generating multilevel data.
@item miscellaneous functions for estimating reliability and performing simple
  calculations and data transformations.
@end enumerate")
    (license license:gpl2+)))

(define-public r-multitaper
  (package
    (name "r-multitaper")
    (version "1.0-17")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "multitaper" version))
       (sha256
        (base32
         "1wqa2whcjxwjqg9z46i48dvrga17fdj63r05kg993r1fpriclc1l"))))
    (build-system r-build-system)
    (native-inputs (list gfortran))
    (home-page "https://github.com/wesleyburr/multitaper/")
    (synopsis "Multitaper spectral analysis tools")
    (description
     "This package implements multitaper spectral estimation techniques using
prolate spheroidal sequences (Slepians) and sine tapers for time series
analysis.  It includes an adaptive weighted multitaper spectral estimate, a
coherence estimate, Thomson's Harmonic F-test, and complex demodulation.  The
Slepians sequences are generated efficiently using a tridiagonal matrix
solution, and jackknifed confidence intervals are available for most
estimates.")
    (license license:gpl2+)))

(define-public r-mumin
  (package
    (name "r-mumin")
    (version "1.48.11")
    (source (origin
              (method url-fetch)
              (uri (cran-uri "MuMIn" version))
              (sha256
               (base32
                "1rzsngmnyfscr42rkb9cm85s3xisgjrax2swcab7qzzkjh355wy1"))))
    (properties `((upstream-name . "MuMIn")))
    (build-system r-build-system)
    (propagated-inputs (list r-insight r-matrix r-nlme))
    (native-inputs (list r-mgcv r-survival))
    (home-page "https://cran.r-project.org/package=MuMIn")
    (synopsis "Multi-model inference")
    (description
     "Tools for performing model selection and model averaging.  Automated
model selection through subsetting the maximum model, with optional
constraints for model inclusion.  Model parameter and prediction averaging
based on model weights derived from information criteria (AICc and alike) or
custom model weighting schemes.")
    (license license:gpl2)))

(define-public r-munsell
  (package
    (name "r-munsell")
    (version "0.5.1")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "munsell" version))
       (sha256
        (base32 "19i9jjawlqciw4n4h99a4sm0lbc77la3pqyzjvnwsrh7qjdgv8h3"))))
    (build-system r-build-system)
    (propagated-inputs
     (list r-colorspace))
    (native-inputs (list r-testthat))
    (home-page "https://cran.r-project.org/web/packages/munsell")
    (synopsis "Munsell colour system")
    (description
     "The Munsell package contains functions for exploring and using the
Munsell colour system.")
    (license license:expat)))

(define-public r-mvtnorm
  (package
    (name "r-mvtnorm")
    (version "1.3-3")
    (source (origin
              (method url-fetch)
              (uri (cran-uri "mvtnorm" version))
              (sha256
               (base32
                "0wa1zal0q8zawqrjllx70kakn3ynpsm0imb3mmc956y89d9py3p2"))))
    (build-system r-build-system)
    ;; Do not build vignettes because there are weave errors in lmvnorm_src.R.
    (arguments (list #:test-types '(list "tests")))
    (native-inputs
     (list gfortran r-numderiv))
    (home-page "https://mvtnorm.R-forge.R-project.org")
    (synopsis "Package for multivariate normal and t-distributions")
    (description "This package can compute multivariate normal and
t-probabilities, quantiles, random deviates and densities.")
    (license license:gpl2)))

(define-public r-shadowtext
  (package
    (name "r-shadowtext")
    (version "0.1.4")
    (source (origin
              (method url-fetch)
              (uri (cran-uri "shadowtext" version))
              (sha256
               (base32
                "1s3fsh6cmblyhlqrswialc9437as306ki36dyx0dv4001slvxl47"))))
    (properties `((upstream-name . "shadowtext")))
    (build-system r-build-system)
    (propagated-inputs
     (list r-ggplot2 r-scales))
    (native-inputs
     (list r-knitr))
    (home-page "https://github.com/GuangchuangYu/shadowtext/")
    (synopsis "Shadow text grob and layer")
    (description "This package implements @code{shadowtextGrob()} for
@code{grid} and @code{geom_shadowtext()} layer for @code{ggplot2}.
These functions draw text grob with background shadow.")
    (license license:artistic2.0)))

(define-public r-sys
  (package
    (name "r-sys")
    (version "3.4.3")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "sys" version))
       (sha256
        (base32
         "0flihfpfawismsy5piddf2flz1i1fw35k47gxwkbhk87wcr767h5"))))
    (build-system r-build-system)
    (native-inputs (list r-testthat))
    (home-page "https://github.com/jeroen/sys")
    (synopsis "Powerful and reliable tools for running system commands in R")
    (description
     "This package provides drop-in replacements for the base @code{system2()}
function with fine control and consistent behavior across platforms.  It
supports clean interruption, timeout, background tasks, and streaming STDIN /
STDOUT / STDERR over binary or text connections.  The package also provides
functions for evaluating expressions inside a temporary fork.  Such
evaluations have no side effects on the main R process, and support reliable
interrupts and timeouts.  This provides the basis for a sandboxing
mechanism.")
    (license license:expat)))

(define-public r-ashr
  (package
   (name "r-ashr")
   (version "2.2-63")
   (source (origin
            (method url-fetch)
            (uri (cran-uri "ashr" version))
            (sha256
             (base32
              "1japskxfdsg91jwgf5knlwy9iaq4ziqvyvlvjch1y3ygsdz9b8bz"))))
   (properties `((upstream-name . "ashr")))
   (build-system r-build-system)
   (propagated-inputs
    (list r-etrunct
          r-invgamma
          r-matrix
          r-mixsqp
          r-rcpp
          r-squarem
          r-truncnorm))
   (native-inputs
    (list r-knitr r-testthat))
   (home-page "https://github.com/stephens999/ashr")
   (synopsis "Methods for adaptive shrinkage, using empirical bayes")
   (description "This package implements an empirical Bayes approach for
large-scale hypothesis testing and false discovery rate estimation.")
   (license license:gpl3+)))

(define-public r-askpass
  (package
    (name "r-askpass")
    (version "1.2.1")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "askpass" version))
       (sha256
        (base32
         "1pf7q2p0caxnb22zvg6yj250b817drldk5d7rvr4i9s49jkhc8bc"))))
    (build-system r-build-system)
    (propagated-inputs (list r-sys))
    (native-inputs (list r-testthat))
    (home-page "https://github.com/jeroen/askpass")
    (synopsis "Safe password entry for R")
    (description
     "This package provides cross-platform utilities for prompting the user
for credentials or a passphrase, for example to authenticate with a server or
read a protected key.")
    (license license:expat)))

(define-public r-astsa
  (package
    (name "r-astsa")
    (version "2.2")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "astsa" version))
       (sha256
        (base32 "1ds94p5wiyl5jl4b8c9b2zdz9m37px5bnx3ln4288fgh8av2rscz"))))
    (properties `((upstream-name . "astsa")))
    (build-system r-build-system)
    (home-page "https://github.com/nickpoison/astsa/")
    (synopsis "Applied statistical time series analysis")
    (description
     "This package provides data sets and scripts to accompany Time Series
Analysis and Its Applications: With R Examples (4th ed), by R.H. Shumway and
D.S. Stoffer.  Springer Texts in Statistics, 2017,
@url{https://doi.org/10.1007/978-3-319-52452-8}, and Time Series: A Data
Analysis Approach Using R.  Chapman-Hall, 2019,
@url{https://doi.org/10.1201/9780429273285}.")
    (license license:gpl3)))

(define-public r-vegan
  (package
    (name "r-vegan")
    (version "2.6-10")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "vegan" version))
       (sha256
        (base32
         "1dxwqzsmbx129lpykjb4gqvxp79qy1j41w99xdmjxs5ph42bkd5g"))))
    (build-system r-build-system)
    (native-inputs
     (list gfortran r-compositions r-knitr))
    (propagated-inputs
     (list r-cluster r-lattice r-mass r-mgcv r-permute))
    (home-page "https://cran.r-project.org/web/packages/vegan")
    (synopsis "Functions for community ecology")
    (description
     "The vegan package provides tools for descriptive community ecology.  It
has most basic functions of diversity analysis, community ordination and
dissimilarity analysis.  Most of its multivariate tools can be used for other
data types as well.")
    (license license:gpl2+)))

(define-public r-tglkmeans
  (package
    (name "r-tglkmeans")
    (version "0.5.5")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "tglkmeans" version))
       (sha256
        (base32 "0hdnxgkxpgb8jm9aygv3wlhd42blm5nz906vlpl72blgcyc77hhh"))))
    (properties `((upstream-name . "tglkmeans")))
    (build-system r-build-system)
    (propagated-inputs (list r-cli
                             r-dofuture
                             r-dorng
                             r-dplyr
                             r-future
                             r-ggplot2
                             r-magrittr
                             r-matrix
                             r-plyr
                             r-purrr
                             r-rcpp
                             r-rcppparallel
                             r-tgstat
                             r-tibble))
    (native-inputs (list r-knitr r-testthat))
    (home-page "https://tanaylab.github.io/tglkmeans/")
    (synopsis "Efficient implementation of K-Means++ algorithm")
    (description
     "This package provides an efficient implementation of the K-Means++
algorithm.  For more information see (1) \"kmeans++ the advantages of the
k-means++ algorithm\" by David Arthur and Sergei Vassilvitskii (2007),
Proceedings of the eighteenth annual ACM-SIAM symposium on Discrete
algorithms, Society for Industrial and Applied Mathematics, Philadelphia, PA,
USA, pp. 1027-1035, and (2) \"The Effectiveness of Lloyd-Type Methods for the
k-Means Problem\" by Rafail Ostrovsky, Yuval Rabani, Leonard J. Schulman and
Chaitanya Swamy <doi:10.1145/2395116.2395117>.")
    (license license:expat)))

(define-public r-tgp
  (package
    (name "r-tgp")
    (version "2.4-23")
    (source (origin
              (method url-fetch)
              (uri (cran-uri "tgp" version))
              (sha256
               (base32
                "074d2c88ydgmggz24hqkxb8sqvbcgf5d32dhcxwa79snv8br5aqd"))))
    (properties `((upstream-name . "tgp")))
    (build-system r-build-system)
    (propagated-inputs (list r-maptree))
    (home-page "https://bobby.gramacy.com/r_packages/tgp/")
    (synopsis "Bayesian treed Gaussian process models")
    (description
     "R-tgb provides Bayesian nonstationary regression and treed Gaussian
processes.  In addition, it provides visualization functions, tree drawing,
sensitivity analysis, multi-resolution models, and sequential experimental
design tools, including ALM, ALC, and expected improvement for optimizing
noisy black-box functions.")
    (license license:lgpl2.0+)))

(define-public r-tgstat
  (package
    (name "r-tgstat")
    (version "2.3.28")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "tgstat" version))
       (sha256
        (base32 "0gn7xpbl7y86n19y8jvw00m03p3aff78yv2g62yp96bi7qygaq2a"))))
    (properties `((upstream-name . "tgstat")))
    (build-system r-build-system)
    (native-inputs (list r-knitr r-testthat))
    (home-page "https://cran.r-project.org/package=tgstat")
    (synopsis "Amos Tanay's Group High Performance Statistical Utilities")
    (description
     "This package provides a collection of high-performance utilities.
It can be used to compute distances, correlations, autocorrelations,
clustering, and other tasks.  It also contains a graph clustering
algorithm described in MetaCell analysis of single-cell RNA-seq
data using K-nn graph partitions.")
    (license license:gpl2)))

(define-public r-tictoc
  (package
    (name "r-tictoc")
    (version "1.2.1")
    (source (origin
              (method url-fetch)
              (uri (cran-uri "tictoc" version))
              (sha256
               (base32
                "0cw8r1gn4p2v1l3d80brk9sfr9nyckyyym5nr9xq3d74l74vgkcg"))))
    (properties `((upstream-name . "tictoc")))
    (build-system r-build-system)
    (native-inputs (list r-testthat))
    (home-page "https://github.com/jabiru/tictoc")
    (synopsis
     "Time R scripts and implementations of stack and list structures")
    (description
     "The tictoc package provides the timing functions @code{tic} and
@code{toc} that can be nested.  It provides an alternative to
@code{system.time()} with a different syntax similar to that in another
well-known software package.  @code{tic} and @code{toc} are easy to use, and
are especially useful when timing several sections in more than a few lines of
code.")
    (license license:asl2.0)))

(define-public r-tidyclust
  (package
    (name "r-tidyclust")
    (version "0.2.4")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "tidyclust" version))
       (sha256
        (base32 "09z4p01l76wyc1dzkz1ggvbwcdih1c515amwm54mx5rvpmvmdw64"))))
    (properties
     '((upstream-name . "tidyclust")
       (updater-extra-native-inputs
        . ("r-cluster" "r-clustmixtype" "r-rcpphungarian"))))
    (build-system r-build-system)
    (propagated-inputs (list r-cli
                             r-dials
                             r-dplyr
                             r-flexclust
                             r-foreach
                             r-generics
                             r-glue
                             r-hardhat
                             r-modelenv
                             r-parsnip
                             r-philentropy
                             r-prettyunits
                             r-rlang
                             r-rsample
                             r-tibble
                             r-tidyr
                             r-tune
                             r-vctrs))
    (native-inputs
     (list r-cluster r-clusterr r-clustmixtype r-rcpphungarian
           r-recipes r-testthat r-workflows))
    (home-page "https://github.com/tidymodels/tidyclust")
    (synopsis "Common API to clustering")
    (description
     "This package provides a common interface to specifying clustering
models, in the same style as parsnip.  It creates a unified interface across
different functions and computational engines.")
    (license license:expat)))

(define-public r-tidyft
  (package
    (name "r-tidyft")
    (version "0.9.20")
    (source (origin
              (method url-fetch)
              (uri (cran-uri "tidyft" version))
              (sha256
               (base32
                "144w36q4yrscdvv3jq7h6s6pklm3l4m5rv005hr1akvn9d7klcq9"))))
    (properties `((upstream-name . "tidyft")))
    (build-system r-build-system)
    (propagated-inputs (list r-data-table r-fst r-stringr))
    (native-inputs (list r-knitr))
    (home-page "https://github.com/hope-data-science/tidyft")
    (synopsis "Fast and memory efficient data operations in tidy syntax")
    (description "Tidyft is an extension of @code{data.table}.  It uses
modifification by reference whenever possible.  This toolkit is designed for
big data analysis in high-performance desktop or laptop computers.  The syntax
of the package is similar or identical to tidyverse.")
    (license license:expat)))

(define-public r-tidyverse
  (package
    (name "r-tidyverse")
    (version "2.0.0")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "tidyverse" version))
       (sha256
        (base32
         "1r980y6d4a5brvxwdx41qzi8f3fck36c5l89sd3k4csna09jsg1x"))))
    (properties
     '((updater-extra-native-inputs . ("r-mockr"))))
    (build-system r-build-system)
    (propagated-inputs
     (list r-broom
           r-cli
           r-conflicted
           r-dbplyr
           r-dplyr
           r-dtplyr
           r-forcats
           r-ggplot2
           r-googledrive
           r-googlesheets4
           r-haven
           r-hms
           r-httr
           r-jsonlite
           r-lubridate
           r-magrittr
           r-modelr
           r-pillar
           r-purrr
           r-ragg
           r-readr
           r-readxl
           r-reprex
           r-rlang
           r-rstudioapi
           r-rvest
           r-stringr
           r-tibble
           r-tidyr
           r-xml2))
    (native-inputs
     (list r-knitr r-mockr r-testthat))
    (home-page "https://tidyverse.tidyverse.org")
    (synopsis "Install and load packages from the \"Tidyverse\"")
    (description
     "The @code{tidyverse} is a set of packages that work in harmony because
they share common data representations and API design.  This package is
designed to make it easy to install and load multiple tidyverse packages in a
single step.")
    (license license:gpl3)))

(define-public r-tis
  (package
    (name "r-tis")
    (version "1.39")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "tis" version))
       (sha256
        (base32 "1sq3acz8mybsbxng5fga4ynqvh1ly9hs3ca727jiyx1gam712mis"))))
    (properties `((upstream-name . "tis")))
    (build-system r-build-system)
    (home-page "https://cran.r-project.org/package=tis")
    (synopsis "Time indexes and time indexed series")
    (description
     "This package provides functions and S3 classes for time indexes and time
indexed series, which are compatible with FAME frequencies.")
    ;; Unlimited distribution
    (license (license:non-copyleft "file://DESCRIPTION"))))

(define-public r-tkrplot
  (package
    (name "r-tkrplot")
    (version "0.0-30")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "tkrplot" version))
       (sha256
        (base32 "1qfb5jiajlfa6y5hr4qwmv11fh3w0pfwdm3mrv9gw0j13xx9jv6c"))))
    (properties
     '((upstream-name . "tkrplot")
       (updater-extra-inputs . ("libx11"))))
    (build-system r-build-system)
    (inputs (list libx11))
    (home-page "https://cran.r-project.org/package=tkrplot")
    (synopsis "Place R graphics in a Tk widget")
    (description
     "The tkrplot package lets you place R graphics in a @dfn{Tk,
cross-platform graphical user interface toolkit} widget.")
    ;; Any version of the GPL.
    (license (list license:gpl2+ license:gpl3+))))

(define-public r-tmvtnorm
  (package
    (name "r-tmvtnorm")
    (version "1.6")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "tmvtnorm" version))
       (sha256
        (base32 "1fhvisddn3x4li2q12c3hss0cj735c0iq32c9cw646ni619jr6rd"))))
    (properties `((upstream-name . "tmvtnorm")))
    (build-system r-build-system)
    (propagated-inputs (list r-gmm r-matrix r-mvtnorm))
    (native-inputs (list gfortran))
    (home-page "https://www.r-project.org")
    (synopsis "Truncated multivariate normal and Student t distribution")
    (description
     "This is a package for random number generation for the truncated
multivariate normal and Student t distribution.  It computes probabilities,
quantiles and densities, including one-dimensional and bivariate marginal
densities.  It computes first and second moments (i.e. mean and covariance
matrix) for the double-truncated multinormal case.")
    (license license:gpl2+)))

(define-public r-rvest
  (package
    (name "r-rvest")
    (version "1.0.4")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "rvest" version))
       (sha256
        (base32 "19lw0jk8d8x88z247hz761gwbx9f5n3yqnv63mn7pkwl55mpqw3x"))))
    (build-system r-build-system)
    (arguments
     (list
      #:phases
      '(modify-phases %standard-phases
         (add-after 'unpack 'disable-bad-tests
           (lambda _
             ;; These tests require Internet access.
             (delete-file "tests/testthat/test-session.R")
             ;; This fails with "Error: object 's' not found" because a
             ;; session could not be created.
             (delete-file "tests/testthat/test-rename.R"))))))
    (propagated-inputs
     (list r-cli
           r-glue
           r-httr
           r-lifecycle
           r-magrittr
           r-rlang
           r-selectr
           r-tibble
           r-xml2))
    (native-inputs
     (list r-knitr r-testthat))
    (home-page "https://github.com/hadley/rvest")
    (synopsis "Simple web scraping for R")
    (description
     "@code{r-rvest} helps you scrape information from web pages.  It is
designed to work with @code{magrittr} to make it easy to express common web
scraping tasks, inspired by libraries like @code{BeautifulSoup}.")
    (license license:gpl3)))

(define-public r-secretbase
  (package
    (name "r-secretbase")
    (version "1.0.5")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "secretbase" version))
       (sha256
        (base32 "14dhdda0skxhj3ismlwc87c0gwvqswhgvp061nsi4ajfgk0593as"))))
    (properties `((upstream-name . "secretbase")))
    (build-system r-build-system)
    (arguments
     (list
      #:phases
      '(modify-phases %standard-phases
         ;; Needed by tests
         (add-after 'unpack 'set-HOME
           (lambda _ (setenv "HOME" "/tmp"))))))
    (home-page "https://shikokuchuo.net/secretbase/")
    (synopsis "Cryptographic Hash and Extendable-Output Functions")
    (description
     "This package provides implementations of the SHA-3 cryptographic hash
and SHAKE256 extendable-output functions (XOF).")
    (license license:gpl3+)))

(define-public r-selectr
  (package
    (name "r-selectr")
    (version "0.4-2")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "selectr" version))
       (sha256
        (base32 "09y1n3iy297g49xlpl7xrjpwgnm57pskx5991lyfcpizbz8ax22m"))))
    (properties
     '((updater-extra-native-inputs . ("r-xml" "r-xml2"))))
    (build-system r-build-system)
    (propagated-inputs
     (list r-r6 r-stringr))
    (native-inputs (list r-testthat r-xml r-xml2))
    (home-page "https://sjp.co.nz/projects/selectr/")
    (synopsis "Translate CSS selectors to XPath expressions")
    (description
     "@code{r-selectr} translates a CSS3 selector into an equivalent XPath
expression.  This allows you to use CSS selectors when working with the XML
package as it can only evaluate XPath expressions.  Also provided are
convenience functions useful for using CSS selectors on XML nodes.  This
package is a port of the Python package @code{cssselect}.")
    (license license:bsd-3)))

(define-public r-redland
  (package
    (name "r-redland")
    (version "1.0.17-18")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "redland" version))
       (sha256
        (base32 "183m1bvgj52w74383b5v6rfm7gn4izijixans1zdycqp68ibm6g9"))))
    (properties `((upstream-name . "redland")))
    (build-system r-build-system)
    (inputs (list redland pcre2 zlib))
    (propagated-inputs (list r-roxygen2))
    (native-inputs (list r-knitr pkg-config r-spelling r-stringi r-testthat))
    (home-page "https://cran.r-project.org/package=redland")
    (synopsis "RDF library bindings in R")
    (description
     "This package provides methods to parse, query and serialize information
stored in the @dfn{Resource Description Framework} (RDF).  This package
supports RDF by implementing an R interface to the Redland RDF C library.  In
brief, RDF provides a structured graph consisting of Statements composed of
Subject, Predicate, and Object Nodes.")
    (license license:asl2.0)))

(define-public r-redux
  (package
    (name "r-redux")
    (version "1.1.4")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "redux" version))
       (sha256
        (base32 "1cbgc39avvjx1lqfrrwyq6fjm751i10gxhsfx67njg8ghj4pq790"))))
    (properties `((upstream-name . "redux")))
    (build-system r-build-system)
    (inputs (list hiredis))
    (propagated-inputs (list r-r6 r-storr))
    (native-inputs (list r-knitr pkg-config r-sys r-testthat))
    (home-page "https://github.com/richfitz/redux")
    (synopsis "R bindings to hiredis")
    (description
     "This package provides a @code{hiredis} wrapper that includes support for
transactions, pipelining, blocking subscription, serialisation of all keys and
values, Redis error handling with R errors.  It includes an automatically
generated R6 interface to the full @code{hiredis} API.  Generated functions
are faithful to the @code{hiredis} documentation while attempting to match R's
argument semantics.  Serialization must be explicitly done by the user, but
both binary and text-mode serialisation is supported.")
    (license license:gpl2)))

(define-public r-relations
  (package
    (name "r-relations")
    (version "0.6-15")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "relations" version))
       (sha256
        (base32 "1qm1z4cv1m7hvq4icvdyb8n026jr1550ibazpbmqwp5qk7mf73qp"))))
    (properties `((upstream-name . "relations")))
    (build-system r-build-system)
    (propagated-inputs (list r-cluster r-sets r-slam))
    (home-page "https://cran.r-project.org/package=relations")
    (synopsis "Data structures and algorithms for relations")
    (description
     "This package provides data structures and algorithms for k-ary relations
with arbitrary domains, featuring relational algebra, predicate functions, and
fitters for consensus relations.")
    (license license:gpl2)))

(define-public r-repmis
  (package
    (name "r-repmis")
    (version "0.5")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "repmis" version))
       (sha256
        (base32 "0z5mjbsl24yjbl0aawr35grcal44rf2xbwv1hy7bdkms94ix79b5"))))
    (properties `((upstream-name . "repmis")))
    (build-system r-build-system)
    (arguments
     (list
      #:phases
      '(modify-phases %standard-phases
         (add-before 'install 'change-home-dir
           (lambda _
             ;; Change from /homeless-shelter to /tmp for write permission.
             (setenv "HOME" "/tmp"))))))
    (propagated-inputs
     (list r-data-table
           r-digest
           r-httr
           r-plyr
           r-r-cache))
    (home-page "https://cran.r-project.org/package=repmis")
    (synopsis "Miscellaneous tools for reproducible research")
    (description
     "This package is a collection of tools to load R packages and
automatically generate BibTeX files citing them as well as load and cache
plain-text and Excel formatted data stored on GitHub, and from other
sources.")
    (license license:gpl3+)))

(define-public r-reprex
  (package
    (name "r-reprex")
    (version "2.1.1")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "reprex" version))
       (sha256
        (base32
         "174705043b90phm6aj5yb199pn1clipsnqgvhskhxybypj63cq68"))))
    (build-system r-build-system)
    (propagated-inputs
     (list r-callr
           r-cli
           r-clipr
           r-fs
           r-glue
           r-knitr
           r-lifecycle
           r-rlang
           r-rmarkdown
           r-rstudioapi
           r-withr))
    (native-inputs
     (list r-knitr r-testthat))
    (home-page "https://github.com/tidyverse/reprex")
    (synopsis "Prepare reproducible R code examples for sharing")
    (description
     "This package provides a convenience wrapper that uses the
@code{rmarkdown} package to render small snippets of code to target formats
that include both code and output.  The goal is to encourage the sharing of
small, reproducible, and runnable examples on code-oriented websites or email.
@code{reprex} also extracts clean, runnable R code from various common formats,
such as copy/paste from an R session.")
    (license license:expat)))

(define-public r-reordercluster
  (package
   (name "r-reordercluster")
   (version "2.0")
   (source (origin
            (method url-fetch)
            (uri (cran-uri "ReorderCluster" version))
            (sha256
             (base32
              "0zq143xvv2br7016f9b1501ymcpkjqm3al1dn5qfm21axyi2p1iq"))))
   (build-system r-build-system)
   (propagated-inputs
    (list r-gplots r-gtools r-rcpp))
   (home-page "https://cran.r-project.org/web/packages/ReorderCluster")
   (synopsis "Reordering the dendrogram according to the class labels")
   (description "This package provides tools for performing the leaf reordering
for the dendrogram that preserves the hierarchical clustering result and at the
same time tries to group instances from the same class together.")
   (license license:gpl3+)))

(define-public r-caliberrfimpute
  (package
    (name "r-caliberrfimpute")
    (version "1.0-7")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "CALIBERrfimpute" version))
       (sha256
        (base32 "1fspn6wgr0kc7j4ixx24c706kzrgjhi1b1w28izpfxm4r89zk08s"))))
    (properties `((upstream-name . "CALIBERrfimpute")))
    (build-system r-build-system)
    (propagated-inputs (list r-mice r-mvtnorm r-randomforest))
    (home-page "https://cran.r-project.org/package=CALIBERrfimpute")
    (synopsis "Multiple imputation using MICE and random forest")
    (description
     "This package provides functions to impute using random forest.
It operates under full conditional specifications (multivariate
imputation by chained equations).")
    (license license:gpl3)))

(define-public r-callr
  (package
    (name "r-callr")
    (version "3.7.6")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "callr" version))
       (sha256
        (base32
         "1y2ildc0ni01lkcircbr648f5knq6ch6smh5xap2xr39x1ky7g74"))))
    (properties
     ;; Avoid dependency cycle.
     '((updater-ignored-native-inputs . ("r-testthat"))))
    (build-system r-build-system)
    (arguments (list #:tests? #false))
    (propagated-inputs
     (list r-processx r-r6))
    (home-page "https://github.com/r-lib/callr#readme")
    (synopsis "Call R from R")
    (description
     "It is sometimes useful to perform a computation in a separate R process,
without affecting the current R process at all.  This package does exactly
that.")
    (license license:expat)))

(define-public r-deming
  (package
    (name "r-deming")
    (version "1.4-1")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "deming" version))
       (sha256
        (base32 "1jipary7wqb9gmj4mfrz4ym5ir44q2rhknxx6ah1f5lpkcsjm6c6"))))
    (properties `((upstream-name . "deming")))
    (build-system r-build-system)
    (propagated-inputs (list r-boot))
    (home-page "https://cran.r-project.org/package=deming")
    (synopsis
     "Deming, Theil-Sen, Passing-Bablock and Total Least Squares regression")
    (description
     "This package implements generalized Deming regression, Theil-Sen
regression and Passing-Bablock regression functions.")
    (license license:lgpl2.0+)))

(define-public r-deoptim
  (package
    (name "r-deoptim")
    (version "2.2-8")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "DEoptim" version))
       (sha256
        (base32 "0k7mvf7j8y1sqv8zpiwkw4xcmgki37drkxjijrsmmhkfybfan7k3"))))
    (properties `((upstream-name . "DEoptim")))
    (build-system r-build-system)
    (propagated-inputs (list r-parallelly))
    (home-page "https://github.com/ArdiaD/DEoptim")
    (synopsis "Global optimization by differential evolution")
    (description
     "This package implements the Differential Evolution algorithm.
This algorithm is used for the global optimization of a real-valued function
of a real-valued parameter vector.  The implementation of
@code{DifferentialEvolution} in DEoptim interfaces with C code for
efficiency.")
    (license license:gpl2+)))

(define-public r-depmixs4
  (package
    (name "r-depmixs4")
    (version "1.5-1")
    (source (origin
              (method url-fetch)
              (uri (cran-uri "depmixS4" version))
              (sha256
               (base32
                "0dim05r9q97gamr2kviz2q4f67fhpvw5j8gf0prcg8nn64d3nw8j"))))
    (propagated-inputs
     (list r-mass r-nlme r-nnet r-rsolnp))
    (native-inputs (list r-gamlss r-gamlss-dist))
    (build-system r-build-system)
    (home-page "https://cran.r-project.org/web/packages/depmixS4/")
    (synopsis "Dependent Mixture Models")
    (description "This package fits latent (hidden) Markov models on mixed
categorical and continuous (time series) data, otherwise known as dependent
mixture models.")
    (license license:gpl2+)))

(define-public r-detectseparation
  (package
    (name "r-detectseparation")
    (version "0.3")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "detectseparation" version))
       (sha256
        (base32 "05z3p1z5mhmdj5qdknz1b8f6fwbghzckl88pv79v59cfwpbvgmz8"))))
    (properties `((upstream-name . "detectseparation")))
    (build-system r-build-system)
    (propagated-inputs (list r-lpsolveapi r-pkgload r-roi r-roi-plugin-lpsolve))
    (native-inputs (list r-knitr))
    (home-page "https://github.com/ikosmidis/detectseparation")
    (synopsis
     "Detect and check for separation and infinite maximum likelihood estimates")
    (description
     "This package provides pre-fit and post-fit methods for detecting separation
and infinite maximum likelihood estimates in generalized linear models with
categorical responses.  The pre-fit methods apply on binomial-response generalized
liner models such as logit, probit and cloglog regression, and can be directly
supplied as fitting methods to the @code{glm()} function.  The post-fit methods
apply to models with categorical responses, including binomial-response
generalized linear models and multinomial-response models, such as baseline
category logits and adjacent category logits models; for example, the models
implemented in the brglm2 package.  The post-fit methods successively refit the
model with increasing number of iteratively reweighted least squares iterations,
and monitor the ratio of the estimated standard error for each parameter to what
it has been in the first iteration.")
    (license license:gpl3)))

(define-public r-readxl
  (package
    (name "r-readxl")
    (version "1.4.5")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "readxl" version))
       (sha256
        (base32
         "1pyy3g65zcq0b98xqc2v400z5l5ryvdl71vvd372kqgvp9xhvmq9"))))
    (build-system r-build-system)
    (propagated-inputs
     (list r-cellranger r-cpp11 r-progress r-tibble))
    (native-inputs
     (list r-knitr r-testthat r-withr r-writexls))
    (home-page "https://readxl.tidyverse.org")
    (synopsis "Read Excel files")
    (description
     "This package lets you import Excel files into R.  It supports
@file{.xls} via the embedded @code{libxls} C library and @file{.xlsx} via
the embedded @code{RapidXML} C++ library.")
    ;; XXX: This package bundles a copy of 'libxsl' which is BSD-2 and
    ;; 'rapidxml' which is Boost.
    (license (list license:gpl3 license:bsd-2 license:boost1.0))))

(define-public r-rearrr
  (package
    (name "r-rearrr")
    (version "0.3.5")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "rearrr" version))
       (sha256
        (base32 "0iwzb2l3vqs8c76d44qpkfk8hsglm9fg2y75prm6fr4n88xr82bp"))))
    (properties
     '((upstream-name . "rearrr")
       (updater-ignored-native-inputs . ("r-xpectr"))))
    (build-system r-build-system)
    (propagated-inputs (list r-checkmate
                             r-dplyr
                             r-lifecycle
                             r-plyr
                             r-purrr
                             r-r6
                             r-rlang
                             r-tibble))
    (native-inputs (list r-covr r-testthat))
    (home-page "https://github.com/ludvigolsen/rearrr")
    (synopsis "Rearranging data by a set of methods")
    (description
     "This package arranges data by a set of methods.  It uses rearrangers to
reorder data points and mutators to change their values.  From basic utilities,
to centering the greatest value, to swirling in 3-dimensional space, rearrr
enables creativity when plotting and experimenting with data.")
    (license license:expat)))

(define-public r-model4you
  (package
    (name "r-model4you")
    (version "0.9-8")
    (source (origin
              (method url-fetch)
              (uri (cran-uri "model4you" version))
              (sha256
               (base32
                "17xa2lvbsbwsyy54nna99xxwjv04p7xgqa61jz1ivggq0fgrd9fg"))))
    (build-system r-build-system)
    (propagated-inputs
     (list r-formula
           r-ggplot2
           r-gridextra
           r-partykit
           r-sandwich
           r-survival))
    (native-inputs
     (list r-plyr r-psychotools r-strucchange r-th-data))
    (home-page "https://cran.r-project.org/web/packages/model4you/")
    (synopsis "Stratified and personalised models based on trees and forests")
    (description
     "This package provides procedures for model-based trees for subgroup
analyses in clinical trials and model-based forests for the estimation and
prediction of personalised treatment effects.  Currently partitioning of linear
models, @code{lm()}, generalised linear models, @code{glm()}, and
Weibull models, @code{survreg()}, are supported.  Advanced plotting functionality is
supported for the trees and a test for parameter heterogeneity is provided for
the personalised models.")
    (license license:gpl2+)))

(define-public r-modelenv
  (package
    (name "r-modelenv")
    (version "0.2.0")
    (source (origin
              (method url-fetch)
              (uri (cran-uri "modelenv" version))
              (sha256
               (base32
                "1h8vksmvdj5nv6cswr0c21fh1jcryw1lvpq9pn0n771pxybhxqbl"))))
    (properties `((upstream-name . "modelenv")))
    (build-system r-build-system)
    (propagated-inputs (list r-cli r-glue r-rlang r-tibble r-vctrs))
    (native-inputs (list r-testthat))
    (home-page "https://github.com/tidymodels/modelenv")
    (synopsis "Tools for registering models for use in tidymodels")
    (description
     "This is a developer-focused, low dependency package in
@code{tidymodels} that provides functions to register how models are
to be used.  Functions to register models are complimented with
accessor functions to retrieve registered model information to aid in
model fitting and error handling.")
    (license license:expat)))

(define-public r-modelr
  (package
    (name "r-modelr")
    (version "0.1.11")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "modelr" version))
       (sha256
        (base32
         "1lvv6gac3g4x1d58chbvlxlkd77qz21a3rlb64jvzwycx43dbswl"))))
    (build-system r-build-system)
    (propagated-inputs
     (list r-broom
           r-magrittr
           r-purrr
           r-rlang
           r-tibble
           r-tidyr
           r-tidyselect
           r-vctrs))
    (native-inputs (list r-testthat))
    (home-page "https://github.com/tidyverse/modelr")
    (synopsis "Helper functions for modelling in pipelines")
    (description
     "Functions for modelling that help you seamlessly integrate modelling
into a pipeline of data manipulation and visualisation.")
    (license license:gpl3)))

(define-public r-mondate
  (package
    (name "r-mondate")
    (version "1.0")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "mondate" version))
       (sha256
        (base32 "1spz3xv450mw0i984hjp6r4lk653nmjawf9cipv9z7isc4zv3ac3"))))
    (properties `((upstream-name . "mondate")))
    (build-system r-build-system)
    (home-page "https://www.r-project.org")
    (synopsis "Keep track of dates in terms of months")
    (description
     "Keep track of dates in terms of fractional calendar months per Damien
Laker \"Time Calculations for Annualizing Returns: the Need for
Standardization\", The Journal of Performance Measurement, 2008.  Model dates
as of close of business.  Perform date arithmetic in units of \"months\" and
\"years\".  Allow \"infinite\" dates to model \"ultimate\" time.")
    (license license:mpl2.0)))

(define-public r-morpho
  (package
    (name "r-morpho")
    (version "2.12")
    (source (origin
              (method url-fetch)
              (uri (cran-uri "Morpho" version))
              (sha256
               (base32
                "1hg1jr0y11v93mqg2kn8n841nbsiffhyyr2kswj7kk664vlpril0"))))
    (properties
     '((upstream-name . "Morpho")
       (updater-extra-native-inputs . ("r-shapes"))))
    (build-system r-build-system)
    (propagated-inputs (list r-bezier
                             r-colorramps
                             r-doparallel
                             r-foreach
                             r-jsonlite
                             r-mass
                             r-matrix
                             r-rcpp
                             r-rcpparmadillo
                             r-rgl
                             r-rvcg
                             r-sf))
    (native-inputs (list r-shapes r-testthat))
    (home-page "https://github.com/zarquon42b/Morpho")
    (synopsis
     "Calculations and visualizations related to geometric morphometrics")
    (description
     "This package provides a toolset for Geometric Morphometrics and mesh
processing.  This includes (among other stuff) mesh deformations based on
reference points, permutation tests, detection of outliers, processing of
sliding semi-landmarks and semi-automated surface landmark placement.")
    (license license:gpl2)))

(define-public r-hexbin
  (package
    (name "r-hexbin")
    (version "1.28.5")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "hexbin" version))
       (sha256
        (base32
         "1rnk94mjhzfmpcq77iy8qi2j8dj8bdw9vdjmwm27s94z77b8gl1f"))))
    (build-system r-build-system)
    (propagated-inputs
     (list r-lattice))
    (native-inputs
     (list gfortran r-knitr)) ; for vignettes
    (home-page "https://github.com/edzer/hexbin")
    (synopsis "Hexagonal binning routines")
    (description
     "This package provides binning and plotting functions for hexagonal bins.
It uses and relies on grid graphics and formal (S4) classes and methods.")
    (license license:gpl2+)))

(define-public r-hgnchelper
  (package
    (name "r-hgnchelper")
    (version "0.8.15")
    (source (origin
              (method url-fetch)
              (uri (cran-uri "HGNChelper" version))
              (sha256
               (base32
                "063m8vyndfzbnxnbmlz772icj5y9j8gdbggss1ch1mypq9ds3y3n"))))
    (properties `((upstream-name . "HGNChelper")))
    (build-system r-build-system)
    (propagated-inputs (list r-splitstackshape))
    (native-inputs (list r-knitr r-testthat))
    (home-page "https://github.com/waldronlab/HGNChelper")
    (synopsis
     "Identification and correction of invalid gene symbols for human and mouse")
    (description
     "This package provides a set of R functions for identifying and
correcting HGNC human gene symbols.  In addition, you can identify MGI mouse
gene symbols, which have been converted to date format by Excel, withdrawn, or
aliased.  It also contains functions for reversibly converting between HGNC
symbols and valid R names.")
    (license license:gpl2+)))

(define-public r-hh
  (package
    (name "r-hh")
    (version "3.1-53")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "HH" version))
       (sha256
        (base32 "14lqyxnpx6dis5s40yrzrdqq5qvqspibzssr2bh3jkkfykjasxmj"))))
    (properties `((upstream-name . "HH")))
    (build-system r-build-system)
    (propagated-inputs (list r-abind
                             r-colorspace
                             r-gridextra
                             r-hmisc
                             r-lattice
                             r-latticeextra
                             r-leaps
                             r-multcomp
                             r-rcolorbrewer
                             r-reshape2
                             r-rmpfr
                             r-shiny
                             r-vcd))
    (home-page "https://cran.r-project.org/package=HH")
    (synopsis "Statistical analysis and data display: Heiberger and Holland")
    (description
     "This package provides support software for Statistical Analysis and Data
Display (Second Edition, Springer, ISBN 978-1-4939-2121-8, 2015) and (First
Edition, Springer, ISBN 0-387-40270-5, 2004) by Richard M. Heiberger and Burt
Holland.  This contemporary presentation of statistical methods features
extensive use of graphical displays for exploring data and for displaying the
analysis.  The second edition includes redesigned graphics and additional
chapters.  The authors emphasize how to construct and interpret graphs,
discuss principles of graphical design, and show how accompanying traditional
tabular results are used to confirm the visual impressions derived directly
from the graphs.  Many of the graphical formats are novel and appear here for
the first time in print.  All chapters have exercises.  All functions
introduced in the book are in the package.  R code for all examples, both
graphs and tables, in the book is included in the scripts directory of the
package.")
    (license license:gpl2+)))

(define-public r-hiddenmarkov
  (package
    (name "r-hiddenmarkov")
    (version "1.8-14")
    (source (origin
              (method url-fetch)
              (uri (cran-uri "HiddenMarkov" version))
              (sha256
               (base32
                "09b0rwipvkcwrgy0mn0dcz11ijihmnabh1yw0avbk3imkv0j42r5"))))
    (build-system r-build-system)
    (native-inputs
     (list gfortran))
    (home-page "https://cran.r-project.org/web/packages/HiddenMarkov/")
    (synopsis "Hidden markov models for R")
    (description "This package contains functions for the analysis of Discrete
Time Hidden Markov Models, Markov Modulated GLMs and the Markov Modulated
Poisson Process.  It includes functions for simulation, parameter estimation,
and the Viterbi algorithm.  The algorithms are based of those of Walter
Zucchini.")
    (license license:gpl2+)))

(define-public r-highr
  (package
    (name "r-highr")
    (version "0.11")
    (source (origin
              (method url-fetch)
              (uri (cran-uri "highr" version))
              (sha256
               (base32
                "19z0gwdy46z6gb46b3fs2ljxa2cn0bpvx7aam0jk75h180l183g9"))))
    (properties
     ;; We can't have r-knitr among the inputs here, because r-highr depends
     ;; on r-xfun, which is an input to r-knitr.
     '((updater-ignored-native-inputs . ("r-knitr"))))
    (build-system r-build-system)
    ;; Do not build vignettes as they need r-knitr.
    (arguments (list #:test-types '(list "tests")))
    (propagated-inputs (list r-xfun))
    (native-inputs (list r-testit))
    (home-page "https://github.com/yihui/highr")
    (synopsis "Syntax highlighting for R source code")
    (description
     "This package provides syntax highlighting for R source code.  Currently
it supports LaTeX and HTML output.  Source code of other languages is
supported via Andre Simon's highlight package.")
    (license license:gpl3+)))

(define-public r-hmm
  (package
    (name "r-hmm")
    (version "1.0.2")
    (source (origin
              (method url-fetch)
              (uri (cran-uri "HMM" version))
              (sha256
               (base32
                "1rv9s058mw4sl6hvna5hdp3i2nl2z4vhgdmakbv1ldjwhhkfg5rv"))))
    (properties `((upstream-name . "HMM")))
    (build-system r-build-system)
    (home-page "https://cran.r-project.org/web/packages/HMM/")
    (synopsis "Hidden Markov Models")
    (description "This package provides an easy to use library to setup, apply
and make inference with discrete time and discrete space hidden Markov
models.")
    (license license:gpl2+)))

(define-public r-hmisc
  (package
    (name "r-hmisc")
    (version "5.2-3")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "Hmisc" version))
       (sha256
        (base32 "0whivay0d3p00y5z7mpz14n68i1yvcfkmr6lfbvw854022yqxi0y"))))
    (properties `((upstream-name . "Hmisc")))
    (build-system r-build-system)
    ;; Tests need r-rms, which needs this package.
    (arguments (list #:test-types '(list "vignettes")))
    (native-inputs
     (list gfortran))
    (propagated-inputs
     (list r-base64enc
           r-cluster
           r-colorspace
           r-data-table
           r-foreign
           r-formula
           r-ggplot2
           r-gridextra
           r-gtable
           r-htmltable
           r-htmltools
           r-knitr
           r-nnet
           r-rmarkdown
           r-rpart
           r-viridis))
    (home-page "http://biostat.mc.vanderbilt.edu/Hmisc")
    (synopsis "Miscellaneous data analysis and graphics functions")
    (description
     "This package contains many functions useful for data analysis,
high-level graphics, utility operations, functions for computing sample size
and power, importing and annotating datasets, imputing missing values,
advanced table making, variable clustering, character string manipulation,
conversion of R objects to LaTeX code, and recoding variables.")
    (license license:gpl2+)))

(define-public r-hms
  (package
    (name "r-hms")
    (version "1.1.3")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "hms" version))
       (sha256
        (base32
         "10h2k5j97fggq3hc0qzxv1q9821y21m326v3x99zsvpl1b3g89p6"))))
    (build-system r-build-system)
    (propagated-inputs
     (list r-lifecycle r-pkgconfig r-rlang r-vctrs))
    (native-inputs (list r-testthat))
    (home-page "https://github.com/rstats-db/hms")
    (synopsis "Pretty time of day")
    (description
     "This package implements an S3 class for storing and formatting
time-of-day values, based on the @code{difftime} class.")
    (license license:gpl3+)))

(define-public r-hsaur3
  (package
    (name "r-hsaur3")
    (version "1.0-15")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "HSAUR3" version))
       (sha256
        (base32 "17yg6ql9c88pg5higmrvhnavx6hcbr4nm5r65d8q3iqfkgnc6ym1"))))
    (properties `((upstream-name . "HSAUR3")))
    (build-system r-build-system)
    (home-page "https://cran.r-project.org/package=HSAUR3")
    (synopsis "Handbook of Statistical Analyses Using R (3rd Edition)")
    (description
     "This package provides functions, data sets, analyses and examples from
the third edition of the book A Handbook of Statistical Analyses Using
R (Torsten Hothorn and Brian S. Everitt, Chapman & Hall/CRC, 2014).  The first
chapter of the book, which is entitled An Introduction to R, is completely
included in this package, for all other chapters, a vignette containing all
data analyses is available.  In addition, Sweave source code for slides of
selected chapters is included in this package.")
    (license license:gpl2)))

(define-public r-httpgd
  (package
    (name "r-httpgd")
    (version "2.0.3")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "httpgd" version))
       (sha256
        (base32 "02p9d50gbzaz1v77ssby9fgxx8pxp4n8h50k57x9niymgi7phnmx"))))
    (properties `((upstream-name . "httpgd")))
    (build-system r-build-system)
    ;; XXX On the build farm the tests fail with "Too many open files".  It
    ;; works fine on my laptop.
    (arguments (list #:tests? #false))
    (propagated-inputs (list r-asioheaders r-cpp11 r-unigd))
    (native-inputs (list r-future r-httr r-jsonlite r-knitr r-testthat))
    (home-page "https://github.com/nx10/httpgd")
    (synopsis "HTTP server graphics device")
    (description
     "This package provides a graphics device for R that is accessible via
network protocols.  This package was created to make it easier to embed live R
graphics in integrated development environments and other applications.  The
included HTML/@code{JavaScript} client (plot viewer) aims to provide a better
overall user experience when dealing with R graphics.  The device
asynchronously serves graphics via HTTP and @code{WebSockets}'.")
    (license license:gpl2+)))

(define-public r-httptest
  (package
    (name "r-httptest")
    (version "4.2.2")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "httptest" version))
       (sha256
        (base32 "0c370jxkd9dzqg5pdf2mcv2kjzr9zp9qai9riivjgygj6jhlcjav"))))
    (properties `((upstream-name . "httptest")))
    (build-system r-build-system)
    (propagated-inputs (list r-curl r-digest r-httr r-jsonlite r-testthat))
    (native-inputs (list r-knitr r-spelling r-testthat))
    (home-page "https://enpiar.com/r/httptest/")
    (synopsis "Test environment for HTTP requests")
    (description
     "Testing and documenting code that communicates with remote servers can
be painful.  Dealing with authentication, server state, and other
complications can make testing seem too costly to bother with.  But it doesn't
need to be that hard.  This package enables one to test all of the logic on
the R sides of the API in your package without requiring access to the remote
service.  Importantly, it provides three contexts that mock the network
connection in different ways, as well as testing functions to assert that HTTP
requests were---or were not---made.  It also allows one to safely record real
API responses to use as test fixtures.  The ability to save responses and load
them offline also enables one to write vignettes and other dynamic documents
that can be distributed without access to a live server.")
    (license license:expat)))

(define-public r-httptest2
  (package
    (name "r-httptest2")
    (version "1.1.0")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "httptest2" version))
       (sha256
        (base32 "0vj6ynxc2xdq4xhl6df8aa3582s7jf5m71hxqxhjsjfqdzm72dv8"))))
    (properties `((upstream-name . "httptest2")))
    (build-system r-build-system)
    (propagated-inputs (list r-digest r-httr2 r-jsonlite r-rlang r-testthat))
    (native-inputs (list r-knitr r-spelling r-webfakes))
    (home-page "https://enpiar.com/httptest2/")
    (synopsis "Test Helpers for 'httr2'")
    (description
     "Testing and documenting code that communicates with remote servers can
be painful.  This package helps with writing tests for packages that use
@code{httr2}.  It enables testing all of the logic on the R sides of the API
without requiring access to the remote service, and it also allows recording
real API responses to use as test fixtures.  The ability to save responses and
load them offline also enables writing vignettes and other dynamic documents
that can be distributed without access to a live server.")
    (license license:expat)))

(define-public r-httpuv
  (package
    (name "r-httpuv")
    (version "1.6.16")
    (source (origin
              (method url-fetch)
              (uri (cran-uri "httpuv" version))
              (sha256
               (base32
                "0r1gxmxscw1znda2mjp9wl1rxkbdsn3mq826qjs13529z6p43wsi"))
              (modules '((guix build utils)))
              ;; Cannot unbundle http-parser, because it contains local
              ;; modifications.
              (snippet
               '(delete-file-recursively "src/libuv"))))
    (properties
     '((updater-ignored-native-inputs
        . ("r-callr"
           "r-close"
           "r-fe80"
           "r-httprequest"
           "r-status"
           "r-websocket"))))
    (build-system r-build-system)
    (inputs
     (list libuv-for-r-httpuv zlib))
    (propagated-inputs
     (list r-later r-promises r-r6 r-rcpp))
    (native-inputs (list pkg-config r-curl r-testthat))
    (home-page "https://github.com/rstudio/httpuv")
    (synopsis "HTTP and WebSocket server library for R")
    (description
     "The httpuv package provides low-level socket and protocol support for
handling HTTP and WebSocket requests directly from within R.  It is primarily
intended as a building block for other packages, rather than making it
particularly easy to create complete web applications using httpuv alone.")
    ;; This package includes third-party code that was originally released
    ;; under various non-copyleft licenses.  Full licensing information can be
    ;; obtained here: https://github.com/rstudio/httpuv/blob/master/LICENSE
    (license license:gpl3+)))

(define-public r-httr
  (package
    (name "r-httr")
    (version "1.4.7")
    (source (origin
              (method url-fetch)
              (uri (cran-uri "httr" version))
              (sha256
               (base32
                "0fisvq3zydmqagn7lj6x98zxkcl7l95gfydl27zkigb7zg1fcm8m"))))
    (build-system r-build-system)
    (propagated-inputs
     (list r-curl r-jsonlite r-mime r-openssl r-r6))
    (native-inputs
     (list r-knitr r-testthat))
    (home-page "https://github.com/hadley/httr")
    (synopsis "Tools for working with URLs and HTTP")
    (description
     "The aim of httr is to provide a wrapper for RCurl customised to the
demands of modern web APIs.  It provides useful tools for working with HTTP
organised by HTTP verbs (@code{GET()}, @code{POST()}, etc).  Configuration
functions make it easy to control additional request components.")
    (license license:expat)))

(define-public r-httr2
  (package
    (name "r-httr2")
    (version "1.1.2")
    (source (origin
              (method url-fetch)
              (uri (cran-uri "httr2" version))
              (sha256
               (base32
                "17bzggypradnfgrmswjlj5fd0vcvi2nhx28frfy8cr17fj15102r"))))
    (properties
     `((upstream-name . "httr2")
       ;; r-common doesn't exist, and r-nanonext isn't needed.
       (updater-ignored-native-inputs . ("r-common" "r-nanonext"))
       (updater-extra-native-inputs . ("r-docopt" "r-httpuv" "r-xml2"))))
    (build-system r-build-system)
    (arguments
     (list
      #:phases
      '(modify-phases %standard-phases
         (add-after 'unpack 'delete-bad-tests
           (lambda _
             ;; These tests need Internet access.
             (with-directory-excursion "tests/testthat/"
               (delete-file "test-oauth.R")
               (substitute* "test-req-auth-aws.R"
                 ((".*can correctly sign a request with dummy credentials.*" m)
                  (string-append m "skip('skip');\n")))
               (substitute* "test-req-body.R"
                 ((".*can send file.*" m)
                  (string-append m "skip('skip');\n")))))))))
    (propagated-inputs
     (list r-cli
           r-curl
           r-glue
           r-lifecycle
           r-magrittr
           r-openssl
           r-r6
           r-rappdirs
           r-rlang
           r-vctrs
           r-withr))
    (native-inputs (list r-clipr
                         r-docopt
                         r-httpuv
                         r-httr
                         r-jsonlite
                         r-knitr
                         r-later
                         r-promises
                         r-testthat
                         r-webfakes
                         r-xml2))
    (home-page "https://httr2.r-lib.org")
    (synopsis "Perform HTTP requests and process the responses")
    (description
     "This package provides tools for creating and modifying HTTP requests,
then performing them and processing the results.  @code{httr2} is a
re-imagining of @code{httr} that uses a pipe-based interface and solves more
of the problems that API wrapping packages face.")
    (license license:expat)))

(define-public r-jade
  (package
    (name "r-jade")
    (version "2.0-4")
    (source (origin
              (method url-fetch)
              (uri (cran-uri "JADE" version))
              (sha256
               (base32
                "0m90rnhr5vkdv1xswr5c0j06ngzvmg73nd0kmg9m9r6a6ddddcyl"))))
    (properties `((upstream-name . "JADE")))
    (build-system r-build-system)
    (propagated-inputs (list r-clue))
    (home-page "https://cran.r-project.org/package=JADE")
    (synopsis "Blind source separation methods")
    (description
     "In this package Cardoso's JADE algorithm as well as his functions for
joint diagonalization are ported to R.  Also several other @dfn{blind source
separation} (BSS) methods, like AMUSE and SOBI, and some criteria for
performance evaluation of BSS algorithms, are given.  The package is described
in Miettinen, Nordhausen and Taskinen (2017) <doi:10.18637/jss.v076.i02>.")
    (license license:gpl2+)))

(define-public r-job
  (package
    (name "r-job")
    (version "0.3.1")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "job" version))
       (sha256
        (base32 "14i0ljq2wp9k8112fr27sz0bc0zi2a68kls8vw5h3qa5n40v27cc"))))
    (properties `((upstream-name . "job")))
    (build-system r-build-system)
    (propagated-inputs (list r-digest r-rstudioapi))
    (native-inputs (list r-testthat))
    (home-page "https://cran.r-project.org/package=job")
    (synopsis "Run code as an RStudio job")
    (description
     "Call @code{job::job({<code here>})} to run R code as an RStudio job and
keep your console free in the meantime.  This allows for a productive workflow
while testing (multiple) long-running chunks of code.  It can also be used to
organize results using the RStudio Jobs GUI or to test code in a clean
environment.  Two RStudio Addins can be used to run selected code as a job.")
    (license license:expat)))

(define-public r-jose
  (package
    (name "r-jose")
    (version "1.2.1")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "jose" version))
       (sha256
        (base32 "0si1mg325fwx9zgjdbqspw9v6prl5mn3iccg7vki4bpzmwhd953q"))))
    (properties `((upstream-name . "jose")))
    (build-system r-build-system)
    (propagated-inputs (list r-jsonlite r-openssl))
    (native-inputs (list r-knitr r-spelling r-testthat))
    (home-page "https://r-lib.r-universe.dev/jose")
    (synopsis "JavaScript object signing and encryption")
    (description
     "This package lets you read and write JSON Web Keys (JWK, rfc7517),
generate and verify JSON Web Signatures (JWS, rfc7515) and encode/decode JSON
Web Tokens (JWT, rfc7519).  These standards provide modern signing and
encryption formats that are natively supported by browsers via the JavaScript
@code{WebCryptoAPI}, and used by services like OAuth 2.0, LetsEncrypt, and
Github Apps.")
    (license license:expat)))

(define-public r-jsonify
  (package
    (name "r-jsonify")
    (version "1.2.2")
    (source (origin
              (method url-fetch)
              (uri (cran-uri "jsonify" version))
              (sha256
               (base32
                "0bxgyj5b1hnijq5315g050giixy4k5mjz2zdx8yil0igb5ifji9p"))))
    (properties `((upstream-name . "jsonify")))
    (build-system r-build-system)
    (arguments
     (list
      #:phases
      '(modify-phases %standard-phases
         ;; We need this for tests.
         (add-before 'check 'set-timezone
           (lambda* (#:key inputs #:allow-other-keys)
             (setenv "TZ" "UTC")
             (setenv "TZDIR"
                     (search-input-directory inputs
                                             "share/zoneinfo")))))))
    (propagated-inputs (list r-rapidjsonr r-rcpp))
    (native-inputs (list r-knitr r-testthat tzdata-for-tests))
    (home-page "https://cran.r-project.org/package=jsonify")
    (synopsis
     "Convert between R objects and JavaScript Object Notation (JSON)")
    (description
     "This package enables conversions between R objects and JavaScript Object
Notation (JSON) using the rapidjsonr library.")
    (license license:expat)))

(define-public r-jsonlite
  (package
    (name "r-jsonlite")
    (version "2.0.0")
    (source (origin
              (method url-fetch)
              (uri (cran-uri "jsonlite" version))
              (sha256
               (base32
                "0bf87agviacnk2ff6jif4d61bzvvz2h9sxwly0ryql5kh8693svm"))))
    (properties
     '((updater-ignored-native-inputs
        . ("r-reshape2" "r-sf" "r-testthat"))))
    (build-system r-build-system)
    ;; Tests depend on r-testthat, which depends indirectly on r-jsonlite.
    (arguments (list #:tests? #false))
    (native-inputs
     (list r-knitr r-r-rsp))
    (home-page "https://arxiv.org/abs/1403.2805")
    (synopsis "Robust, high performance JSON parser and generator for R")
    (description
     "The jsonlite package provides a fast JSON parser and generator optimized
for statistical data and the web.  It offers flexible, robust, high
performance tools for working with JSON in R and is particularly powerful for
building pipelines and interacting with a web API.  In addition to converting
JSON data from/to R objects, jsonlite contains functions to stream, validate,
and prettify JSON data.  The unit tests included with the package verify that
all edge cases are encoded and decoded consistently for use with dynamic data
in systems and applications.")
    (license license:expat)))

(define-public r-jsonvalidate
  (package
    (name "r-jsonvalidate")
    (version "1.5.0")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "jsonvalidate" version))
       (sha256
        (base32 "010zcpbyja1lb4j7sbx1515scnqkaw6c7fb9g37gj1cr0ipyna9l"))))
    (properties `((upstream-name . "jsonvalidate")))
    (build-system r-build-system)
    (propagated-inputs (list r-r6 r-v8))
    (native-inputs (list r-jsonlite r-knitr r-testthat r-withr))
    (home-page "https://docs.ropensci.org/jsonvalidate/")
    (synopsis "Validate JSON schema")
    (description
     "This package uses the node library @code{is-my-json-valid} or @code{ajv}
to validate JSON against a JSON schema.  Drafts 04, 06 and 07 of JSON schema
are supported.")
    (license license:expat)))

(define-public r-servr
  (package
    (name "r-servr")
    (version "0.32")
    (source (origin
              (method url-fetch)
              (uri (cran-uri "servr" version))
              (sha256
               (base32
                "19ixy27b87z99s1crqnmxm7vqzz4zsxpjgpy4101dic7628wlak7"))))
    (build-system r-build-system)
    (propagated-inputs
     (list r-httpuv r-jsonlite r-mime r-xfun))
    (home-page "https://github.com/yihui/servr")
    (synopsis "Simple HTTP server to serve static files or dynamic documents")
    (description
     "Servr provides an HTTP server in R to serve static files, or dynamic
documents that can be converted to HTML files (e.g., R Markdown) under a given
directory.")
    (license license:expat)))

(define-public r-howmany
  (package
    (name "r-howmany")
    (version "0.3-1")
    (source (origin
              (method url-fetch)
              (uri (cran-uri "howmany" version))
              (sha256
               (base32
                "045ck8qahfg2swbgyf7dpl32ryq1m4sbalhr7m5qdgpm62vz8h7f"))))
    (build-system r-build-system)
    (home-page "https://cran.r-project.org/web/packages/howmany/")
    (synopsis "Lower bound for the number of correct rejections")
    (description "When testing multiple hypotheses simultaneously, this package
provides functionality to calculate a lower bound for the number of correct
rejections (as a function of the number of rejected hypotheses), which holds
simultaneously -with high probability- for all possible number of rejections.
As a special case, a lower bound for the total number of false null hypotheses
can be inferred.  Dependent test statistics can be handled for multiple tests
of associations.  For independent test statistics, it is sufficient to provide
a list of p-values.")
    (license license:gpl2+)))

(define-public r-htmltools
  (package
    (name "r-htmltools")
    (version "0.5.8.1")
    (source (origin
              (method url-fetch)
              (uri (cran-uri "htmltools" version))
              (sha256
               (base32
                "0xpi2g87vwanp0kbs22j90pa2bban3nwrdjdb3257hq6xj9j5xpr"))))
    (build-system r-build-system)
    (propagated-inputs
     (list r-base64enc r-digest r-fastmap r-rlang))
    (native-inputs (list r-markdown r-testthat))
    (home-page "https://cran.r-project.org/web/packages/htmltools")
    (synopsis "R tools for HTML")
    (description
     "This package provides tools for HTML generation and output in R.")
    (license license:expat)))

(define-public r-htmlwidgets
  (package
    (name "r-htmlwidgets")
    (version "1.6.4")
    (source (origin
              (method url-fetch)
              (uri (cran-uri "htmlwidgets" version))
              (sha256
               (base32
                "1l0f7bz2icixsrgg5fg8k09mv0nq9vn5ch1fywkaqpa8605qzc3w"))))
    (build-system r-build-system)
    (propagated-inputs
     (list r-htmltools r-jsonlite
           r-knitr r-rmarkdown
           r-yaml))
    (native-inputs
     (list r-knitr r-testthat))
    (home-page "https://github.com/ramnathv/htmlwidgets")
    (synopsis "HTML Widgets for R")
    (description
     "HTML widgets is a framework for creating HTML widgets that render in
various contexts including the R console, R Markdown documents, and Shiny web
applications.")
    (license license:expat)))

(define-public r-htmltable
  (package
    (name "r-htmltable")
    (version "2.4.3")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "htmlTable" version))
       (sha256
        (base32 "1pgndsyml68d9qd747043m9g0dxhaa10m533dchcsg1izwdx0f9p"))))
    (properties `((upstream-name . "htmlTable")))
    (build-system r-build-system)
    (arguments
     (list
      #:modules
      '((guix build r-build-system)
        (guix build minify-build-system)
        (guix build utils))
      #:imported-modules
      `(,@%r-build-system-modules
        (guix build minify-build-system))
      #:phases
      #~(modify-phases (@ (guix build r-build-system) %standard-phases)
          (add-after 'unpack 'replace-bundled-minified-JavaScript
            (lambda* (#:key inputs #:allow-other-keys)
              (minify (assoc-ref inputs "js-jquery")
                      #:target
                      "inst/htmlwidgets/lib/jquery/jquery.min.js"))))))
    (propagated-inputs
     (list r-checkmate
           r-htmltools
           r-htmlwidgets
           r-knitr
           r-magrittr
           r-rstudioapi
           r-stringr))
    (native-inputs
     `(("esbuild" ,esbuild)
       ("js-jquery"
        ,(origin
           (method url-fetch)
           (uri "https://code.jquery.com/jquery-3.7.1.js")
           (sha256
            (base32
             "1zicjv44sx6n83vrkd2lwnlbf7qakzh3gcfjw0lhq48b5z55ma3q"))))
       ("r-dplyr" ,r-dplyr)
       ("r-knitr" ,r-knitr)
       ("r-purrr" ,r-purrr)
       ("r-testthat" ,r-testthat)
       ("r-xml" ,r-xml)
       ("r-xml2" ,r-xml2)))
    (home-page "http://gforge.se/packages/")
    (synopsis "Advanced tables for Markdown/HTML")
    (description
     "This package provides functions to build tables with advanced layout
elements such as row spanners, column spanners, table spanners, zebra
striping, and more.  While allowing advanced layout, the underlying
CSS-structure is simple in order to maximize compatibility with word
processors such as LibreOffice.  The package also contains a few text
formatting functions that help outputting text compatible with HTML or
LaTeX.")
    (license license:gpl3+)))

(define-public r-curl
  (package
    (name "r-curl")
    (version "6.2.3")
    (source (origin
              (method url-fetch)
              (uri (cran-uri "curl" version))
              (sha256
               (base32
                "04r70p22r59x9paicwssfab2zq6dvzs39ygansc5swq9wvy23xlp"))))
    (properties
     `((upstream-name . "curl")
       (updater-extra-inputs . ("curl"))
       (updater-ignored-inputs . ("openssh" "openssl"))
       (updater-ignored-native-inputs . ("r-db8" "r-webutils"))))
    (build-system r-build-system)
    (inputs
     (list curl zlib))
    (native-inputs
     (list pkg-config
           r-jsonlite
           r-knitr
           r-spelling
           r-testthat))
    (home-page "https://github.com/jeroenooms/curl")
    (synopsis "HTTP client for R")
    (description
     "The @code{curl()} and @code{curl_download()} functions provide highly
configurable drop-in replacements for base @code{url()} and
@code{download.file()} with better performance, support for encryption, gzip
compression, authentication, and other @code{libcurl} goodies.  The core of
the package implements a framework for performing fully customized requests
where data can be processed either in memory, on disk, or streaming via the
callback or connection interfaces.")
    (license license:expat)))

(define-public r-hwriter
  (package
    (name "r-hwriter")
    (version "1.3.2.1")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "hwriter" version))
       (sha256
        (base32
         "1wxnv8h9cs65m3z01dpnnkgn2cpwfsck70g1jz9nbkr7mdaa4bzd"))))
    (build-system r-build-system)
    (home-page "https://cran.r-project.org/web/packages/hwriter")
    (synopsis "Output R objects in HTML format")
    (description
     "This package provides easy-to-use and versatile functions to output R
objects in HTML format.")
    (license license:lgpl2.1+)))

(define-public r-rjson
  (package
    (name "r-rjson")
    (version "0.2.23")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "rjson" version))
       (sha256
        (base32
         "0j0gbwd4cn1f7fb6ml14jr3m38ny1y62gnh1cxz6bvalr1sla0sm"))))
    (build-system r-build-system)
    (home-page "https://cran.r-project.org/web/packages/rjson")
    (synopsis "JSON library for R")
    (description
     "This package provides functions to convert R objects into JSON objects
and vice-versa.")
    (license license:gpl2+)))

(define-public r-fastdummies
  (package
    (name "r-fastdummies")
    (version "1.7.5")
    (source (origin
              (method url-fetch)
              (uri (cran-uri "fastDummies" version))
              (sha256
               (base32
                "0jmvb9j4cywq5nff7997qhv8hl8zw187c9pgdh0i1v9pmy31jymq"))))
    (properties `((upstream-name . "fastDummies")))
    (build-system r-build-system)
    (propagated-inputs (list r-data-table r-stringr r-tibble))
    (native-inputs (list r-knitr r-spelling r-testthat))
    (home-page "https://github.com/jacobkap/fastDummies")
    (synopsis "Create dummy columns and rows from categorical variables")
    (description
     "This package creates dummy columns from columns that have categorical
variables (character or factor types).  You can also specify which columns to
make dummies out of, or which columns to ignore.  Also creates dummy rows from
character, factor, and Date columns.  This package provides a significant
speed increase from creating dummy variables through @code{model.matrix()}.")
    (license license:expat)))

(define-public r-fastmap
  (package
    (name "r-fastmap")
    (version "1.2.0")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "fastmap" version))
       (sha256
        (base32
         "0ilj7gcbnha6l61sqzk6wrj6l08mxyay49957izha7axj6i09nmi"))))
    (properties `((upstream-name . "fastmap")))
    (build-system r-build-system)
    (native-inputs (list r-testthat))
    (home-page "https://r-lib.github.io/fastmap/")
    (synopsis "Fast implementation of a key-value store")
    (description
     "This package provides a fast implementation of a key-value store.
Environments are commonly used as key-value stores, but every time a new key
is used, it is added to R's global symbol table, causing a small amount of
memory leakage.  This can be problematic in cases where many different keys
are used.  Fastmap avoids this memory leak issue by implementing the map using
data structures in C++.")
    (license license:expat)))

(define-public r-fastglm
  (package
    (name "r-fastglm")
    (version "0.0.3")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "fastglm" version))
       (sha256
        (base32 "0283kgk81cxbii7ljmp1rzqg5mzkvf7cj7lflhhhkgj5ljqina2i"))))
    (properties `((upstream-name . "fastglm")))
    (build-system r-build-system)
    (propagated-inputs (list r-bh r-bigmemory r-rcpp r-rcppeigen))
    (native-inputs (list r-knitr))
    (home-page "https://cran.r-project.org/package=fastglm")
    (synopsis
     "Fast and stable fitting of generalized linear models using 'RcppEigen'")
    (description
     "This package fits generalized linear models efficiently using @code{RcppEigen}'.
The iteratively reweighted least squares implementation utilizes the
step-halving approach of Marschner to help safeguard against convergence
issues.")
    (license license:gpl2+)))

(define-public r-fastghquad
  (package
    (name "r-fastghquad")
    (version "1.0.1")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "fastGHQuad" version))
       (sha256
        (base32
         "1zj7nsbnx4g253m3dpz9vi3zk3jxwrixwjw1ks6n4shpb4dlkp2w"))))
    (properties `((upstream-name . "fastGHQuad")))
    (build-system r-build-system)
    (propagated-inputs
     (list r-rcpp))
    (home-page "https://github.com/awblocker/fastGHQuad")
    (synopsis "Fast Rcpp implementation of Gauss-Hermite Quadrature")
    (description
     "This package implements numerically-stable Gauss-Hermite quadrature
rules and utility functions for adaptive GH quadrature.")
    (license license:expat)))

(define-public r-rstpm2
  (package
    (name "r-rstpm2")
    (version "1.6.7")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "rstpm2" version))
       (sha256
        (base32
         "0drcnfpccl8braxxgx5vnkzcqgdk4gla2iscpixz041sa0yhm7hd"))))
    (properties
     '((upstream-name . "rstpm2")
       (updater-extra-native-inputs . ("r-desolve"))))
    (build-system r-build-system)
    (arguments
     (list
      #:phases
      '(modify-phases %standard-phases
         (add-after 'unpack 'disable-bad-tests
           (lambda _
             ;; XXX: This one fails with the wrong result:
             ;; length(beta) == length(args$init) is not TRUE
             (substitute* "tests/testthat/test_delayed.R"
               ((".*All values zero or one.*" m)
                (string-append m "skip('skip');\n"))))))))
    (propagated-inputs
     (list r-bbmle
           r-fastghquad
           r-mgcv
           r-mvtnorm
           r-numderiv
           r-rcpp
           r-rcpparmadillo
           r-survival))
    (native-inputs
     (list gfortran r-desolve r-ggplot2 r-runit r-testthat))
    (home-page "https://github.com/mclements/rstpm2")
    (synopsis "Link-based survival models")
    (description
     "This package provides R implementations of @dfn{generalized survival
models} (GSMs), smooth @dfn{accelerated failure time} (AFT) models and Markov
multi-state models.")
    ;; One of these licenses
    (license (list license:gpl2 license:gpl3))))

;; This package includes minified JavaScript files.  When upgrading please
;; check that there are no new minified JavaScript files.
(define-public r-jquerylib
  (package
    (name "r-jquerylib")
    (version "0.1.4")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "jquerylib" version))
       (sha256
        (base32
         "04a40v4znpj98j7y6009d74a6g9dchj5rr3p08cgz9p3rlfw3g7h"))
       (snippet
        '(for-each delete-file
                   '("inst/lib/1.12.4/jquery-1.12.4.min.js"
                     "inst/lib/2.2.4/jquery-2.2.4.min.js"
                     "inst/lib/3.6.0/jquery-3.6.0.min.js")))))
    (properties `((upstream-name . "jquerylib")))
    (build-system r-build-system)
    (arguments
     `(#:modules ((guix build utils)
                  (guix build r-build-system)
                  (srfi srfi-1))
       #:phases
       (modify-phases %standard-phases
         (add-after 'unpack 'process-javascript
           (lambda* (#:key inputs #:allow-other-keys)
             (with-directory-excursion "inst/lib/"
               (call-with-values
                   (lambda ()
                     (unzip2
                      `(("1.12.4/jquery-1.12.4.js"
                         "1.12.4/jquery-1.12.4.min.js")
                        ("2.2.4/jquery-2.2.4.js"
                         "2.2.4/jquery-2.2.4.min.js")
                        ("3.6.0/jquery-3.6.0.js"
                         "3.6.0/jquery-3.6.0.min.js"))))
                 (lambda (sources targets)
                   (for-each (lambda (source target)
                               (format #t "Processing ~a --> ~a~%"
                                       source target)
                               (invoke "esbuild" source "--minify"
                                       (string-append "--outfile=" target)))
                             sources targets)))))))))
    (propagated-inputs
     (list r-htmltools))
    (native-inputs
     (list esbuild r-testthat))
    (home-page "https://cran.r-project.org/package=jquerylib")
    (synopsis "Obtain jQuery as an HTML dependency object")
    (description
     "Obtain any major version of jQuery and use it in any webpage generated
by htmltools (e.g. shiny, htmlwidgets, and rmarkdown).  Most R users don't
need to use this package directly, but other R packages (e.g. shiny,
rmarkdown, etc.) depend on this package to avoid bundling redundant copies of
jQuery.")
    (license license:expat)))

(define-public r-jqr
  (package
    (name "r-jqr")
    (version "1.4.0")
    (source (origin
              (method url-fetch)
              (uri (cran-uri "jqr" version))
              (sha256
               (base32
                "0bnhk3p0yb30245g8fglrc88nk8xrc2k86q1wa5v3cw3rfpyhac9"))))
    (properties
     `((upstream-name . "jqr")
       (updater-extra-inputs . ("jq"))))
    (build-system r-build-system)
    (inputs (list jq))
    (propagated-inputs (list r-lazyeval r-magrittr))
    (native-inputs (list pkg-config r-jsonlite r-testthat))
    (home-page "https://docs.ropensci.org/jqr/")
    (synopsis "R client for jq, a JSON Processor")
    (description
     "This package provides an R client for @command{jq}, a JSON processor.
@command{jq} allows the following with JSON data: index into, parse, do
calculations, cut up and filter, change key names and values, perform
conditionals and comparisons, and more.")
    (license license:expat)))

(define-public r-safetensors
  (package
    (name "r-safetensors")
    (version "0.1.2")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "safetensors" version))
       (sha256
        (base32 "0xvg5y2sd7gzcal0qqgxbx8vcvmy50jm0j2ajr8iw3wyy5qpyvkp"))))
    (properties `((upstream-name . "safetensors")))
    (build-system r-build-system)
    (propagated-inputs (list r-cli r-jsonlite r-r6 r-rlang))
    (native-inputs (list r-testthat))
    (home-page "https://github.com/mlverse/safetensors")
    (synopsis "Safetensors file format")
    (description
     "This package provides a file format for storing tensors that is
secure (doesn't allow for code execution), fast and simple to implement.
@code{safetensors} also enables cross language and cross frameworks
compatibility making it an ideal format for storing machine learning model
weights.")
    (license license:expat)))

(define-public r-sass
  (package
    (name "r-sass")
    (version "0.4.10")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "sass" version))
       (sha256
        (base32
         "0c4vnx3jqpy8iwh3gf7vvclcwjq6mbg4dqr9clki3n3l7wj4rnsa"))))
    (properties `((upstream-name . "sass")))
    (build-system r-build-system)
    (arguments
     (list
      #:phases
      '(modify-phases %standard-phases
         ;; One test fails when the current locale is the C locale.
         (add-before 'check 'set-test-locale
           (lambda _ (setenv "LC_ALL" "en_US.UTF-8"))))))
    (propagated-inputs
     (list r-fs r-htmltools r-r6 r-rappdirs r-rlang))
    (native-inputs (list r-knitr r-testthat r-withr))
    (home-page "https://github.com/rstudio/sass")
    (synopsis "Syntactically Awesome Style Sheets (SASS)")
    (description
     "This package provides an SCSS compiler, powered by the libsass library.
With this, R developers can use variables, inheritance, and functions to
generate dynamic style sheets.  The package uses the Sass CSS extension
language, which is stable, powerful, and CSS compatible.")
    (license license:expat)))

(define-public r-saver
  (package
    (name "r-saver")
    (version "1.1.2")
    (source (origin
              (method url-fetch)
              (uri (cran-uri "SAVER" version))
              (sha256
               (base32
                "1s1kw8idkaj7j90fw4qn9k0wd4vz0sblsk06ry6lm4afcar0p158"))))
    (properties `((upstream-name . "SAVER")))
    (build-system r-build-system)
    (propagated-inputs
     (list r-doparallel
           r-foreach
           r-glmnet
           r-iterators
           r-matrix))
    (native-inputs (list r-knitr))
    (home-page "https://github.com/mohuangx/SAVER")
    (synopsis
     "Recovery of gene expression profile in noisy and sparse scRNA-seq data")
    (description
     "This package is an implementation of a regularized regression prediction
and empirical Bayes method to recover the true gene expression profile in noisy
and sparse single-cell RNA-seq data.  In @dfn{single-cell RNA sequencing}
(scRNA-seq) studies, only a small fraction of the transcripts present in each
cell are sequenced.  This leads to unreliable quantification of genes with low
or moderate expression, which hinders downstream analysis.  This package
@dfn{single-cell analysis via expression recovery} (SAVER) implements an
expression recovery method for unique molecule index (UMI)-based scRNA-seq
data that borrows information across genes and cells to provide accurate
expression estimates for all genes.")
    (license license:gpl2)))

(define-public r-bsicons
  (package
    (name "r-bsicons")
    (version "0.1.2")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "bsicons" version))
       (sha256
        (base32 "1ifxb6qvm5m824n924pwa3f2ck33mzzbjq77jzdl36ikx4z0x47a"))))
    (properties `((upstream-name . "bsicons")))
    (build-system r-build-system)
    (propagated-inputs (list r-cli r-htmltools r-rlang))
    (native-inputs (list r-bslib r-testthat))
    (home-page "https://github.com/rstudio/bsicons")
    (synopsis "Easily work with Bootstrap icons")
    (description
     "This package lets you easily use Bootstrap icons inside Shiny apps and R
Markdown documents.  More generally, icons can be inserted in any
@code{htmltools} document through inline SVG.")
    (license license:expat)))

;; This package includes minified JavaScript files.  When upgrading please
;; check that there are no new minified JavaScript files.
(define-public r-bslib
  (package
    (name "r-bslib")
    (version "0.9.0")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "bslib" version))
       (sha256
        (base32
         "01q9zy2dwhag0jl0dbhfhwbqj09ghd2wrkqihpv8acbazw3s3mxd"))
       (snippet
        '(for-each delete-file
                   '("inst/components/dist/components.min.js"
                     "inst/components/dist/web-components.min.js"
                     "inst/lib/bs-a11y-p/plugins/js/bootstrap-accessibility.min.js"
                     "inst/lib/bs3/assets/javascripts/bootstrap.min.js"
                     "inst/lib/bs4/dist/js/bootstrap.bundle.min.js"
                     "inst/lib/bs5/dist/js/bootstrap.bundle.min.js")))))
    (properties
     `((upstream-name . "bslib")
       (updater-ignored-native-inputs . ("r-rmarkdown" "r-shiny"))))
    (build-system r-build-system)
    (arguments
     (list
      ;; Some tests require shiny, leading to a dependency cycle.
      #:tests? #false
      #:modules '((guix build r-build-system)
                  (guix build minify-build-system)
                  (guix build utils)
                  (ice-9 match))
      #:imported-modules `(,@%r-build-system-modules
                           (guix build minify-build-system))
      #:phases
      #~(modify-phases (@ (guix build r-build-system) %standard-phases)
          (add-after 'unpack 'process-javascript
            (lambda* (#:key inputs #:allow-other-keys)
              (with-directory-excursion "inst/"
                (for-each (match-lambda
                            ((source . target)
                             (minify source #:target target)))
                          `(("components/dist/components.js"
                             . "components/dist/components.min.js")
                            ("components/dist/web-components.js"
                             . "components/dist/web-components.min.js")
                            ("lib/bs-a11y-p/plugins/js/bootstrap-accessibility.js"
                             . "lib/bs-a11y-p/plugins/js/bootstrap-accessibility.min.js")
                            ("lib/bs3/assets/javascripts/bootstrap.js"
                             . "lib/bs3/assets/javascripts/bootstrap.min.js")
                            (,(assoc-ref inputs "js-bootstrap4-bundle")
                             . "lib/bs4/dist/js/bootstrap.bundle.min.js")
                            (,(assoc-ref inputs "js-bootstrap5-bundle")
                             . "lib/bs5/dist/js/bootstrap.bundle.min.js")))))))))
    (propagated-inputs
     (list r-base64enc
           r-cachem
           r-fastmap
           r-htmltools
           r-jquerylib
           r-jsonlite
           r-lifecycle
           r-memoise
           r-mime
           r-rlang
           r-sass))
    (native-inputs
     `(("esbuild" ,esbuild)
       ("js-bootstrap4-bundle"
        ,(origin
           (method url-fetch)
           (uri "https://raw.githubusercontent.com/twbs/bootstrap/v4.6.0/dist/js/bootstrap.bundle.js")
           (sha256
            (base32
             "04abvgp923w36qfqkkl2syim3bl119nwxbgials90z1jyb8jgss1"))))
       ("js-bootstrap5-bundle"
        ,(origin
           (method url-fetch)
           (uri "https://raw.githubusercontent.com/twbs/bootstrap/v5.3.1/dist/js/bootstrap.bundle.js")
           (sha256
            (base32
             "1bp0a2fin80hwxvd260r1jk57snsgz74vahid64yb2sgj0rlmj8a"))))))
    (home-page "https://rstudio.github.io/bslib/")
    (synopsis "Custom Bootstrap Sass themes for shiny and rmarkdown")
    (description
     "This package simplifies custom CSS styling of both shiny and rmarkdown
via Bootstrap Sass.  It supports both Bootstrap 3 and 4 as well as their
various Bootswatch themes.  An interactive widget is also provided for
previewing themes in real time.")
    (license license:expat)))

;; This package includes minified JavaScript files.  When upgrading please
;; check that there are no new minified JavaScript files.
(define-public r-shiny
  (package
    (name "r-shiny")
    (version "1.10.0")
    (source
     (origin
       (method git-fetch)
       (uri (git-reference
             (url "https://github.com/rstudio/shiny")
             (commit (string-append "v" version))))
       (file-name (git-file-name name version))
       (sha256
        (base32
         "07b4i1qcpfhyflaxxvwllnz0qw9iphnnsrr5rwa65aw7d9r2wszz"))
       (snippet
        '(for-each delete-file
                   '("inst/www/shared/bootstrap/js/bootstrap.min.js"
                     "inst/www/shared/bootstrap/accessibility/js/bootstrap-accessibility.min.js"
                     "inst/www/shared/datatables/js/jquery.dataTables.min.js"
                     "inst/www/shared/datepicker/js/bootstrap-datepicker.min.js"
                     "inst/www/shared/highlight/highlight.pack.js"
                     "inst/www/shared/ionrangeslider/js/ion.rangeSlider.min.js"
                     "inst/www/shared/jquery.min.js"
                     "inst/www/shared/jqueryui/jquery-ui.min.js"
                     "inst/www/shared/legacy/jquery.min.js"
                     "inst/www/shared/selectize/accessibility/js/selectize-plugin-a11y.min.js"
                     "inst/www/shared/selectize/js/selectize.min.js"
                     "inst/www/shared/shiny.min.js"
                     ;; These are built from TypeScript sources, which is a
                     ;; little trickier to do correctly.
                     ;; "inst/www/shared/shiny-showcase.js" ;TODO
                     ;; "inst/www/shared/shiny-autoreload.js" ;TODO
                     "inst/www/shared/showdown/compressed/showdown.js"
                     "inst/www/shared/strftime/strftime-min.js")))))
    (properties
     '((updater-extra-native-inputs . ("r-coro"))))
    (build-system r-build-system)
    (arguments
     (list
      #:modules '((guix build r-build-system)
                  (guix build minify-build-system)
                  (guix build utils)
                  (ice-9 match))
      #:imported-modules
      `(,@%r-build-system-modules
        (guix build minify-build-system))
      #:phases
      '(modify-phases (@ (guix build r-build-system) %standard-phases)
         ;; This is needed for some tests.
         (add-before 'check 'set-HOME
           (lambda _ (setenv "HOME" "/tmp")))
         (add-after 'unpack 'replace-bundled-minified-JavaScript
           (lambda* (#:key inputs #:allow-other-keys)
             (let ((replace-file (lambda (old new)
                                   (format #t "replacing ~a with ~a\n" old new)
                                   (symlink new old))))
               ;; NOTE: Files in ./inst/www/shared/datepicker/js/locales/
               ;; contain just data.  They are not minified code, so we don't
               ;; replace them.
               (with-directory-excursion "inst/www/shared"
                 (replace-file "strftime/strftime-min.js"
                               (search-input-file inputs
                                                  "/share/javascript/strftime.min.js"))
                 (replace-file "highlight/highlight.pack.js"
                               (search-input-file inputs
                                                  "/share/javascript/highlight.min.js"))
                 (replace-file "datatables/js/jquery.dataTables.min.js"
                               (search-input-file inputs
                                                  "/share/javascript/jquery.dataTables.min.js"))
                 (replace-file "selectize/js/selectize.min.js"
                               (search-input-file inputs
                                                  "/share/javascript/selectize.min.js"))
                 (for-each (match-lambda
                             ((source . target)
                              (minify source #:target target)))
                           `(("jqueryui/jquery-ui.js" .
                              "jqueryui/jquery-ui.min.js")
                             ("datepicker/js/bootstrap-datepicker.js" .
                              "datepicker/js/bootstrap-datepicker.min.js")
                             ("ionrangeslider/js/ion.rangeSlider.js" .
                              "ionrangeslider/js/ion.rangeSlider.min.js")
                             ("bootstrap/js/bootstrap.js" .
                              "bootstrap/js/bootstrap.min.js")
                             (,(assoc-ref inputs "js-bootstrap-accessibility") .
                              "bootstrap/accessibility/js/bootstrap-accessibility.min.js")
                             ("shiny.js" .
                              "shiny.min.js")
                             ("jquery.js" .
                              "jquery.min.js")
                             ("legacy/jquery.js" .
                              "legacy/jquery.min.js")
                             ("selectize/accessibility/js/selectize-plugin-a11y.js" .
                              "selectize/accessibility/js/selectize-plugin-a11y.min.js")
                             ("showdown/src/showdown.js" .
                              "showdown/compressed/showdown.js"))))))))))
    (propagated-inputs
     (list r-bslib
           r-cachem
           r-commonmark
           r-crayon
           r-ellipsis
           r-fastmap
           r-fontawesome
           r-glue
           r-htmltools
           r-httpuv
           r-jsonlite
           r-later
           r-lifecycle
           r-mime
           r-promises
           r-r6
           r-rlang
           r-sourcetools
           r-withr
           r-xtable))
    (inputs
     (list js-datatables js-selectize js-strftime js-highlight))
    (native-inputs
     `(("esbuild" ,esbuild)
       ("gfortran" ,gfortran)
       ("js-bootstrap-accessibility"
        ,(origin
           (method url-fetch)
           (uri "https://raw.githubusercontent.com/paypal/bootstrap-accessibility-plugin/\
v1.0.7/_site/plugins/js/bootstrap-accessibility.js")
           (sha256
            (base32
             "1489wyzwrpf86y7vhc13n4v3mszmsfybhd3f75jkpnbvyp5sncm8"))))
       ("r-coro" ,r-coro)
       ("r-future" ,r-future)
       ("r-ggplot2" ,r-ggplot2)
       ("r-testthat" ,r-testthat)))
    (home-page "https://shiny.rstudio.com")
    (synopsis "Easy interactive web applications with R")
    (description
     "Makes it incredibly easy to build interactive web applications
with R.  Automatic \"reactive\" binding between inputs and outputs and
extensive prebuilt widgets make it possible to build beautiful,
responsive, and powerful applications with minimal effort.")
    (license license:artistic2.0)))

(define-public r-shinyauthr
  (package
    (name "r-shinyauthr")
    (version "1.0.0")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "shinyauthr" version))
       (sha256
        (base32 "0apaqjkxpr96kx9indl0pifk5y75gdx5npfcvxfg5k2crpx9vmxk"))))
    (properties `((upstream-name . "shinyauthr")))
    (build-system r-build-system)
    ;; One of the tests requires r-shinytest, which has a big JavaScript
    ;; problem.
    (arguments (list #:tests? #false))
    (native-inputs (list r-testthat))
    (propagated-inputs (list r-dplyr
                             r-glue
                             r-rlang
                             r-shiny
                             r-shinyjs
                             r-sodium))
    (home-page "https://github.com/paulc91/shinyauthr")
    (synopsis "Shiny authentication modules")
    (description
     "With this package you can add in-app user authentication to Shiny,
allowing you to secure publicly hosted apps and build dynamic user interfaces
from user information.")
    (license license:expat)))

(define-public r-shinydisconnect
  (package
    (name "r-shinydisconnect")
    (version "0.1.1")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "shinydisconnect" version))
       (sha256
        (base32 "1yhppfx8jpvz48iwxnimcwqhj02vqjrfmh4z5rdn9d35p51c8zjc"))))
    (properties `((upstream-name . "shinydisconnect")))
    (build-system r-build-system)
    (propagated-inputs (list r-checkmate r-glue r-htmltools r-shiny))
    (home-page "https://github.com/daattali/shinydisconnect")
    (synopsis "Show a nice message when a Shiny app disconnects or errors")
    (description
     "This package provides a Shiny app that can disconnect for a variety of
reasons: an unrecoverable error occurred in the app, the server went down, the
user lost internet connection, or any other reason that might cause the Shiny
app to lose connection to its server.  With shinydisconnect, you can call
@code{disonnectMessage} anywhere in a Shiny app's UI to add a nice message
when this happens.  It works locally (running Shiny apps within RStudio) and
on Shiny servers.")
    (license license:expat)))

(define-public r-shinyhelper
  (package
    (name "r-shinyhelper")
    (version "0.3.2")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "shinyhelper" version))
       (sha256
        (base32 "1c4hvf19j3yyh8r12nx85ldkxs89g98q74csnqs5ml5l79a65vgp"))))
    (properties `((upstream-name . "shinyhelper")))
    (build-system r-build-system)
    (propagated-inputs (list r-markdown r-shiny))
    (home-page "https://cran.r-project.org/package=shinyhelper")
    (synopsis "Easily add Markdown help files to shiny app elements")
    (description
     "This package creates a lightweight way to add markdown helpfiles to
Shiny apps, using modal dialog boxes, with no need to observe each help button
separately.")
    (license license:gpl3)))

(define-public r-shinymeta
  (package
    (name "r-shinymeta")
    (version "0.2.1")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "shinymeta" version))
       (sha256
        (base32 "0jq4ifk59xyvjgmccgx9nhqc0pn2kbd9w1wdsr2470xdhmypvra5"))))
    (properties
     '((upstream-name . "shinymeta")
       (updater-extra-native-inputs
        . ("r-knitr" "r-rmarkdown" "r-stringr" "zip"))))
    (build-system r-build-system)
    (arguments
     (list
      #:phases
      '(modify-phases %standard-phases
         (add-before 'check 'find-zip
           (lambda _ (setenv "R_ZIPCMD" (which "zip"))))
         ;; Needed by styler for writing to caches.
         (add-after 'unpack 'set-HOME
           (lambda _ (setenv "HOME" "/tmp"))))))
    (propagated-inputs (list r-callr
                             r-fastmap
                             r-fs
                             r-htmltools
                             r-rlang
                             r-shiny
                             r-sourcetools
                             r-styler))
    (native-inputs (list r-dplyr
                         r-knitr
                         r-knitr
                         r-rmarkdown
                         r-rmarkdown
                         r-stringr
                         r-testthat
                         zip))
    (home-page "https://rstudio.github.io/shinymeta/")
    (synopsis "Export domain logic from Shiny using meta-programming")
    (description
     "This package provides tools for capturing logic in a Shiny app and
exposing it as code that can be run outside of Shiny (e.g., from an R
console).  It also provides tools for bundling both the code and results to
the end user.")
    (license license:gpl3)))

(define-public r-shiny-router
  (package
    (name "r-shiny-router")
    (version "0.3.1")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "shiny.router" version))
       (sha256
        (base32 "1zg8cdxmw620i1iv7jrghd768gw7iv52hi6lx79xvnfjz8w4si3x"))))
    (properties `((upstream-name . "shiny.router")))
    (build-system r-build-system)
    (propagated-inputs (list r-glue r-htmltools r-rlang r-shiny))
    (native-inputs (list r-testthat))
    (home-page "https://appsilon.github.io/shiny.router/")
    (synopsis "Basic Routing for Shiny Web Applications")
    (description
     "This package provides a simple router for your Shiny apps.  The router
allows you to create dynamic web applications with a real-time User Interface
and easily share url to pages within your Shiny apps.")
    (license license:expat)))

;; This package includes minified JavaScript files.  When upgrading please
;; check that there are no new minified JavaScript files.
(define-public r-shinytree
  (package
    (name "r-shinytree")
    (version "0.3.1")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "shinyTree" version))
       (sha256
        (base32
         "0krffsgdv99cvyzdspb9l7cdnq1vibsbmpd4w48r5pi4v8jbvfj6"))
       (snippet
        ;; Delete minified JavaScript
        '(for-each delete-file
                   '("inst/www/jsTree-3.3.7/libs/require.js"
                     "inst/www/jsTree-3.3.7/libs/jquery.js"
                     "inst/www/jsTree-3.3.7/jstree.min.js")))))
    (properties `((upstream-name . "shinyTree")))
    (build-system r-build-system)
    (arguments
     (list
      #:modules '((guix build utils)
                  (guix build r-build-system)
                  (srfi srfi-1))
      #:phases
      '(modify-phases %standard-phases
         (add-after 'unpack 'delete-bad-tests
           (lambda _
             ;; This file requires r-shinytest, which has a big JavaScript
             ;; problem.
             (delete-file "tests/testthat/test_tree_interactive.R")))
         (add-after 'unpack 'replace-minified-javascript
           (lambda* (#:key inputs #:allow-other-keys)
             (with-directory-excursion "inst/www/jsTree-3.3.7/"
               (symlink (search-input-file inputs
                                           "/share/javascript/require.min.js")
                        "libs/require.js")
               (call-with-values
                   (lambda ()
                     (unzip2
                      `((,(assoc-ref inputs "js-jquery")
                         "libs/jquery.js")
                        ("jstree.js"
                         "jstree.min.js"))))
                 (lambda (sources targets)
                   (for-each (lambda (source target)
                               (format #t "Processing ~a --> ~a~%"
                                       source target)
                               (invoke "esbuild" source "--minify"
                                       (string-append "--outfile=" target)))
                             sources targets)))))))))
    (propagated-inputs
     (list r-htmlwidgets r-jsonlite r-promises r-shiny r-stringr))
    (inputs
     (list js-requirejs))
    (native-inputs
     `(("esbuild" ,esbuild)
       ("js-jquery"
        ,(origin
           (method url-fetch)
           (uri "https://code.jquery.com/jquery-3.3.1.js")
           (sha256
            (base32
             "1b8zxrp6xwzpw25apn8j4qws0f6sr7qr7h2va5h1mjyfqvn29anq"))))
       ("r-testthat" ,r-testthat)))
    (home-page "https://cran.r-project.org/web/packages/shinyTree/")
    (synopsis "jsTree bindings for Shiny")
    (description
     "This package exposes R bindings to jsTree, a JavaScript library that
supports interactive trees, to enable rich, editable trees in Shiny.")
    (license license:expat)))

(define-public r-shinyvalidate
  (package
    (name "r-shinyvalidate")
    (version "0.1.3")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "shinyvalidate" version))
       (sha256
        (base32 "01qlqzp0g6782maj73yygmwlchhv4xcnlc7j0w3lp6dcj7qkzz68"))))
    (properties `((upstream-name . "shinyvalidate")))
    (build-system r-build-system)
    (propagated-inputs (list r-glue r-htmltools r-rlang r-shiny))
    (native-inputs (list r-testthat))
    (home-page "https://rstudio.github.io/shinyvalidate/")
    (synopsis "Input validation for Shiny apps")
    (description
     "This package improves the user experience of Shiny apps by helping to
provide feedback when required inputs are missing, or input values are not
valid.")
    (license license:expat)))

(define-public r-shinydashboard
  (package
    (name "r-shinydashboard")
    (version "0.7.3")
    (source (origin
              (method url-fetch)
              (uri (cran-uri "shinydashboard" version))
              (sha256
               (base32
                "0k0llpzbys0qrzv37paihibhzn2riqgl0sqj7gzfqn3ahi8yh734"))))
    (build-system r-build-system)
    ;; The directory inst/AdminLTE/ contains a minified JavaScript file.
    ;; Regenerate it from the included sources.
    (arguments
     `(#:phases
       (modify-phases %standard-phases
         (add-after 'unpack 'generate-minified-javascript
           (lambda _
             (with-directory-excursion "inst/AdminLTE"
               (let ((target "app.min.js")
                     (source "app.js"))
                 (format #t "Processing ~a --> ~a~%"
                         source target)
                 (delete-file target)
                 (invoke "esbuild" source "--minify"
                         (string-append "--outfile=" target)))))))))
    (propagated-inputs
     (list r-htmltools r-promises r-shiny))
    (native-inputs
     (list esbuild))
    (home-page "https://rstudio.github.io/shinydashboard/")
    (synopsis "Create dashboards with shiny")
    (description "This package provides an extension to the Shiny web
application framework for R, making it easy to create attractive dashboards.")
    ;; This package includes software that was released under the Expat
    ;; license, but the whole package is released under GPL version 2 or
    ;; later.
    (license license:gpl2+)))

(define-public r-shinydashboardplus
  (package
    (name "r-shinydashboardplus")
    (version "2.0.5")
    (source (origin
              (method url-fetch)
              (uri (cran-uri "shinydashboardPlus" version))
              (sha256
               (base32
                "1k53ycfdv5r58rwqsk7mkrrlz72wikhrhzlfrg3dkwbdbzblrhqb"))
              (modules '((guix build utils)))
              (snippet
               `(begin
                  (with-directory-excursion
                      ,(string-append "inst/shinydashboardPlus-" version
                                      "/js/")
                    (for-each delete-file
                              '("app.min.js"
                                "shinydashboardPlus.min.js"
                                "shinydashboardPlus.min.js.map")))
                  (with-directory-excursion "inst/materialDesign-1.0/js"
                    (for-each delete-file
                              '("material.min.js"
                                "ripples.min.js")))))))
    (properties `((upstream-name . "shinydashboardPlus")))
    (build-system r-build-system)
    (arguments
     (list
      ;; The tests launch a shinyApp; they are interactive tests that
      ;; will block forever, so we just don't run them.
      #:tests? #false
      #:modules
      '((guix build r-build-system)
        (guix build minify-build-system)
        (guix build utils)
        (ice-9 match))
      #:imported-modules
      `(,@%r-build-system-modules
        (guix build minify-build-system))
      #:phases
      #~(modify-phases (@ (guix build r-build-system) %standard-phases)
          (add-after 'unpack 'process-javascript
            (lambda* (#:key inputs #:allow-other-keys)
              (with-directory-excursion
                  (string-append "inst/shinydashboardPlus-" #$version "/js/")
                (for-each
                 (match-lambda
                   ((source . target)
                    (minify source #:target target)))
                 `(("app.js" . "app.min.js")
                   ("shinydashboardPlus.js" . "shinydashboardPlus.min.js")
                   (,(search-input-file inputs "/dist/js/material.js")
                    . "materialDesign-1.0/js/material.min.js")
                   (,(search-input-file inputs "/dist/js/ripples.js")
                    . "materialDesign-1.0/js/ripples.min.js")))))))))
    (propagated-inputs
     (list r-fresh
           r-htmltools
           r-lifecycle
           r-shiny
           r-shinydashboard
           r-waiter))
    (native-inputs
     (list esbuild r-knitr
           (let ((commit "92a2284b47aed56a9d7ae92cf9b40072d27982b3"))
             (origin
               (method git-fetch)
               (uri (git-reference
                     (url "https://github.com/DucThanhNguyen/MaterialAdminLTE")
                     (commit commit)))
               (file-name (git-file-name "MaterialAdminLTE"
                                         (git-version "0" "0" commit)))
               (sha256
                (base32
                 "0cn11hxpf25h7xj2lk473z24swgz979dz255zwk2m2fj00iljkn9"))))))
    (home-page "https://github.com/RinteRface/shinydashboardPlus")
    (synopsis "Add more AdminLTE2 components to shinydashboard")
    (description
     "This package extends shinydashboard with AdminLTE2 components.
AdminLTE2 is a Bootstrap 3 dashboard template.  Customize boxes, add timelines
and a lot more.")
    (license license:gpl2+)))

(define-public r-shinyfiles
  (package
    (name "r-shinyfiles")
    (version "0.9.3")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "shinyFiles" version))
       (sha256
        (base32 "11kjq0vw5c98lzrg80m9w917lkgw5im2h9wgk1b84vlaxrjy2wja"))))
    (properties `((upstream-name . "shinyFiles")))
    (build-system r-build-system)
    (propagated-inputs
     (list r-fs r-htmltools r-jsonlite r-shiny r-tibble))
    (home-page "https://github.com/thomasp85/shinyFiles")
    (synopsis "Server-side file system viewer for Shiny")
    (description
     "This package provides functionality for client-side navigation of the
server side file system in shiny apps.  In case the app is running locally
this gives the user direct access to the file system without the need to
\"download\" files to a temporary location.  Both file and folder selection as
well as file saving is available.")
    (license license:gpl2+)))

(define-public r-shinythemes
  (package
    (name "r-shinythemes")
    (version "1.2.0")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "shinythemes" version))
       (sha256
        (base32
         "0qr9bfxw8afxns44i2j4msignf6g5qb2nzpay2lpv343rrlqbmip"))))
    (properties `((upstream-name . "shinythemes")))
    (build-system r-build-system)
    (propagated-inputs (list r-shiny))
    (home-page "https://rstudio.github.io/shinythemes/")
    (synopsis "Themes for Shiny")
    (description
     "This package provides themes for use with Shiny.  It includes several
Bootstrap themes, which are packaged for use with Shiny applications.")
    ;; The package is released under version 3 of the GPL, but it includes
    ;; source files that are covered by the Expat license.  It also includes
    ;; fonts under SIL or the ASL.
    (license (list license:gpl3 license:expat
                   license:silofl1.1 license:asl2.0))))

;; The package sources include minified variants of d3.js and non-minified
;; source code of d3-jetpack.
(define-public r-d3r
  (package
    (name "r-d3r")
    (version "1.1.0")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "d3r" version))
       (sha256
        (base32
         "1dcm53y3jpyswr6y368xhdnn1nkchixf4wkxnsb2mk9lzccb44y4"))
       (snippet
        '(for-each delete-file
                   '("inst/www/d3/v3/dist/d3.min.js"
                     "inst/www/d3/v4/dist/d3.min.js"
                     "inst/www/d3/v5/dist/d3.min.js"
                     "inst/www/d3/v6/dist/d3.min.js"
                     "inst/www/d3/v7/dist/d3.min.js")))))
    (build-system r-build-system)
    (arguments
     `(#:modules ((guix build utils)
                  (guix build r-build-system)
                  (srfi srfi-1))
       #:phases
       (modify-phases %standard-phases
         (add-after 'unpack 'process-javascript
           (lambda* (#:key inputs #:allow-other-keys)
             (with-directory-excursion "inst/www/d3/"
               (call-with-values
                   (lambda ()
                     (unzip2
                      `((,(assoc-ref inputs "d3.v3.js")
                         "v3/dist/d3.min.js")
                        (,(assoc-ref inputs "d3.v4.js")
                         "v4/dist/d3.min.js")
                        (,(assoc-ref inputs "d3.v5.js")
                         "v5/dist/d3.min.js")
                        (,(assoc-ref inputs "d3.v6.js")
                         "v6/dist/d3.min.js")
                        (,(assoc-ref inputs "d3.v7.js")
                         "v7/dist/d3.min.js"))))
                 (lambda (sources targets)
                   (for-each (lambda (source target)
                               (format #t "Processing ~a --> ~a~%"
                                       source target)
                               (invoke "esbuild" source "--minify"
                                       (string-append "--outfile=" target)))
                             sources targets)))))))))
    (propagated-inputs
     (list r-dplyr r-htmltools r-tidyr))
    (native-inputs
     `(("esbuild" ,esbuild)
       ("d3.v3.js"
        ,(origin
           (method url-fetch)
           (uri "https://d3js.org/d3.v3.js")
           (sha256
            (base32
             "1arr7sr08vy7wh0nvip2mi7dpyjw4576vf3bm45rp4g5lc1k1x41"))))
       ("d3.v4.js"
        ,(origin
           (method url-fetch)
           (uri "https://d3js.org/d3.v4.js")
           (sha256
            (base32
             "0y7byf6kcinfz9ac59jxc4v6kppdazmnyqfav0dm4h550fzfqqlg"))))
       ("d3.v5.js"
        ,(origin
           (method url-fetch)
           (uri "https://d3js.org/d3.v5.js")
           (sha256
            (base32
             "177ypw6mjrp2ch9lj6znibwacwrvm4ypjxflsxsnl2sigx5dcwic"))))
       ("d3.v6.js"
        ,(origin
           (method url-fetch)
           (uri "https://d3js.org/d3.v6.js")
           (sha256
            (base32
             "13hick3glizzm442b9swlwz584rzwwvhpq9qvfbh3m5jay10wxw0"))))
       ("d3.v7.js"
        ,(origin
           (method url-fetch)
           (uri "https://d3js.org/d3.v7.js")
           (sha256
            (base32
             "1m4i3kqzkz7w06sp9zqcy9f88xpdhi7cqih3phdrf4yjmfk1pfjg"))))
       ("r-testthat" ,r-testthat)))
    (home-page "https://github.com/timelyportfolio/d3r")
    (synopsis "Data visualization utilities for R")
    (description
     "This package provides a suite of functions to help ease the use of the
d3.js visualization library in R.  These helpers include
@code{htmltools::htmlDependency} functions, hierarchy builders, and conversion
tools for @code{partykit}, @code{igraph}, @code{table}, and @code{data.frame}
R objects into the JSON format that the d3.js library expects.")
    (license license:bsd-3)))

;; We use the latest commit here because the last release was in 2016 while
;; the latest commit was in 2018.
(define-public r-sankeyd3
  (let ((commit "fd50a74e29056e0d67d75b4d04de47afb2f932bc")
        (revision "1"))
    (package
      (name "r-sankeyd3")
      (version (git-version "0.3.2" revision commit))
      (source
       (origin
         (method git-fetch)
         (uri (git-reference
               (url "https://github.com/fbreitwieser/sankeyD3")
               (commit commit)))
         (file-name (git-file-name name version))
         (sha256
          (base32
           "0jrcnfax321pszbpjdifnkbrgbjr43bjzvlzv1p5a8wskksqwiyx"))))
      (build-system r-build-system)
      (propagated-inputs
       (list r-d3r r-htmlwidgets r-shiny r-magrittr))
      (home-page "https://github.com/fbreitwieser/sankeyD3")
      (synopsis "Sankey network graphs from R")
      (description
       "This package provides an R library to generate Sankey network graphs
in R and Shiny via the D3 visualization library.")
      ;; The R code is licensed under GPLv3+.  It includes the non-minified
      ;; JavaScript source code of d3-sankey, which is released under the
      ;; 3-clause BSD license.
      (license (list license:gpl3+ license:bsd-3)))))

(define-public r-webfakes
  (package
    (name "r-webfakes")
    (version "1.3.2")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "webfakes" version))
       (sha256
        (base32 "18hcr63ci5cfdd9299va4gckabwx7mypw1jv5vydn2w8x4da2s68"))))
    (properties `((upstream-name . "webfakes")))
    (build-system r-build-system)
    (arguments
     (list
      #:phases
      '(modify-phases %standard-phases
         (add-after 'unpack 'disable-bad-tests
           ;; This test requires Internet access.
           (lambda _ (delete-file "tests/testthat/test-httpbin.R"))))))
    (native-inputs (list r-curl
                         r-digest
                         r-httpuv
                         r-httr
                         r-jsonlite
                         r-testthat
                         r-withr
                         r-zip))
    (home-page "https://webfakes.r-lib.org/")
    (synopsis "Fake web apps for HTTP testing")
    (description
     "This package lets you create a web app that makes it easier to test web
clients without using the internet.  It includes a web app framework with path
matching, parameters and templates.  It can parse various HTTP request bodies.
It can send JSON data or files from the disk.  It includes a web app that
implements the httpbin.org web service.")
    (license license:expat)))

(define-public r-wesanderson
  (package
    (name "r-wesanderson")
    (version "0.3.7")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "wesanderson" version))
       (sha256
        (base32
         "0kjyz5mrkrirg2glf57b0rhxj2fdp1m6q8zx947y0jg1w425cbn9"))))
    (properties `((upstream-name . "wesanderson")))
    (build-system r-build-system)
    (home-page "https://github.com/karthik/wesanderson")
    (synopsis "Wes Anderson color palette generator")
    (description
     "This package provides color palettes that have been generated mostly
from Wes Anderson movies.")
    (license license:expat)))

(define-public r-gg-gap
  (package
    (name "r-gg-gap")
    (version "1.3")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "gg.gap" version))
       (sha256
        (base32
         "0m66050ryn31xmsmmikjsssllasvjdmp9yjbwfdwfpwdv106zn9h"))))
    (properties `((upstream-name . "gg.gap")))
    (build-system r-build-system)
    (propagated-inputs
     (list r-cowplot r-ggplot2))
    (home-page "https://github.com/ChrisLou-bioinfo/gg.gap")
    (synopsis "Define segments on the y-axis for ggplot2")
    (description
     "The @code{gg.gap} function enables you to define segments for the y-axis
in a ggplot2 plot.")
    (license license:gpl3)))

(define-public r-mbess
  (package
    (name "r-mbess")
    (version "4.9.3")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "MBESS" version))
       (sha256
        (base32 "05ph8dwigwn0c4qg8smqhsjijvsvfawbzvm74mqpasi8qifz8nd3"))))
    (properties `((upstream-name . "MBESS")))
    (build-system r-build-system)
    (propagated-inputs
     (list r-boot r-lavaan r-mass r-mnormt r-nlme r-openmx r-sem r-semtools))
    (home-page "https://www3.nd.edu/~kkelley/site/MBESS.html")
    (synopsis "Methods for designing research studies")
    (description
     "This package implements methods that are useful in designing research
studies and analyzing data, with particular emphasis on methods that are
developed for or used within the behavioral, educational, and social
sciences (broadly defined).  That being said, many of the methods implemented
within MBESS are applicable to a wide variety of disciplines.  MBESS has a
suite of functions for a variety of related topics, such as effect sizes,
confidence intervals for effect sizes (including standardized effect sizes and
noncentral effect sizes), sample size planning (from the @dfn{accuracy in
parameter estimation} (AIPE), power analytic, equivalence, and minimum-risk
point estimation perspectives), mediation analysis, various properties of
distributions, and a variety of utility functions.")
    ;; Either version of the GPL.
    (license (list license:gpl2 license:gpl3))))

(define-public r-homologene
  (package
    (name "r-homologene")
    (version "1.4.68.19.3.27")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "homologene" version))
       (sha256
        (base32 "0d7wxisk0vqk1n165v1i19bc02zv78h5r5d3jqai5y6nkmwn01sh"))))
    (properties `((upstream-name . "homologene")))
    (build-system r-build-system)
    (propagated-inputs
     (list r-dplyr r-magrittr r-purrr r-r-utils r-readr))
    (native-inputs (list r-testthat))
    (home-page "https://github.com/oganm/homologene")
    (synopsis "Quick access to homologene and gene annotation updates")
    (description
     "This package provides a wrapper for the homologene database by the
National Center for Biotechnology Information (NCBI).  It allows searching for
gene homologs across species.  The package also includes an updated version of
the homologene database where gene identifiers and symbols are replaced with
their latest (at the time of submission) version and functions to fetch latest
annotation data to keep updated.")
    (license license:expat)))

(define-public r-ggtangle
  (package
    (name "r-ggtangle")
    (version "0.0.6")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "ggtangle" version))
       (sha256
        (base32 "1q24565y2icr8cs55cni2iyh22mqlk12nll19md96g4r3hbdq0al"))))
    (properties `((upstream-name . "ggtangle")))
    (build-system r-build-system)
    (propagated-inputs (list r-ggfun
                             r-ggplot2
                             r-ggrepel
                             r-igraph
                             r-rlang
                             r-yulab-utils))
    (native-inputs (list r-knitr))
    (home-page "https://cran.r-project.org/package=ggtangle")
    (synopsis "Draw network with data")
    (description
     "This package extends the ggplot2 plotting system to support network
visualization.  Inspired by ggtree, ggtangle is designed to work with network
associated data.")
    (license license:artistic2.0)))

(define-public r-ggtern
  (package
    (name "r-ggtern")
    (version "3.5.0")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "ggtern" version))
       (sha256
        (base32 "0ymly9vdzk7rd4p27m1262bm7fvim989yswgw3mr9y0422dn8awa"))))
    (properties `((upstream-name . "ggtern")))
    (build-system r-build-system)
    (propagated-inputs
     (list r-compositions
           r-ggplot2
           r-gridextra
           r-gtable
           r-hexbin
           r-latex2exp
           r-lattice
           r-mass
           r-plyr
           r-proto
           r-rlang
           r-scales))
    (home-page "http://www.ggtern.com")
    (synopsis "Extension to ggplot2 for ternary diagrams")
    (description
     "This package extends the functionality of ggplot2, providing the
capability to plot ternary diagrams for (a subset of) the ggplot2 geometries.
Additionally, ggtern has implemented several new geometries which are
unavailable to the standard ggplot2 release.")
    (license license:gpl2)))

(define-public r-tableone
  (package
    (name "r-tableone")
    (version "0.13.2")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "tableone" version))
       (sha256
        (base32 "1br78y68037g5v5jhgi9l393kj2msamdklim8ki40hmxk9bibkxi"))))
    (properties `((upstream-name . "tableone")))
    (build-system r-build-system)
    (propagated-inputs (list r-e1071
                             r-gmodels
                             r-labelled
                             r-mass
                             r-nlme
                             r-survey
                             r-zoo))
    (native-inputs (list r-geepack
                         r-knitr
                         r-lme4
                         r-lmertest
                         r-matrix
                         r-survival
                         r-testthat))
    (home-page "https://github.com/kaz-yos/tableone")
    (synopsis
     "Describe baseline characteristics with or without propensity score weights")
    (description
     "This package creates \"Table 1\", i.e., description of baseline patient
characteristics, which is essential in every medical research.  It supports
both continuous and categorical variables, as well as p-values and
standardized mean differences.  Weighted data are supported via the
@code{survey} package.")
    (license license:gpl2)))

(define-public r-tablerdash
  (package
    (name "r-tablerdash")
    (version "0.1.5")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "tablerDash" version))
       (sha256
        (base32
         "0cjidfkxwc56xj9rka0ba80hnwvm05wfvpw65wwmr3l56smnfcbz"))
       ;; Delete minified JavaScript
       (snippet
        '(for-each delete-file
                   '("inst/tablerDash-0.1.0/require.min.js"
                     "inst/bootstrap-4.0.0/bootstrap.bundle.min.js")))))
    (properties `((upstream-name . "tablerDash")))
    (build-system r-build-system)
    (arguments
     (list
      #:modules '((guix build r-build-system)
                  (guix build minify-build-system)
                  (guix build utils)
                  (ice-9 match))
      #:imported-modules `(,@%r-build-system-modules
                           (guix build minify-build-system))
      #:phases
      '(modify-phases %standard-phases
         (add-after 'unpack 'process-javascript
           (lambda* (#:key inputs #:allow-other-keys)
             (with-directory-excursion "inst"
               (for-each (match-lambda
                           ((source . target)
                            (minify source #:target target)))
                         `((,(assoc-ref inputs "js-requirejs")
                            . "tablerDash-0.1.0/require.min.js")
                           (,(assoc-ref inputs "js-bootstrap")
                            . "bootstrap-4.0.0/bootstrap.bundle.min.js")))))))))
    (propagated-inputs
     (list r-htmltools r-shiny))
    (native-inputs
     `(("esbuild" ,esbuild)
       ("js-requirejs"
        ,(origin
           (method url-fetch)
           (uri "https://raw.githubusercontent.com/requirejs/requirejs/2.3.5/require.js")
           (sha256
            (base32
             "06w32mwqii9cx409ivda88z58qbkcdb4p6hf6jawchsgagaziyds"))))
       ("js-bootstrap"
        ,(origin
           (method url-fetch)
           (uri "https://raw.githubusercontent.com/twbs/bootstrap/\
v4.0.0/dist/js/bootstrap.bundle.js")
           (sha256
            (base32
             "0cvfqffn45vfbj3fk6wmrhkyndhk4id89vgydssbbzxjkfwprfrj"))))))
    (home-page "https://rinterface.github.io/tablerDash/")
    (synopsis "Tabler API for Shiny")
    (description
     "This package provides an R interface to the
@url{https://tabler.io,Tabler} HTML template.  tablerDash is a light Bootstrap
4 dashboard template.  There are different layouts available such as a one
page dashboard or a multi-page template, where the navigation menu is
contained in the navigation bar.")
    (license license:gpl2+)))

(define-public r-spdl
  (package
    (name "r-spdl")
    (version "0.0.5")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "spdl" version))
       (sha256
        (base32 "185qzlwac7acq126xpvcd71nv25zgkrdr8m73gv2sn1zxj78hyid"))))
    (properties `((upstream-name . "spdl")))
    (build-system r-build-system)
    (propagated-inputs (list r-rcppspdlog))
    (home-page "https://github.com/eddelbuettel/spdl")
    (synopsis "Easier use of RcppSpdlog functions via wrapper")
    (description
     "Logging functions in @code{RcppSpdlog} provide access to the logging
functionality from the spdlog C++ library.  This package offers shorter
convenience wrappers for the R functions which match the C++ functions, namely
via, say, @code{spdl::debug()} at the debug level.  The actual formatting is
done by the @code{fmt::format()} function from the fmtlib library (that is
also @code{std::format()} in C++20 or later).")
    (license license:gpl2+)))

(define-public r-spelling
  (package
    (name "r-spelling")
    (version "2.3.1")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "spelling" version))
       (sha256
        (base32
         "1mww2czkfrb1xvjbks7g1xhr8nx1v9mikb2lc3ynn6j2rp9zgwgp"))))
    (properties `((upstream-name . "spelling")))
    (build-system r-build-system)
    (propagated-inputs
     (list r-commonmark r-hunspell r-knitr r-xml2))
    (home-page "https://docs.ropensci.org/spelling/")
    (synopsis "Tools for spell checking in R")
    (description
     "This is an R package for spell checking common document formats
including LaTeX, markdown, manual pages, and DESCRIPTION files.  It includes
utilities to automate checking of documentation and vignettes as a unit test
during @code{R CMD check}.  Both British and American English are supported
out of the box and other languages can be added.  In addition, packages may
define a wordlist to allow custom terminology without having to abuse
punctuation.")
    (license license:expat)))

(define-public r-caper
  (package
    (name "r-caper")
    (version "1.0.3")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "caper" version))
       (sha256
        (base32 "1f1mw54gv1r40wrrsznhgffdj8ggrwihiwdd8wyqccyvqm49fxjg"))))
    (properties `((upstream-name . "caper")))
    (build-system r-build-system)
    (propagated-inputs (list r-ape r-mass r-mvtnorm))
    (home-page "https://cran.r-project.org/package=caper")
    (synopsis "Comparative analyses of phylogenetics and evolution in R")
    (description
     "This package provides functions for performing phylogenetic comparative
analyses.")
    (license license:gpl2+)))

(define-public r-crosstalk
  (package
    (name "r-crosstalk")
    (version "1.2.1")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "crosstalk" version))
       (sha256
        (base32
         "1w8lc3hcd1nlw541880vs3agk2i6bilyapnq9lcs3mfn2s2g0338"))
       (snippet
        '(for-each delete-file
                   (list "inst/lib/jquery/jquery.min.js"
                         "inst/lib/ionrangeslider/js/ion.rangeSlider.min.js"
                         "inst/lib/selectize/js/selectize.min.js"
                         "inst/www/js/crosstalk.min.js")))))
    (build-system r-build-system)
    (properties
     '((updater-extra-native-inputs . ("r-sass" "r-shiny"))))
    (arguments
     (list
      #:modules '((guix build r-build-system)
                  (guix build minify-build-system)
                  (guix build utils)
                  (ice-9 match))
      #:imported-modules `(,@%r-build-system-modules
                           (guix build minify-build-system))
      #:phases
      #~(modify-phases (@ (guix build r-build-system) %standard-phases)
          (add-after 'unpack 'replace-bundled-minified-JavaScript
            (lambda* (#:key inputs #:allow-other-keys)
              (with-directory-excursion "inst/"
                (copy-file (search-input-file inputs
                                              "/share/javascript/selectize.min.js")
                           "lib/selectize/js/selectize.min.js")
                (for-each (match-lambda
                            ((source . target)
                             (minify source #:target target)))
                          `(("lib/jquery/jquery.js"
                             . "lib/jquery/jquery.min.js")
                            ("lib/ionrangeslider/js/ion.rangeSlider.js"
                             . "lib/ionrangeslider/js/ion.rangeSlider.min.js")
                            ("www/js/crosstalk.js"
                             . "www/js/crosstalk.min.js")))))))))
    (propagated-inputs
     (list r-htmltools r-jsonlite r-lazyeval r-r6))
    (native-inputs
     (list esbuild js-selectize r-sass r-shiny r-testthat))
    (home-page "https://rstudio.github.io/crosstalk/")
    (synopsis "Inter-widget interactivity for HTML widgets")
    (description
     "This package provides building blocks for allowing HTML widgets to
communicate with each other, with Shiny or without (i.e., static @code{.html}
files).  It currently supports linked brushing and filtering.")
    (license license:expat)))

(define-public r-rook
  (package
    (name "r-rook")
    (version "1.2")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "Rook" version))
       (sha256
        (base32
         "0qjziszrrwsp1mbykps3yf5r98q83cyd4jzpgi7gvbsd2ssy96n7"))))
    (properties `((upstream-name . "Rook")))
    (build-system r-build-system)
    (propagated-inputs (list r-brew))
    (home-page "https://cran.r-project.org/web/packages/Rook")
    (synopsis "Web server interface for R")
    (description
     "This package contains the Rook specification and convenience software
for building and running Rook applications.  A Rook application is an R
reference class object that implements a @code{call} method or an R closure
that takes exactly one argument, an environment, and returns a list with three
named elements: the @code{status}, the @code{headers}, and the @code{body}.")
    (license license:gpl2)))

(define-public r-miniui
  (package
    (name "r-miniui")
    (version "0.1.2")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "miniUI" version))
       (sha256
        (base32
         "0by2g7wfn4jwzz79hw2y72nxsdl67cr6ix902wj8blw4flglhyh1"))))
    (properties `((upstream-name . "miniUI")))
    (build-system r-build-system)
    (propagated-inputs
     (list r-htmltools r-shiny))
    (home-page "https://cran.r-project.org/web/packages/miniUI/")
    (synopsis "Shiny UI widgets for small screens")
    (description
     "This package provides UI widget and layout functions for writing Shiny apps that
work well on small screens.")
    (license license:gpl3)))

(define-public r-minty
  (package
    (name "r-minty")
    (version "0.0.5")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "minty" version))
       (sha256
        (base32 "0sr25z83v00hvq5c80jp70yialnay6c3fjykn1j8clr9s2z5ins7"))))
    (properties
     '((upstream-name . "minty")
       (updater-extra-native-inputs . ("tzdata-for-tests"))))
    (build-system r-build-system)
    (propagated-inputs (list r-cpp11 r-tzdb))
    (native-inputs (list r-hms r-testthat r-withr tzdata-for-tests))
    (home-page "https://gesistsa.github.io/minty/")
    (synopsis "Minimal type guesser")
    (description
     "This is a port of the type guesser from the @code{readr} package, the
so-called readr first edition parsing engine, now superseded by vroom.")
    (license license:expat)))

(define-public r-mirt
  (package
    (name "r-mirt")
    (version "1.44.0")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "mirt" version))
       (sha256
        (base32 "1r8nv5669bacn3rq6lczc0fm0dgcm1kn8lxjd07lwkg2h4mjir6f"))))
    (properties `((upstream-name . "mirt")))
    (build-system r-build-system)
    (propagated-inputs (list r-dcurver
                             r-deriv
                             r-gparotation
                             r-gridextra
                             r-lattice
                             r-matrix
                             r-mgcv
                             r-pbapply
                             r-rcpp
                             r-rcpparmadillo
                             r-simdesign
                             r-vegan))
    (native-inputs (list r-boot r-knitr r-nonnest2))
    (home-page "https://philchalmers.github.io/mirt/")
    (synopsis "Multidimensional item response theory")
    (description
     "This is a package for the analysis of discrete response data using
unidimensional and multidimensional item analysis models under the Item
Response Theory paradigm (Chalmers (2012) <doi:10.18637/jss.v048.i06>).
Exploratory and confirmatory item factor analysis models are estimated with
quadrature (EM) or stochastic (MHRM) methods.  Confirmatory bi-factor and
two-tier models are available for modeling item testlets using dimension
reduction EM algorithms, while multiple group analyses and mixed effects
designs are included for detecting differential item, bundle, and test
functioning, and for modeling item and person covariates.  Finally, latent
class models such as the DINA, DINO, multidimensional latent class, mixture
IRT models, and zero-inflated response models are supported.")
    (license license:gpl3+)))

(define-public r-feather
  (package
    (name "r-feather")
    (version "0.3.5")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "feather" version))
       (sha256
        (base32
         "1gxd0h2m56sjjlzn4dry6s13nddxc4l5i11gsvavaf2dwbahdzsh"))))
    (build-system r-build-system)
    (propagated-inputs
     (list r-hms r-rcpp r-tibble))
    (native-inputs (list r-testthat))
    (home-page "https://github.com/wesm/feather")
    (synopsis "R Bindings to the Feather API")
    (description "Read and write feather files, a lightweight binary columnar
data store designed for maximum speed.")
    (license license:asl2.0)))

(define-public r-mapdata
  (package
    (name "r-mapdata")
    (version "2.3.1")
    (source (origin
              (method url-fetch)
              (uri (cran-uri "mapdata" version))
              (sha256
               (base32
                "1m2r4c8f7fp900g3sdjbfxxnxjla86hn75jd8hi96ms188p0j8b0"))))
    (properties `((upstream-name . "mapdata")))
    (build-system r-build-system)
    (propagated-inputs (list r-maps))
    (home-page "https://cran.r-project.org/package=mapdata")
    (synopsis "Extra map databases")
    (description
     "This is a supplement to the @code{maps} package providing the larger
and/or higher-resolution databases.")
    (license license:gpl2)))

(define-public r-maps
  (package
    (name "r-maps")
    (version "3.4.3")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "maps" version))
       (sha256
        (base32
         "1f48spc254c0gvbyi57gxx5i5kyvszhgp29zvc6jhh806d2ljv9v"))))
    (build-system r-build-system)
    (home-page "https://cran.r-project.org/web/packages/maps")
    (synopsis "Draw geographical maps")
    (description "This package provides an R module for display of maps.
Projection code and larger maps are in separate packages (@code{mapproj} and
@code{mapdata}).")
    (license license:gpl2)))

(define-public r-mapproj
  (package
    (name "r-mapproj")
    (version "1.2.12")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "mapproj" version))
       (sha256
        (base32
         "0xv03pbsdcnyzy0p17sdwxkyzq9zjsvab2lylhslk2692wnv240j"))))
    (build-system r-build-system)
    (propagated-inputs (list r-maps))
    (home-page "https://cran.r-project.org/web/packages/mapproj")
    (synopsis "Map projection in R")
    (description "This package converts latitude/longitude into projected
coordinates.")
    (license (list license:gpl2          ; The R interface
                   license:lpl1.02))))   ; The C code

(define-public r-rgooglemaps
  (package
    (name "r-rgooglemaps")
    (version "1.5.1")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "RgoogleMaps" version))
       (sha256
        (base32
         "197q5i2sky824dwq0x4hhrpkrsd1b6f9qg06mjlwb89mv4vnrzhl"))))
    (properties `((upstream-name . "RgoogleMaps")))
    (build-system r-build-system)
    (propagated-inputs
     (list r-png))
    (home-page "https://cran.r-project.org/web/packages/RgoogleMaps")
    (synopsis "Use Google Maps in R")
    (description "This package serves two purposes:
@enumerate
@item Provide a comfortable R interface to query the Google server for static
  maps, and
@item Use the map as a background image to overlay plots within R.  This
  requires proper coordinate scaling.
@end enumerate\n")
    (license license:gpl2+)))

(define-public r-gensa
  (package
    (name "r-gensa")
    (version "1.1.14.1")
    (source (origin
              (method url-fetch)
              (uri (cran-uri "GenSA" version))
              (sha256
               (base32
                "0zrprs5gb0pwl249gnvs675ph5f59z2dhis562xfmjbhsv5m9p9g"))))
    (properties `((upstream-name . "GenSA")))
    (build-system r-build-system)
    (home-page "https://cran.r-project.org/package=GenSA")
    (synopsis "Generalized simulated annealing")
    (description "This package performs search for the global minimum of a very
complex non-linear objective function with a very large number of optima.")
    (license license:gpl2)))

(define-public r-geojsonr
  (package
    (name "r-geojsonr")
    (version "1.1.2")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "geojsonR" version))
       (sha256
        (base32 "10li5xj0vx6a86nccwql4inwfbjycvaxqfbjdp4h1p5qxyibnls3"))))
    (properties `((upstream-name . "geojsonR")))
    (build-system r-build-system)
    (propagated-inputs (list r-r6 r-rcpp r-rcpparmadillo))
    (native-inputs (list r-knitr r-testthat))
    (home-page "https://github.com/mlampros/geojsonR")
    (synopsis "GeoJson processing toolkit")
    (description
     "This package includes functions for processing @code{GeoJson} objects
relying on RFC 7946.  The geojson encoding is based on json11, a tiny JSON
library for C++11.  Furthermore, the source code is exported in R through the
Rcpp and @code{RcppArmadillo} packages.")
    (license license:expat)))

(define-public r-geos
  (package
    (name "r-geos")
    (version "0.2.4")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "geos" version))
       (sha256
        (base32 "03cxm9rby7qmk9apqk3sh373rnzqcrj23cn6q153gq93lx372b8n"))))
    (properties
     '((upstream-name . "geos")
       (updater-extra-native-inputs . ("r-vctrs"))))
    (build-system r-build-system)
    (propagated-inputs (list r-libgeos r-wk))
    (native-inputs (list r-testthat r-vctrs))
    (home-page "https://paleolimbot.github.io/geos/")
    (synopsis "Open Source Geometry Engine (GEOS) R API")
    (description
     "This package provides an R API to the Open Source Geometry Engine (GEOS)
library and a vector format with which to efficiently store GEOS geometries.
High-performance functions to extract information from, calculate
relationships between, and transform geometries are provided.  Finally,
facilities to import and export geometry vectors to other spatial formats are
provided.")
    (license license:expat)))

(define-public r-geosphere
  (package
    (name "r-geosphere")
    (version "1.5-20")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "geosphere" version))
       (sha256
        (base32
         "01cwlrbqi216a19h9721i0vj7vakrybybqkicbg9pwyv6c2hy8cq"))))
    (build-system r-build-system)
    (propagated-inputs (list r-rcpp r-sp))
    (home-page "https://cran.r-project.org/web/packages/geosphere")
    (synopsis "Spherical trigonometry")
    (description "This package computes spherical trigonometry for geographic
applications.  That is, compute distances and related measures for angular
(longitude/latitude) locations.")
    (license license:gpl3+)))

(define-public r-getip
  (package
    (name "r-getip")
    (version "0.1-4")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "getip" version))
       (sha256
        (base32 "0qyld6sy1i7kmbvcyg3vdv31qdyj81n54v6gvknb7nrqwwl8bgv3"))))
    (properties `((upstream-name . "getip")))
    (build-system r-build-system)
    (arguments (list #:tests? #false))  ;tests net networking
    (home-page "https://cran.r-project.org/package=getip")
    (synopsis "IP address lookup")
    (description
     "This package is a micro-package for getting your IP address,
either the local/internal or the public/external one.  Currently only IPv4
addresses are supported.")
    (license license:bsd-2)))

(define-public r-jpeg
  (package
    (name "r-jpeg")
    (version "0.1-11")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "jpeg" version))
       (sha256
        (base32
         "0a9pn0rshqx1r9kqkg1n4m1i98plfdaj2h0y8055kk7v92yyyf91"))))
    (build-system r-build-system)
    (inputs (list libjpeg-turbo))
    (home-page "https://www.rforge.net/jpeg/")
    (synopsis "Read and write JPEG images with R")
    (description "This package provides a way to read, write and display
bitmap images stored in the JPEG format with R.  It can read and write both
files and in-memory raw vectors.")
    (license license:gpl2+)))

(define-public r-ggmap
  (package
    (name "r-ggmap")
    (version "4.0.1")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "ggmap" version))
       (sha256
        (base32
         "0ryl8zglgkq0kpkfyi9xq6kc7alv0zjaaqw21iqj7f5jj1x0l9df"))))
    (build-system r-build-system)
    (propagated-inputs
     (list r-bitops
           r-cli
           r-digest
           r-dplyr
           r-ggplot2
           r-glue
           r-httr
           r-jpeg
           r-magrittr
           r-plyr
           r-png
           r-purrr
           r-rlang
           r-scales
           r-stringr
           r-tibble
           r-tidyr))
    (native-inputs (list r-testthat))
    (home-page "https://github.com/dkahle/ggmap")
    (synopsis "Spatial visualization with ggplot2")
    (description "This package provides a collection of functions to visualize
spatial data and models on top of static maps from various online sources (e.g
Google Maps and Stamen Maps).  It includes tools common to those tasks,
including functions for geolocation and routing.")
    (license license:gpl2)))

(define-public r-ggmosaic
  (package
    (name "r-ggmosaic")
    (version "0.3.3")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "ggmosaic" version))
       (sha256
        (base32 "1zm1zfbd0qk6icw65m9hz1hgyqj632ibq3qilidvx5jy7jh8nbpy"))))
    (properties `((upstream-name . "ggmosaic")))
    (build-system r-build-system)
    (propagated-inputs (list r-dplyr
                             r-ggplot2
                             r-ggrepel
                             r-plotly
                             r-productplots
                             r-purrr
                             r-rlang
                             r-scales
                             r-tidyr))
    (native-inputs (list r-knitr))
    (home-page "https://github.com/haleyjeppson/ggmosaic")
    (synopsis "Mosaic plots in the ggplot2 framework")
    (description
     "This package provides mosaic plots for the ggplot2 framework.  Mosaic
plot functionality is provided in a single ggplot2 layer by calling the
@code{geom} @code{mosaic}.")
    (license license:gpl2+)))

(define-public r-haven
  (package
    (name "r-haven")
    (version "2.5.5")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "haven" version))
       (sha256
        (base32
         "19f9n7a4g90fdwhx66cjyxmzm5zdgwqkawk8ry587qb06yfcv0ll"))
       (modules '((guix build utils)))
       (snippet
        ;; unvendor readstat
        '(delete-file-recursively "src/readstat"))))
    (build-system r-build-system)
    (properties
     '((updater-extra-inputs . ("readstat"))))
    (arguments
     '(#:phases
       (modify-phases %standard-phases
         (add-after 'unpack 'unbundle-readstat
           (lambda _
             ;; We’re not building readstat.
             (substitute* "configure"
               (("^PKG_CONFIG_NAME=\"zlib\"")
                "PKG_CONFIG_NAME=\"readstat zlib\"")
               (("^PKG_LIBS=\"-lz\"")
                "PKG_LIBS=\"-lz -lreadstat\"\n")
               (("exit 1") "")))))))  ;don't be so dramatic!
    (inputs
     (list readstat zlib))
    (native-inputs
     (list pkg-config r-knitr r-testthat))
    (propagated-inputs
     (list r-cli
           r-cpp11
           r-forcats
           r-hms
           r-lifecycle
           r-readr
           r-rlang
           r-tibble
           r-tidyselect
           r-vctrs))
    (home-page "https://haven.tidyverse.org")
    (synopsis "Import and export SPSS, Stata and SAS files")
    (description
     "This package lets you import foreign statistical formats into R via the
@url{https://github.com/WizardMac/ReadStat,ReadStat} C library.")
    (license license:expat)))

(define-public r-amap
  (package
    (name "r-amap")
    (version "0.8-20")
    (source (origin
              (method url-fetch)
              (uri (cran-uri "amap" version))
              (sha256
               (base32
                "0w65z1jqg6c9fp6knv9ps5f22f4jk94hbihr6l0hbmijiznbffwq"))))
    (build-system r-build-system)
    (native-inputs
     (list gfortran))
    (home-page "http://mulcyber.toulouse.inra.fr/projects/amap/")
    (synopsis "Another multidimensional analysis package")
    (description "This package provides tools for clustering and principal
component analysis (with robust methods, and parallelized functions).")
    (license license:gpl2+)))

(define-public r-ape
  (package
    (name "r-ape")
    (version "5.8-1")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "ape" version))
       (sha256
        (base32
         "13id88b2g2m7zgp3r8nigyainlpbld1z2d7n87bplnailzfy7kfn"))))
    (build-system r-build-system)
    (propagated-inputs
     (list r-digest r-lattice r-nlme r-rcpp))
    (home-page "http://ape-package.ird.fr/")
    (synopsis "Analyses of phylogenetics and evolution")
    (description
     "This package provides functions for reading, writing, plotting, and
manipulating phylogenetic trees, analyses of comparative data in a
phylogenetic framework, ancestral character analyses, analyses of
diversification and macroevolution, computing distances from DNA sequences,
and several other tools.")
    (license license:gpl2+)))

(define-public r-abbyyr
  (package
    (name "r-abbyyr")
    (version "0.5.5")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "abbyyR" version))
       (sha256
        (base32
         "1vldnd3dg89aj6a73nhirirqddbfdrnzhb5m3679i60sark8nk6r"))))
    (properties `((upstream-name . "abbyyR")))
    (build-system r-build-system)
    (propagated-inputs
     (list r-curl
           r-httr
           r-plyr
           r-progress
           r-readr
           r-xml))
    (native-inputs (list r-knitr r-testthat))
    (home-page "https://github.com/soodoku/abbyyR")
    (synopsis "Access to Abbyy Optical Character Recognition (OCR) API")
    (description
     "This package provides tools to get text from images of text using Abbyy
Cloud Optical Character Recognition (OCR) API.  With abbyyyR, one can easily
OCR images, barcodes, forms, documents with machine readable zones, e.g.
passports and get the results in a variety of formats including plain text and
XML.  To learn more about the Abbyy OCR API, see @url{http://ocrsdk.com/}.")
    (license license:expat)))

(define-public r-colorspace
  (package
    (name "r-colorspace")
    (version "2.1-1")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "colorspace" version))
       (sha256
        (base32 "02ydb0vncck0l9shfbz07gymdy5l2vinb0miivyb1r6nykjww8g7"))))
    (build-system r-build-system)
    ;; Tests require r-vcd, which depends on this package.
    (arguments (list #:tests? #false))
    (native-inputs
     (list r-knitr))
    (home-page "https://cran.r-project.org/web/packages/colorspace")
    (synopsis "Color space manipulation")
    (description
     "This package carries out a mapping between assorted color spaces
including RGB, HSV, HLS, CIEXYZ, CIELUV, HCL (polar CIELUV), CIELAB and polar
CIELAB.  Qualitative, sequential, and diverging color palettes based on HCL
colors are provided.")
    (license license:bsd-3)))

(define-public r-glue
  (package
    (name "r-glue")
    (version "1.8.0")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "glue" version))
       (sha256
        (base32
         "183j9gpffmi30lfifl8d9sq1l25f8dgsgqd3blpndf4rm15kcvy8"))))
    (properties
     ;; knitr depends on glue, so we can't add knitr here to build the
     ;; vignettes.  Same with testthat
     '((updater-ignored-native-inputs . ("r-knitr" "r-testthat"))))
    (build-system r-build-system)
    (arguments (list #:tests? #false))
    (home-page "https://github.com/tidyverse/glue")
    (synopsis "Interpreted string literals")
    (description
     "This package provides an implementation of interpreted string literals,
inspired by Python's Literal String Interpolation (PEP-0498) and
Docstrings (PEP-0257) and Julia's Triple-Quoted String Literals.")
    (license license:expat)))

(define-public r-glmnetutils
  (package
    (name "r-glmnetutils")
    (version "1.1.9")
    (source (origin
              (method url-fetch)
              (uri (cran-uri "glmnetUtils" version))
              (sha256
               (base32
                "0rh07i9j6bxiqcl84d8jnn7dzqdwfdzak7w8bf4j4521r24mwm01"))))
    (properties `((upstream-name . "glmnetUtils")))
    (build-system r-build-system)
    (propagated-inputs
     (list r-glmnet r-matrix))
    (native-inputs (list r-knitr r-mass r-testthat))
    (home-page "https://github.com/hongooi73/glmnetUtils")
    (synopsis
     "Streamline the process of fitting elastic net models with glmnet")
    (description
     "This package provides a collection of tools to streamline the
process of fitting elastic net models with @code{glmnet}.  In addition
to providing a formula interface, it also features a function
@code{cva.glmnet} to do crossvalidation for both α and λ, as well as
some utility functions.")
    (license license:gpl2)))

(define-public r-paletteer
  (package
    (name "r-paletteer")
    (version "1.6.0")
    (source (origin
              (method url-fetch)
              (uri (cran-uri "paletteer" version))
              (sha256
               (base32
                "1n4jim2fgyff6c5mjridq92jgvr5m2qgwfsgvhyj1pwk1hq21pmm"))))
    (properties `((upstream-name . "paletteer")))
    (build-system r-build-system)
    (propagated-inputs (list r-prismatic r-rematch2 r-rlang r-rstudioapi))
    (native-inputs (list r-testthat))
    (home-page "https://github.com/EmilHvitfeldt/paletteer")
    (synopsis "Comprehensive collection of color palettes")
    (description
     "The choices of color palettes in R can be quite overwhelming with palettes
spread over many packages with many different API's.  This package aims to
collect all color palettes across the R ecosystem under the same package with
a streamlined API.")
    (license license:gpl3)))

(define-public r-palmerpenguins
  (package
    (name "r-palmerpenguins")
    (version "0.1.1")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "palmerpenguins" version))
       (sha256
        (base32
         "1d1h3bfx750is4qqj4w00rcigk9rrdy69bvd5bgqz5y7ls5x8h1a"))))
    (properties
     `((upstream-name . "palmerpenguins")))
    (build-system r-build-system)
    (home-page "https://allisonhorst.github.io/palmerpenguins/")
    (synopsis "Palmer Archipelago (Antarctica) penguin data")
    (description
     "This package includes size measurements, clutch observations, and blood
isotope ratios for adult foraging Adélie, Chinstrap, and Gentoo penguins
observed on islands in the Palmer Archipelago near Palmer Station, Antarctica.
Data were collected and made available by Dr. Kristen Gorman and the Palmer
Station Long Term Ecological Research (LTER) Program.")
    (license license:cc0)))

(define-public r-party
  (package
    (name "r-party")
    (version "1.3-18")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "party" version))
       (sha256
        (base32 "19snk50f1b1sw2ysmfn2d4qqzkm0hz5qfpgahkwgi5vql89p9xqy"))))
    (properties
     '((upstream-name . "party")
       (updater-extra-native-inputs . ("r-mlbench" "r-vcd"))))
    (build-system r-build-system)
    (propagated-inputs (list r-coin
                             r-modeltools
                             r-mvtnorm
                             r-sandwich
                             r-strucchange
                             r-survival
                             r-zoo))
    (native-inputs (list r-mlbench r-vcd))
    (home-page "https://party.r-forge.r-project.org")
    (synopsis "Laboratory for recursive partitioning")
    (description
     "This package provides a computational toolbox for recursive
partitioning.  The core of the package is @code{ctree()}, an implementation of
conditional inference trees which embed tree-structured regression models into
a well defined theory of conditional inference procedures.  This
non-parametric class of regression trees is applicable to all kinds of
regression problems, including nominal, ordinal, numeric, censored as well as
multivariate response variables and arbitrary measurement scales of the
covariates.  Based on conditional inference trees, @code{cforest()} provides
an implementation of Breiman's random forests.  The function @code{mob()}
implements an algorithm for recursive partitioning based on parametric
models (e.g. linear models, GLMs or survival regression) employing parameter
instability tests for split selection.  Extensible functionality for
visualizing tree-structured regression models is available.")
    (license license:gpl2)))

(define-public r-pastecs
  (package
   (name "r-pastecs")
   (version "1.4.2")
   (source (origin
            (method url-fetch)
            (uri (cran-uri "pastecs" version))
            (sha256
             (base32
              "1y3nngdmslbs1rls0n2nbx8jpp9z3nvv11w1z6rff6v0ky05ddj3"))))
   (build-system r-build-system)
   (propagated-inputs
    (list r-boot))
   (native-inputs (list r-knitr r-svunit))
   (home-page "https://github.com/phgrosjean/pastecs")
   (synopsis "Analysis of space-time ecological series")
   (description
    "This package provides functions for regulation, decomposition and analysis
of space-time series.  The @code{pastecs} library is a PNEC-Art4 and IFREMER
initiative to bring PASSTEC 2000 functionalities to R.")
   (license license:gpl2+)))

(define-public r-partykit
  (package
   (name "r-partykit")
   (version "1.2-24")
   (source (origin
             (method url-fetch)
             (uri (cran-uri "partykit" version))
             (sha256
              (base32
               "1zy92iwhl9979mqa5bxz50k66vxysn07zd1z40z0y44g8msnph20"))))
   (properties
    '((updater-extra-native-inputs . ("r-mlbench")))) ;for tests
   (build-system r-build-system)
   ;; Vignettes require r-psychotree, which depends on this package.
   (arguments (list #:test-types '(list "tests")))
   (propagated-inputs
    (list r-formula
          r-inum
          r-libcoin
          r-mvtnorm
          r-rpart
          r-survival))
   (native-inputs (list r-coin
                        r-mlbench
                        r-party
                        r-pmml
                        r-psychotools
                        r-sandwich
                        r-strucchange
                        r-xml))
   (home-page "https://partykit.R-Forge.R-project.org/partykit")
   (synopsis "Toolkit for recursive partytioning")
   (description
    "This package provides a toolkit with infrastructure for representing,
summarizing, and visualizing tree-structured regression and classification
models.")
   (license license:gpl2+)))

(define-public r-plogr
  (package
    (name "r-plogr")
    (version "0.2.0")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "plogr" version))
       (sha256
        (base32
         "0a8dhzlna79ggyhfr0nncgh15a9n6r0dsz664pz0ah323wpblqqf"))))
    (build-system r-build-system)
    (home-page "https://github.com/krlmlr/plogr")
    (synopsis "R bindings for the plog C++ logging library")
    (description
     "This package provides the header files for a stripped-down version of
the plog header-only C++ logging library, and a method to log to R's standard
error stream.")
    (license license:expat)))

(define-public r-pls
  (package
    (name "r-pls")
    (version "2.8-5")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "pls" version))
       (sha256
        (base32 "1krkl11b90w4hbdj168x4x9mvifwmx8ia265gr6gl8c99j6h2ac0"))))
    (build-system r-build-system)
    (native-inputs (list r-runit r-testthat))
    (home-page "https://mevik.net/work/software/pls.html")
    (synopsis "Partial Least Squares and Principal Component Regression")
    (description
     "The pls package implements multivariate regression methods: Partial Least
Squares Regression (@dfn{PLSR}), Principal Component Regression (@dfn{PCR}), and
Canonical Powered Partial Least Squares (@dfn{CPPLS}).  It supports:

@itemize
@item several algorithms: the traditional orthogonal scores (@dfn{NIPALS}) PLS
algorithm, kernel PLS, wide kernel PLS, Simpls, and PCR through @code{svd}
@item multi-response models (or @dfn{PLS2})
@item flexible cross-validation
@item Jackknife variance estimates of regression coefficients
@item extensive and flexible plots: scores, loadings, predictions, coefficients,
(R)MSEP, R², and correlation loadings
@item formula interface, modelled after @code{lm()}, with methods for predict,
print, summary, plot, update, etc.
@item extraction functions for coefficients, scores, and loadings
@item MSEP, RMSEP, and R² estimates
@item multiplicative scatter correction (@dfn{MSC})
@end itemize\n")
    (license license:gpl2)))

(define-public r-ps
  (package
    (name "r-ps")
    (version "1.9.1")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "ps" version))
       (sha256
        (base32 "0zfzlifhg88cfk1sg4l9sgai0qinjdjy2wcb17z4ls47xc5kq2bg"))))
    (properties
     ;; We can't have r-testthat among the inputs, because that would lead to
     ;; a dependency cycle.
     '((updater-ignored-native-inputs . ("r-testthat"))))
    (build-system r-build-system)
    ;; Tests depend on r-testthat, which depends indirectly on r-ps.
    (arguments (list #:tests? #false))
    (home-page "https://ps.r-lib.org")
    (synopsis "List, query, and manipulate system processes")
    (description
     "The ps package implements an API to list, query, and manipulate system
processes.  Most of its code is based on the @code{psutil} Python package.")
    (license license:bsd-3)))

(define-public r-psychometric
  (package
    (name "r-psychometric")
    (version "2.4")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "psychometric" version))
       (sha256
        (base32 "1mlggzw80pb7kfykva1s4ic726l8dckrgik2519njh32ycvk9x1s"))))
    (properties `((upstream-name . "psychometric")))
    (build-system r-build-system)
    (propagated-inputs (list r-dplyr r-multilevel r-nlme r-purrr))
    (home-page "https://cran.r-project.org/package=psychometric")
    (synopsis "Applied psychometric theory")
    (description
     "This package contains functions useful for correlation theory,
meta-analysis (validity-generalization), reliability, item analysis,
inter-rater reliability, and classical utility.")
    (license license:gpl2+)))

(define-public r-pkgbuild
  (package
    (name "r-pkgbuild")
    (version "1.4.8")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "pkgbuild" version))
       (sha256
        (base32 "1jr4k43vj62hw8ak076pky7a68gz2kz6rwqzyd9c83z95hh5jhif"))))
    (properties
     ;; We can't have r-testthat among the inputs, because that would lead to
     ;; a dependency cycle.
     '((updater-ignored-native-inputs . ("r-testthat"
                                         "r-knitr"
                                         "r-rmarkdown"
                                         "r-withr"))))
    (build-system r-build-system)
    ;; Tests require r-testthat, but that package indirectly depends on
    ;; r-pkgbuild.
    (arguments (list #:tests? #false))
    (propagated-inputs
     (list r-callr r-cli r-desc r-processx r-r6))
    (home-page "https://github.com/r-pkgs/pkgbuild")
    (synopsis "Find tools needed to build R packages")
    (description
     "This package provides functions used to build R packages.  It locates
compilers needed to build R packages on various platforms and ensures the PATH
is configured appropriately so R can use them.")
    (license license:gpl3)))

(define-public r-pkgload
  (package
    (name "r-pkgload")
    (version "1.4.0")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "pkgload" version))
       (sha256
        (base32
         "0jbmlvii40q6ymdhislmgby6dpf9585xl9d5cf8g4nn2kig8ir09"))))
    (properties
     ;; Avoid dependency cycle.
     '((updater-ignored-native-inputs . ("r-testthat"))))
    (build-system r-build-system)
    ;; Tests require r-testthat.  Adding it to the inputs would lead to a
    ;; dependency cycle.
    (arguments (list #:tests? #false))
    (propagated-inputs
     (list r-cli
           r-desc
           r-fs
           r-glue
           r-lifecycle
           r-pkgbuild
           r-processx
           r-rlang
           r-rprojroot
           r-withr))
    (home-page "https://github.com/r-lib/pkgload")
    (synopsis "Simulate package installation and attach")
    (description
     "This package simulates the process of installing a package and then
attaching it.  This is a key part of the @code{devtools} package as it allows
you to rapidly iterate while developing a package.")
    (license license:gpl3)))

(define-public r-pki
  (package
    (name "r-pki")
    (version "0.1-14")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "PKI" version))
       (sha256
        (base32 "0rkr3gf5aqkrxi134kwggsyj151nwcwndy8d8q2vfy5rfwcyh960"))))
    (properties `((upstream-name . "PKI")))
    (build-system r-build-system)
    (inputs (list openssl zlib))
    (propagated-inputs (list r-base64enc))
    (native-inputs (list pkg-config))
    (home-page "http://www.rforge.net/PKI")
    (synopsis "Public Key Infrastructure for R based on the X.509 standard")
    (description
     "This is a package containing Public Key Infrastructure functions such as
verifying certificates, RSA encryption and signing, which can be used to build
PKI infrastructure and perform cryptographic tasks.")
    ;; Either of these licenses.
    (license (list license:gpl2 license:gpl3))))

(define-public r-pvclust
  (package
   (name "r-pvclust")
   (version "2.2-0")
   (source (origin
            (method url-fetch)
            (uri (cran-uri "pvclust" version))
            (sha256
             (base32
              "0082icm54k2yq60k06qpr92a626k39j2jr0046lva4ylmhxqb4kq"))))
   (build-system r-build-system)
   (home-page "https://github.com/shimo-lab/pvclust")
   (synopsis
    "Hierarchical clustering with P-values via multiscale bootstrap resampling")
   (description "This package provides an implementation of multiscale bootstrap
resampling for assessing the uncertainty in hierarchical cluster analysis.  It
provides an AU (approximately unbiased) P-value as well as a BP (bootstrap probability)
value for each cluster in a dendrogram.")
    (license license:gpl2+)))

(define-public r-rcpp
  (package
    (name "r-rcpp")
    (version "1.0.14")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "Rcpp" version))
       (sha256
        (base32 "00l0791grrwkg4rkqb6k6d5x9qas9cizbgnv7iqy5qxhxx94ms3l"))))
    (build-system r-build-system)
    (home-page "https://www.rcpp.org")
    (synopsis "Seamless R and C++ integration")
    (description
     "The Rcpp package provides R functions as well as C++ classes which offer
a seamless integration of R and C++.  Many R data types and objects can be
mapped back and forth to C++ equivalents which facilitates both writing of new
code as well as easier integration of third-party libraries.  Documentation
about Rcpp is provided by several vignettes included in this package, via the
@code{Rcpp Gallery} site at <http://gallery.rcpp.org>, the paper by Eddelbuettel
and Francois (2011, JSS), and the book by Eddelbuettel (2013, Springer); see
@code{citation(\"Rcpp\")} for details on these last two.")
    (license license:gpl2+)))

(define-public r-rcppcctz
  (package
    (name "r-rcppcctz")
    (version "0.2.13")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "RcppCCTZ" version))
       (sha256
        (base32 "1wmbyaj08fbl4g47aq0mfkkvqwpah3d2j94fzc813dijxlsi847l"))))
    (properties
     `((upstream-name . "RcppCCTZ")
       (updater-extra-native-inputs . ("tzdata-for-tests"))))
    (build-system r-build-system)
    (propagated-inputs (list r-rcpp))
    (native-inputs (list r-tinytest tzdata-for-tests))
    (home-page "https://github.com/eddelbuettel/rcppcctz")
    (synopsis "Rcpp bindings for the CCTZ library")
    (description
     "Rcpp access to the CCTZ timezone library is provided.  CCTZ is a C++
library for translating between absolute and civil times using the rules of a
time zone.  The CCTZ source code is included in this package.")
    (license (list license:gpl2+
                   license:asl2.0)))) ;for CCTZ

(define-public r-rcppdate
  (package
    (name "r-rcppdate")
    (version "0.0.6")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "RcppDate" version))
       (sha256
        (base32 "0l3bzvr50j01g0h42nhlsnlz2b9l129n24hs0sj8h918rh1a8bxk"))))
    (properties `((upstream-name . "RcppDate")))
    (build-system r-build-system)
    (home-page "https://github.com/eddelbuettel/rcppdate")
    (synopsis "date C++ header library for date and time functionality")
    (description
     "This package provides a header-only C++ library is provided with support
for dates, time zones, ISO weeks, Julian dates, and Islamic dates.
@code{date} offers extensive date and time functionality for the C++11, C++14
and C++17 standards.  A slightly modified version has been accepted (along
with @file{tz.h}) as part of C++20.  This package regroups all header files
from the upstream repository so that other R packages can use them in their
C++ code.")
    (license license:gpl2+)))

(define-public r-rcppde
  (package
    (name "r-rcppde")
    (version "0.1.8")
    (source (origin
              (method url-fetch)
              (uri (cran-uri "RcppDE" version))
              (sha256
               (base32
                "07hrfvpkddc2yzs6bq52vmdymyry250pgizfxyb6mw47lcb7jjlf"))))
    (properties `((upstream-name . "RcppDE")))
    (build-system r-build-system)
    (propagated-inputs
     (list r-rcpp r-rcpparmadillo))
    (native-inputs (list r-deoptim r-lattice))
    (home-page "https://cran.r-project.org/package=RcppDE")
    (synopsis "Global optimization by differential evolution in C++")
    (description
     "This package provides an iteration of the @code{DEoptim} function.  It
performs global optimization by differential evolution.")
    (license license:gpl2+)))

(define-public r-rcppdist
  (package
    (name "r-rcppdist")
    (version "0.1.1")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "RcppDist" version))
       (sha256
        (base32 "02g57xwfipdcljv06krhm02dbqn9kfyj2km6rdg0a7vq9prwdz1x"))))
    (properties `((upstream-name . "RcppDist")))
    (build-system r-build-system)
    (propagated-inputs (list r-rcpp r-rcpparmadillo))
    (native-inputs (list r-knitr r-testthat))
    (home-page "https://github.com/duckmayr/RcppDist")
    (synopsis "Integration of additional probability distributions")
    (description
     "RcppDist provides a header-only C++ library with functions for
additional statistical distributions that can be called from C++ when writing
code using Rcpp or RcppArmadillo.  Functions are available that return a
@code{NumericVector} as well as doubles, and for multivariate or matrix
distributions, Armadillo vectors and matrices.")
    (license license:gpl2+)))

(define-public r-rcpphungarian
  (package
    (name "r-rcpphungarian")
    (version "0.3")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "RcppHungarian" version))
       (sha256
        (base32 "00wxi77ajnhwds1pnmhbxaykdaiyh6ayblif58sx9r5rvv055c1a"))))
    (properties `((upstream-name . "RcppHungarian")))
    (build-system r-build-system)
    (propagated-inputs (list r-rcpp))
    (native-inputs (list r-knitr r-testthat))
    (home-page "https://github.com/jsilve24/RcppHungarian")
    (synopsis "Solve minimum cost bipartite matching problems")
    (description
     "This package provides header library and R functions to solve minimum
cost bipartite matching problem using Huhn-Munkres algorithm (Hungarian
algorithm; <https://en.wikipedia.org/wiki/Hungarian_algorithm>; Kuhn (1955)
<doi:10.1002/nav.3800020109>).")
    (license license:gpl2+)))

(define-public r-rcppint64
  (package
    (name "r-rcppint64")
    (version "0.0.5")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "RcppInt64" version))
       (sha256
        (base32 "1h4lshkn3p3c7swygbpmkg0pa80xcp3f9alck5q4bmml61hicwjk"))))
    (properties `((upstream-name . "RcppInt64")))
    (build-system r-build-system)
    (propagated-inputs (list r-rcpp))
    (native-inputs (list r-tinytest))
    (home-page "https://github.com/eddelbuettel/rcppint64")
    (synopsis
     "Rcpp-based helper functions to pass Int64 values between R and C++")
    (description
     "@code{int64} values can be created and accessed via the @code{bit64}
package and its @code{integer64} class which package the @code{int64}
representation cleverly into a @code{double}.  The @code{nanotime} package
builds on this to support nanosecond-resolution timestamps.  This package
helps conversions between R and C++ via several helper functions provided via
a single header file.  A complete example client package is included as an
illustration.")
    (license license:gpl2+)))

(define-public r-rcppml
  (package
    (name "r-rcppml")
    (version "0.3.7")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "RcppML" version))
       (sha256
        (base32 "1ih8i7i6m221iw227mnl3rvnaw2l53h8fpnc4f8yn9sm10anap1j"))))
    (properties `((upstream-name . "RcppML")))
    (build-system r-build-system)
    (arguments
     (list
      #:phases
      '(modify-phases %standard-phases
         (add-after 'unpack 'disable-bad-tests
           ;; It is unclear why these fail.
           (lambda _ (delete-file "tests/testthat/test_bipartition.R"))))))
    (propagated-inputs (list r-matrix r-rcpp r-rcppeigen))
    (native-inputs (list r-knitr r-testthat))
    (home-page "https://github.com/zdebruine/RcppML")
    (synopsis "Rcpp machine learning library")
    (description
     "This package provides fast machine learning algorithms including matrix
factorization and divisive clustering for large sparse and dense matrices.")
    (license license:gpl2+)))

(define-public r-rcppspdlog
  (package
    (name "r-rcppspdlog")
    (version "0.0.22")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "RcppSpdlog" version))
       (sha256
        (base32 "0ihh0g0amq69ws166p85zszm9slhr5n7i124i7k92ay394r14wh7"))))
    (properties `((upstream-name . "RcppSpdlog")))
    (build-system r-build-system)
    (propagated-inputs (list r-rcpp))
    (native-inputs (list r-simplermarkdown))
    (home-page "https://github.com/eddelbuettel/rcppspdlog")
    (synopsis "R and C++ interfaces to spdlog C++ header library for logging")
    (description
     "The spdlog library is a widely-used and very capable header-only C++
library for logging.  This package includes its headers as an R package to
permit other R packages to deploy it via a simple @code{LinkingTo:
RcppSpdlog}.  As of version 0.0.9, it also provides both simple R logging
functions and compiled functions callable by other packages.")
    (license license:gpl2+)))

(define-public r-rcppthread
  (package
    (name "r-rcppthread")
    (version "2.2.0")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "RcppThread" version))
       (sha256
        (base32
         "0dwd0nlfy3c525y4yk5j6xaqj74hd146fmkqw8j9ky1z12p5p0s4"))))
    (properties `((upstream-name . "RcppThread")))
    (build-system r-build-system)
    ;; For unknown reasons r-r-rsp is not found when building vignettes.
    (arguments (list #:test-types '(list "tests")))
    (native-inputs (list r-r-rsp r-rcpp r-testthat))
    (home-page "https://github.com/tnagler/RcppThread")
    (synopsis "R threading in C++")
    (description
     "This package provides a C++11-style thread class and thread pool that can
safely be interrupted from R.")
    (license license:expat)))

(define-public r-rcppnumerical
  (package
    (name "r-rcppnumerical")
    (version "0.6-0")
    (source (origin
              (method url-fetch)
              (uri (cran-uri "RcppNumerical" version))
              (sha256
               (base32
                "11nph9fz1bzb0pcvh6xx4cb94090ahwpj21zmbi06m4pibb1a1rg"))))
    (build-system r-build-system)
    (propagated-inputs
     (list r-rcpp r-rcppeigen))
    (native-inputs
     (list r-knitr r-rmarkdown))
    (home-page "https://github.com/yixuan/RcppNumerical")
    (synopsis"Numerical computing libraries integration with @code{Rcpp}")
    (description "This package provides a collection of libraries for numerical
computing (numerical integration, optimization, etc.) and their integration
with @code{Rcpp}.")
    (license license:gpl2+)))

(define-public r-rcppxptrutils
  (package
    (name "r-rcppxptrutils")
    (version "0.1.2")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "RcppXPtrUtils" version))
       (sha256
        (base32 "0hm57nf4dzgsmg4hjj6wikwjx93fgfwkmybw6ly4b58wi6qwml1l"))))
    (properties `((upstream-name . "RcppXPtrUtils")))
    (build-system r-build-system)
    (propagated-inputs (list r-rcpp))
    (native-inputs (list r-testthat))
    (home-page "https://github.com/Enchufa2/RcppXPtrUtils")
    (synopsis "XPtr add-ons for Rcpp")
    (description
     "This package provides the means to compile user-supplied C++ functions
with Rcpp and retrieve an @code{XPtr} that can be passed to other C++
components.")
    (license license:expat)))

(define-public r-bb
  (package
    (name "r-bb")
    (version "2019.10-1")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "BB" version))
       (sha256
        (base32 "0kf9sfsm3n036a8a8gjfpc9qdryvadb019kqjh80n1szdv7bdl04"))))
    (properties `((upstream-name . "BB")))
    (build-system r-build-system)
    ;; could not find function "latex"
    (arguments (list #:test-types '(list "tests")))
    (propagated-inputs (list r-quadprog))
    (native-inputs (list r-numderiv r-setrng))
    (home-page "https://publichealth.jhu.edu/")
    (synopsis "Solving and optimizing large-scale nonlinear systems")
    (description
     "This package implements Barzilai-Borwein spectral methods for solving
nonlinear system of equations, and for optimizing nonlinear objective
functions subject to simple constraints.")
    (license license:gpl3)))

(define-public r-bindr
  (package
    (name "r-bindr")
    (version "0.1.2")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "bindr" version))
       (sha256
        (base32
         "16161y28wg40pwlvmildcgcwn5wx6hiyk8r79sd0r31w31h6q7sj"))))
    (build-system r-build-system)
    (native-inputs (list r-testthat))
    (home-page "https://github.com/krlmlr/bindr")
    (synopsis "Parametrized active bindings")
    (description
     "This package provides a simple interface for creating active bindings
where the bound function accepts additional arguments.")
    (license license:expat)))

(define-public r-bindrcpp
  (package
    (name "r-bindrcpp")
    (version "0.2.3")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "bindrcpp" version))
       (sha256
        (base32
         "1yn9is89r76ay314s216whr0igych4r78kjz85amhwgfb9wawbb6"))))
    (build-system r-build-system)
    (propagated-inputs
     (list r-bindr r-plogr r-rcpp))
    (native-inputs (list r-testthat))
    (home-page "https://github.com/krlmlr/bindrcpp")
    (synopsis "Rcpp interface to active bindings")
    (description
     "This package provides an easy way to fill an environment with active
bindings that call a C++ function.")
    (license license:expat)))

(define-public r-auc
  (package
    (name "r-auc")
    (version "0.3.2")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "AUC" version))
       (sha256
        (base32
         "07xf47kypqbsg2mixmq6mnh4s89aqan9bgl6kfv6lbx8ajv2asw3"))))
    (properties `((upstream-name . "AUC")))
    (build-system r-build-system)
    (home-page "https://cran.r-project.org/web/packages/AUC")
    (synopsis "Compute the area under the curve of selected measures")
    (description
     "This package includes functions to compute the area under the curve of
selected measures: the area under the sensitivity curve (AUSEC), the area
under the specificity curve (AUSPC), the area under the accuracy
curve (AUACC), and the area under the receiver operating characteristic
curve (AUROC).  The curves can also be visualized.  Support for partial areas
is provided.")
    (license license:gpl2+)))

(define-public r-audio
  (package
    (name "r-audio")
    (version "0.1-11")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "audio" version))
       (sha256
        (base32 "0z719jxmfzmh6c885m1yixjzdsl1wy17s1sw2hp4ppz4bcrzclhh"))))
    (properties `((upstream-name . "audio")))
    (build-system r-build-system)
    (native-inputs (list pkg-config))
    (home-page "http://www.rforge.net/audio/")
    (synopsis "Audio interface for R")
    (description
     "This package provides interfaces to audio devices (mainly sample-based)
from R to allow recording and playback of audio.")
    (license license:expat)))

(define-public r-calibrate
  (package
    (name "r-calibrate")
    (version "1.7.7")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "calibrate" version))
       (sha256
        (base32 "19kgrnsyq67iqv1biyssqi30a6v2836ql20nabpy2m692ns0jfvi"))))
    (build-system r-build-system)
    (propagated-inputs
     (list r-mass))
    (home-page "https://cran.r-project.org/web/packages/calibrate")
    (synopsis "Calibration of scatterplot and biplot axes")
    (description
     "This is a package for drawing calibrated scales with tick marks
on (non-orthogonal) variable vectors in scatterplots and biplots.")
    (license license:gpl2)))

(define-public r-calibrator
  (package
    (name "r-calibrator")
    (version "1.2-8")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "calibrator" version))
       (sha256
        (base32 "1m9g1pmnr6d9jkg5ab0l0cbqfj7kmx7sdmcdqdhn9ifyhhn7812y"))))
    (properties `((upstream-name . "calibrator")))
    (build-system r-build-system)
    (propagated-inputs (list r-cubature r-emulator r-mvtnorm))
    (home-page "https://github.com/RobinHankin/calibrator.git")
    (synopsis "Bayesian calibration of complex computer codes")
    (description
     "This package performs Bayesian calibration of computer models as per
Kennedy and O'Hagan 2001.  The package includes routines to find the
hyperparameters and parameters; see the help page for @code{stage1()} for a
worked example using the toy dataset.  A tutorial is provided in the
@file{calex.Rnw} vignette; and a suite of especially simple one dimensional
examples appears in @file{inst/doc/one.dim/}.")
    (license license:gpl2)))

(define-public r-shape
  (package
    (name "r-shape")
    (version "1.4.6.1")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "shape" version))
       (sha256
        (base32
         "1912znpk85j8c01s4m2f7x8rcqwski8b5n7g70cczmkzk47vvya3"))))
    (build-system r-build-system)
    (home-page "https://cran.r-project.org/web/packages/shape")
    (synopsis "Functions for plotting graphical shapes")
    (description
     "This package provides functions for plotting graphical shapes such as
ellipses, circles, cylinders, arrows, ...")
    (license license:gpl3+)))

(define-public r-globaloptions
  (package
    (name "r-globaloptions")
    (version "0.1.2")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "GlobalOptions" version))
       (sha256
        (base32 "0gkm77w6db9ajyncy1xdcivplap06a51zi99m009kylccschd2a7"))))
    (properties `((upstream-name . "GlobalOptions")))
    (build-system r-build-system)
    (native-inputs
     (list r-knitr r-testthat))
    (home-page "https://github.com/jokergoo/GlobalOptions")
    (synopsis "Generate functions to get or set global options")
    (description
     "This package provides more controls on the option values such as
validation and filtering on the values, making options invisible or private.")
    (license license:gpl2+)))

(define-public r-circlize
  (package
    (name "r-circlize")
    (version "0.4.16")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "circlize" version))
       (sha256
        (base32
         "0rqbcmmp4h1jjl0y59bzn6k8kywjdqwvp0ajkqxd21j9f33k5p0n"))))
    (build-system r-build-system)
    (propagated-inputs
     (list r-colorspace r-globaloptions r-shape))
    (native-inputs
     (list r-knitr))
    (home-page "https://github.com/jokergoo/circlize")
    (synopsis "Circular visualization")
    (description
     "Circular layout is an efficient way to visualise huge amounts of
information.  This package provides an implementation of circular layout
generation in R as well as an enhancement of available software.  Its
flexibility is based on the usage of low-level graphics functions such that
self-defined high-level graphics can be easily implemented by users for
specific purposes.  Together with the seamless connection between the powerful
computational and visual environment in R, it gives users more convenience and
freedom to design figures for better understanding complex patterns behind
multi-dimensional data.")
    (license license:gpl2+)))

(define-public r-rcircos
  (package
    (name "r-rcircos")
    (version "1.2.2")
    (source (origin
              (method url-fetch)
              (uri (cran-uri "RCircos" version))
              (sha256
               (base32
                "1z0aam60p1b6q7csn50rrwdilm07myr05bw54s9ah8idzyxc7gav"))))
    (properties `((upstream-name . "RCircos")))
    (build-system r-build-system)
    (home-page "https://cran.r-project.org/web/packages/RCircos/")
    (synopsis "Circos 2D track plot")
    (description
     "This package provides a simple and flexible way to generate Circos 2D
track plot images.  The types of plots include: heatmap, histogram, lines,
scatterplot, tiles and plot items for further decorations include connector,
link (lines and ribbons), and text (gene) label.  All functions require only R
graphics packages that comes with the base installation.")
    (license license:gpl2+)))

(define-public r-circstats
  (package
    (name "r-circstats")
    (version "0.2-6")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "CircStats" version))
       (sha256
        (base32 "07bg4zrs2iqh0pmi44pybi8hlvnxwcaa5zpg85rmf55kflxxkzlf"))))
    (properties `((upstream-name . "CircStats")))
    (build-system r-build-system)
    (arguments
     (list
      #:tests? #f))
    (propagated-inputs (list r-boot r-mass))
    (home-page "https://cran.r-project.org/package=CircStats")
    (synopsis
     "Circular Statistics, from \"Topics in Circular Statistics\" (2001)")
    (description
     "Circular Statistics, from \"Topics in Circular Statistics\" (2001) S. Rao
Jammalamadaka and A. @code{SenGupta}, World Scientific.")
    (license license:gpl2)))

(define-public r-ctrdata
  (package
    (name "r-ctrdata")
    (version "1.22.2")
    (source (origin
              (method url-fetch)
              (uri (cran-uri "ctrdata" version))
              (sha256
               (base32
                "1hd83s3il732yfhizw0jdbiv2vqxk5famb86372giaw0q1fm75rz"))
              ;; TODO: we should also replace these other files:
              ;; inst/htmlwidgets/lib/jstree/dist/jstree.min.js
              ;; inst/js/bundle.js (generated from inst/js/euctr2ndjson.js)
              (snippet
               '(delete-file "inst/htmlwidgets/lib/jquery/dist/jquery.min.js"))))
    (properties `((upstream-name . "ctrdata")))
    (build-system r-build-system)
    (arguments
     (list
      #:modules
      '((guix build r-build-system)
        (guix build minify-build-system)
        (guix build utils)
        (ice-9 match))
      #:imported-modules
      `(,@%r-build-system-modules
        (guix build minify-build-system))
      #:phases
      #~(modify-phases (@ (guix build r-build-system) %standard-phases)
          (add-after 'unpack 'process-javascript
            (lambda* (#:key inputs #:allow-other-keys)
              (with-directory-excursion "inst/htmlwidgets/lib/jquery/dist"
                (for-each
                 (match-lambda
                   ((source . target)
                    (minify source #:target target)))
                 `((,(assoc-ref inputs "jquery-3.7.1.js")
                    . "jquery.min.js"))))))
          ;; Needed for vignettes
          (add-after 'unpack 'set-HOME
            (lambda _ (setenv "HOME" "/tmp"))))))
    (propagated-inputs
     (list r-clipr
           r-countrycode
           r-curl
           r-digest
           r-dplyr
           r-htmlwidgets
           r-httr
           r-jqr
           r-jsonlite
           r-lubridate
           r-nodbi
           r-readr
           r-rlang
           r-stringdist
           r-stringi
           r-tibble
           r-tidyr
           r-v8
           r-xml2
           r-zip))
    (native-inputs
     (list esbuild
           r-knitr
           r-r-rsp
           r-tinytest
           (origin
             (method url-fetch)
             (uri "https://code.jquery.com/jquery-3.7.1.js")
             (sha256
              (base32
               "1zicjv44sx6n83vrkd2lwnlbf7qakzh3gcfjw0lhq48b5z55ma3q")))))
    (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 European Union Clinical Trials Register (EUCTR),
ClinicalTrials.gov (CTGOV) and the ISRCTN.  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")
    (version "0.2.5")
    (source (origin
              (method url-fetch)
              (uri (cran-uri "ctrialsgov" version))
              (sha256
               (base32
                "0hdh1fdfaja8amf7fkvk1c6yif703132bvacq0j9pk5jr97czgpw"))))
    (properties `((upstream-name . "ctrialsgov")))
    (build-system r-build-system)
    (propagated-inputs
     (list r-dbi
           r-dplyr
           r-ggplot2
           r-htmlwidgets
           r-lubridate
           r-matrix
           r-plotly
           r-purrr
           r-rlang
           r-stringi
           r-tibble))
    (native-inputs (list r-knitr r-testthat))
    (home-page "https://cran.r-project.org/package=ctrialsgov")
    (synopsis
     "Query data from U.S. National Library of Medicine's Clinical Trials Database")
    (description
     "This package provides tools to query the U.S. National Library of
Medicine's Clinical Trials database.  Functions are provided for a variety of
techniques for searching the data using range queries, categorical filtering,
and by searching for full-text keywords.  Minimal graphical tools are also
provided for interactively exploring the constructed data.")
    (license license:expat)))

(define-public r-powerlaw
  (package
    (name "r-powerlaw")
    (version "1.0.0")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "poweRlaw" version))
       (sha256
        (base32 "1pgwa8jw2886z1qj8iyi5wr8ydqinzka1j4pfbbg7vdgmdxq2yb4"))))
    (properties `((upstream-name . "poweRlaw")))
    (build-system r-build-system)
    (propagated-inputs
     (list r-pracma))
    (native-inputs
     (list r-knitr r-testthat))
    (home-page "https://github.com/csgillespie/poweRlaw")
    (synopsis "Tools for the analysis of heavy tailed distributions")
    (description
     "This package provides an implementation of maximum likelihood estimators
for a variety of heavy tailed distributions, including both the discrete and
continuous power law distributions.  Additionally, a goodness-of-fit based
approach is used to estimate the lower cut-off for the scaling region.")
    ;; Any of these GPL versions.
    (license (list license:gpl2 license:gpl3))))

(define-public r-ptw
  (package
    (name "r-ptw")
    (version "1.9-16")
    (source (origin
              (method url-fetch)
              (uri (cran-uri "ptw" version))
              (sha256
               (base32
                "0rma3h9ksc5qigdvk5vappb4ipd4rpk64wckzcxvxspakr5w71vy"))))
    (properties `((upstream-name . "ptw")))
    (build-system r-build-system)
    (propagated-inputs (list r-rcppde))
    (home-page "https://github.com/rwehrens/ptw")
    (synopsis "Parametric time warping")
    (description
     "Parametric time warping aligns patterns.  It aims to put corresponding
features at the same locations.  The algorithm searches for an optimal
polynomial describing the warping.  It is possible to align one sample to a
reference, several samples to the same reference, or several samples to
several references.  One can choose between calculating individual warpings,
or one global warping for a set of samples and one reference.  Two
optimization criteria are implemented: @acronym{RMS, Root Mean Square} error
and @acronym{WCC, Weighted Cross Correlation}.  Both warping of peak profiles
and of peak lists are supported.")
    (license license:gpl2+)))

(define-public r-compare
  (package
    (name "r-compare")
    (version "0.2-6")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "compare" version))
       (sha256
        (base32
         "0k9zms930b5dz9gy8414li21wy0zg9x9vp7301v5cvyfi0g7xzgw"))))
    (build-system r-build-system)
    (home-page "https://cran.r-project.org/web/packages/compare")
    (synopsis "Comparing objects for differences")
    (description
     "This package provides functions to compare a model object to a
comparison object.  If the objects are not identical, the functions can be
instructed to explore various modifications of the objects (e.g., sorting
rows, dropping names) to see if the modified versions are identical.")
    (license license:gpl2+)))

(define-public r-compoissonreg
  (package
    (name "r-compoissonreg")
    (version "0.8.1")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "COMPoissonReg" version))
       (sha256
        (base32 "0a03v9b3mv214y2ky94z8y363x6b97a68kvypvan56m0mg0zzq3d"))))
    (properties `((upstream-name . "COMPoissonReg")))
    (build-system r-build-system)
    (propagated-inputs (list r-numderiv r-rcpp))
    (native-inputs (list r-knitr r-testthat))
    (home-page "https://github.com/lotze/COMPoissonReg")
    (synopsis "Conway-Maxwell Poisson (COM-Poisson) regression")
    (description
     "Fit Conway-Maxwell Poisson (COM-Poisson or CMP) regression models to
count data (Sellers & Shmueli, 2010) <doi:10.1214/09-AOAS306>.  The package
provides functions for model estimation, dispersion testing, and diagnostics.
Zero-inflated CMP regression (Sellers & Raim, 2016)
<doi:10.1016/j.csda.2016.01.007> is also supported.")
    (license (list license:gpl2 license:gpl3))))

(define-public r-dendextend
  (package
    (name "r-dendextend")
    (version "1.19.0")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "dendextend" version))
       (sha256
        (base32
         "17nvk2gqyzgiwd62z2jw56rvlc14m1m5wx41xhc2p1wbl60s5njq"))))
    (properties
     ;; Ignore packages that have been removed from CRAN, or that would cause
     ;; a dependency cycle.
     '((updater-ignored-native-inputs
        . ("r-dendextendrcpp" "r-seriation" "r-table"))
       (updater-extra-native-inputs
        . ("r-circlize" "r-data-table"))))
    (build-system r-build-system)
    (arguments
     (list
      #:phases
      '(modify-phases %standard-phases
         (add-after 'unpack 'delete-bad-tests
           (lambda _
             ;; Needs package seriation, but adding it would lead to a
             ;; dependency cycle.
             (delete-file "tests/testthat/test-seriate_dendrogram.R")
             ;; XXX Test fails with: `best_entanglement` not identical to 0.
             (delete-file "tests/testthat/test-untangle.R")
             ;; XXX Test fails with: !opt$warn is not TRUE
             (delete-file "tests/testthat/test-zzz.R"))))))
    (propagated-inputs
     (list r-ggplot2 r-magrittr r-viridis))
    (native-inputs
     (list r-ape
           r-circlize
           r-cluster
           r-data-table
           r-fpc
           r-knitr
           r-pvclust
           r-testthat))
    (home-page "https://cran.r-project.org/web/packages/dendextend")
    (synopsis "Extending 'dendrogram' functionality in R")
    (description
     "This package offers a set of functions for extending @code{dendrogram}
objects in R, letting you visualize and compare trees of hierarchical
clusterings.  You can adjust a tree's graphical parameters (the color, size,
type, etc of its branches, nodes and labels) and visually and statistically
compare different dendrograms to one another.")
    ;; Any of these versions
    (license (list license:gpl2 license:gpl3))))

(define-public r-dendsort
  (package
    (name "r-dendsort")
    (version "0.3.4")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "dendsort" version))
       (sha256
        (base32 "0rs7y471wrhkgibxdmfh5xhp3pa004rrlm2w08b6qli5gq4im5d2"))))
    (properties `((upstream-name . "dendsort")))
    (build-system r-build-system)
    ;; Tests fail with: could not find function "context"
    (arguments (list #:tests? #false))
    (native-inputs (list r-knitr))
    (home-page "https://github.com/evanbiederstedt/dendsort")
    (synopsis "Modular leaf ordering methods for dendrogram nodes")
    (description
     "This package represents an implementation of functions to optimize
ordering of nodes in a dendrogram, without affecting the meaning of the
dendrogram.  A dendrogram can be sorted based on the average distance of
subtrees, or based on the smallest distance value.  These sorting methods
improve readability and interpretability of tree structure, especially for
tasks such as comparison of different distance measures or linkage types and
identification of tight clusters and outliers.  As a result, it also
introduces more meaningful reordering for a coupled heatmap visualization.")
    ;; Any of these versions
    (license (list license:gpl2 license:gpl3))))

(define-public r-getoptlong
  (package
    (name "r-getoptlong")
    (version "1.0.5")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "GetoptLong" version))
       (sha256
        (base32
         "00fpm6nd3kqa2ikasxa62jzywi46fvvmx1mdavcp5yrxxn37j8wc"))))
    (properties `((upstream-name . "GetoptLong")))
    (build-system r-build-system)
    (inputs
     (list perl))
    (propagated-inputs
     (list r-crayon r-globaloptions r-rjson))
    (native-inputs
     (list r-knitr r-testthat))
    (home-page "https://github.com/jokergoo/GetoptLong")
    (synopsis "Parsing command-line arguments and variable interpolation")
    (description
     "This is yet another command-line argument parser which wraps the
powerful Perl module @code{Getopt::Long} and with some adaptation for easier
use in R.  It also provides a simple way for variable interpolation in R.")
    (license license:gpl2+)))

(define-public r-fastmatch
  (package
    (name "r-fastmatch")
    (version "1.1-6")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "fastmatch" version))
       (sha256
        (base32
         "0rjd9yk2v0q44j8f2y4chc0rlc20ay5zqgz185pxl6yz4vzlgc8h"))))
    (build-system r-build-system)
    (home-page "https://www.rforge.net/fastmatch")
    (synopsis "Fast match function")
    (description
     "This package provides a fast @code{match} replacement for cases that
require repeated look-ups.  It is slightly faster that R's built-in
@code{match} function on first match against a table, but extremely fast on
any subsequent lookup as it keeps the hash table in memory.")
    (license license:gpl2)))

(define-public r-ff
  (package
    (name "r-ff")
    (version "4.5.2")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "ff" version))
       (sha256
        (base32
         "0b1mqs98vqr67zxnf36vhzk9frd9ndq9ajsvv0z5zc67ziygal85"))))
    (build-system r-build-system)
    (propagated-inputs (list r-bit))
    (native-inputs (list r-testthat))
    (home-page "https://ff.r-forge.r-project.org/")
    (synopsis "Memory-efficient storage of large data on disk and access functions")
    (description
     "This package provides data structures that are stored on disk but
behave (almost) as if they were in RAM by transparently mapping only a section
in main memory.")
    ;; error Architecture not supported.
    (supported-systems (delete "aarch64-linux" %supported-systems))
    (license license:gpl2)))

(define-public r-ffbase
  (package
    (name "r-ffbase")
    (version "0.13.3")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "ffbase" version))
       (sha256
        (base32
         "1dp6lblfq2j7r1b4b8ls47jlx8j27n88d5vp8w116lb8pa01zxmk"))))
    (build-system r-build-system)
    (arguments
     (list
      #:phases
      '(modify-phases %standard-phases
         ;; R 4.3.0 removed the typedef for Sint, which used to be just int.
         (add-after 'unpack 'r-compatibility
           (lambda _
             (substitute* '("src/grouprunningcumsum.c"
                            "src/grouprunningcumsumindex.c")
               (("\\bSint ") "int ")))))))
    (propagated-inputs
     (list r-bit r-fastmatch r-ff))
    (native-inputs (list r-laf r-testthat))
    (home-page "https://github.com/edwindj/ffbase")
    (synopsis "Basic statistical functions for package 'ff'")
    (description
     "This package extends the out of memory vectors of @code{ff} with
statistical functions and other utilities to ease their usage.")
    (license license:gpl3)))

(define-public r-prettyunits
  (package
    (name "r-prettyunits")
    (version "1.2.0")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "prettyunits" version))
       (sha256
        (base32
         "1smcxrfsz6cxym9h8iaiqrrw5bzp2bbpmf05zr8y70jw59zg4ngh"))))
    (properties
     `((updater-extra-native-inputs . ("r-codetools"))))
    (build-system r-build-system)
    (native-inputs (list r-codetools r-testthat))
    (home-page "https://github.com/gaborcsardi/prettyunits")
    (synopsis "Pretty, human readable formatting of quantities")
    (description
     "This package provides tools for pretty, human readable formatting of
quantities.")
    (license license:expat)))

(define-public r-princurve
  (package
   (name "r-princurve")
   (version "2.1.6")
   (source (origin
            (method url-fetch)
            (uri (cran-uri "princurve" version))
            (sha256
             (base32
              "0wzk329bxljkzz57y220lsfckpsn45w348m6dcxh29zbj0ik65h2"))))
   (build-system r-build-system)
   (propagated-inputs
    (list r-rcpp))
   (native-inputs (list r-testthat))
   (home-page "https://github.com/rcannood/princurve")
   (synopsis "Fit a principal curve in arbitrary dimension")
   (description "This package provides procedures for fitting a principal
curve to a data matrix in arbitrary dimensions.")
   (license license:gpl2)))

(define-public r-prismatic
  (package
    (name "r-prismatic")
    (version "1.1.2")
    (source (origin
              (method url-fetch)
              (uri (cran-uri "prismatic" version))
              (sha256
               (base32
                "0qg2f5d7sz6q0ijrrdmjhp1msx9n77wndphrqqhjkdf9six5pgxs"))))
    (properties `((upstream-name . "prismatic")))
    (build-system r-build-system)
    (propagated-inputs (list r-farver))
    (native-inputs (list r-testthat))
    (home-page "https://github.com/EmilHvitfeldt/prismatic")
    (synopsis "Color manipulation tools")
    (description
     "Manipulate and visualize colors in a intuitive, low-dependency and functional
way.")
    (license license:expat)))

(define-public r-reshape
  (package
    (name "r-reshape")
    (version "0.8.9")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "reshape" version))
       (sha256
        (base32
         "0j203qmc076x5lp6q2xi4dq4xdb73jmsa42rpxp1c37knnrph4br"))))
    (build-system r-build-system)
    (propagated-inputs
     (list r-plyr))
    (home-page "http://had.co.nz/reshape")
    (synopsis "Flexibly reshape data")
    (description
     "Flexibly restructure and aggregate data using just two functions:
@code{melt} and @code{cast}.  This package provides them.")
    (license license:expat)))

(define-public r-restrserve
  (package
    (name "r-restrserve")
    (version "1.2.4")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "RestRserve" version))
       (sha256
        (base32 "13yl7638prglpqi4jq5vad5mw940k15b3n9svwmd92wmbh9ycsix"))))
    (build-system r-build-system)
    (propagated-inputs
     (list r-checkmate
           r-digest
           r-jsonlite
           r-mime
           r-r6
           r-rcpp
           r-rserve
           r-uuid))
    (native-inputs
     (list r-knitr r-tinytest))
    (home-page "https://restrserve.org")
    (synopsis "R web API framework")
    (description
     "RestRserve is an R web API framework for building high-performance AND
robust microservices and app backends.  With Rserve backend on UNIX-like
systems it is parallel by design.  It will handle incoming requests in
parallel - each request in a separate fork.")
    (license license:gpl2+)))

(define-public r-progress
  (package
    (name "r-progress")
    (version "1.2.3")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "progress" version))
       (sha256
        (base32
         "0xljky4ad2jbbcfrcyh48li461pc5b2wk210n4x5rs2di6dhfaza"))))
    (build-system r-build-system)
    (propagated-inputs
     (list r-crayon r-hms r-prettyunits r-r6))
    (native-inputs (list r-testthat))
    (home-page "https://github.com/gaborcsardi/progress")
    (synopsis "Terminal progress bars")
    (description
     "This package provides configurable progress bars.  They may include
percentage, elapsed time, and/or the estimated completion time.  They work in
terminals, in Emacs ESS, RStudio, Windows Rgui, and the macOS R.app.  The
package also provides a C++ API, that works with or without Rcpp.")
    (license license:expat)))

(define-public r-ggally
  (package
    (name "r-ggally")
    (version "2.2.1")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "GGally" version))
       (sha256
        (base32
         "1il6yphqxcyj1039imi8pn6ygyni24daz8ljxxp3z9inb5k2dcwb"))))
    (properties
     '((upstream-name . "GGally")
       (updater-extra-native-inputs
        . ("r-broom" "r-network" "r-scales" "r-sna"))))
    (build-system r-build-system)
    (inputs
     (list openssl))
    (propagated-inputs
     (list r-dplyr
           r-ggplot2
           r-ggstats
           r-gtable
           r-lifecycle
           r-magrittr
           r-plyr
           r-progress
           r-rcolorbrewer
           r-rlang
           r-scales
           r-tidyr))
    (native-inputs
     (list r-broom r-network r-scales r-sna r-survival r-testthat r-vdiffr))
    (home-page "https://ggobi.github.io/ggally")
    (synopsis "Extension to ggplot2")
    (description
     "The R package ggplot2 is a plotting system based on the grammar of
graphics.  GGally extends ggplot2 by adding several functions to reduce the
complexity of combining geometric objects with transformed data.  Some of
these functions include a pairwise plot matrix, a two group pairwise plot
matrix, a parallel coordinates plot, a survival plot, and several functions to
plot networks.")
    (license license:gpl2+)))

(define-public r-proxy
  (package
    (name "r-proxy")
    (version "0.4-27")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "proxy" version))
       (sha256
        (base32
         "0gsng2aggnljl4z82la9hpnd26hngzhj8fizx4wx22npqjj93694"))))
    (build-system r-build-system)
    ;; Some tests need the r-cba package, which depends on r-proxy.
    (arguments (list #:tests? #false))
    (home-page "https://cran.r-project.org/web/packages/proxy")
    (synopsis "Distance and similarity measures")
    (description
     "This package provides an extensible framework for the efficient
calculation of auto- and cross-proximities, along with implementations of the
most popular ones.")
    (license license:gpl2)))

(define-public r-sp
  (package
    (name "r-sp")
    (version "2.2-0")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "sp" version))
       (sha256
        (base32 "164b2il1g2bb91zfbh5dg7wglkhzxii9wqavxn5mdv3bm69yfyxm"))))
    (build-system r-build-system)
    (propagated-inputs
     (list r-lattice))
    (native-inputs
     (list r-knitr))
    (home-page "https://cran.r-project.org/web/packages/sp")
    (synopsis "Classes and methods for spatial data")
    (description
     "This package provides classes and methods for spatial data; the classes
document where the spatial location information resides, for 2D or 3D data.
Utility functions are provided, e.g. for plotting data as maps, spatial
selection, as well as methods for retrieving coordinates, for subsetting,
print, summary, etc.")
    (license license:gpl2+)))

(define-public r-lambertw
  (package
    (name "r-lambertw")
    (version "0.6.9-1")
    (source (origin
              (method url-fetch)
              (uri (cran-uri "LambertW" version))
              (sha256
               (base32
                "19j6vjhywyzmrf7rsrx5kf0hg8cpk1gn8al24q813jzp0vsv9ljj"))))
    (properties `((upstream-name . "LambertW")))
    (build-system r-build-system)
    (propagated-inputs (list r-ggplot2
                             r-lamw
                             r-mass
                             r-rcolorbrewer
                             r-rcpp
                             r-reshape2))
    (native-inputs (list r-knitr r-testthat))
    (home-page "https://cran.r-project.org/package=LambertW")
    (synopsis
     "Probabilistic models to analyze and Gaussianize heavy-tailed, skewed data")
    (description
     "Lambert W x F distributions are a generalized framework to analyze skewed,
heavy-tailed data.  It is based on an input/output system, where the output
random variable (RV) Y is a non-linearly transformed version of an input RV X
~ F with similar properties as X, but slightly skewed (heavy-tailed).  The
transformed RV Y has a Lambert W x F distribution.  This package contains
functions to model and analyze skewed, heavy-tailed data the Lambert Way:
simulate random samples, estimate parameters, compute quantiles, and plot/
print results nicely.  The most useful function is @code{Gaussianize}, which
works similarly to @code{scale}, but actually makes the data Gaussian.  A
do-it-yourself toolkit allows users to define their own Lambert W x
@code{MyFavoriteDistribution} and use it in their analysis right away.")
    (license license:gpl2+)))

(define-public r-lamw
  (package
    (name "r-lamw")
    (version "2.2.4")
    (source (origin
              (method url-fetch)
              (uri (cran-uri "lamW" version))
              (sha256
               (base32
                "1h1plx9d6kzgdv20sx7pjfkz54jw11pkqrspgw4hh1kgk6hpbgsz"))))
    (properties `((upstream-name . "lamW")))
    (build-system r-build-system)
    (propagated-inputs (list r-rcpp r-rcppparallel))
    (home-page "https://github.com/aadler/lamW")
    (synopsis "Lambert-W function")
    (description
     "This package implements both real-valued branches of the Lambert-W
function (Corless et al, 1996) <doi:10.1007/BF02124750> without the need for
installing the entire GSL.")
    (license license:bsd-2)))

(define-public r-laplacesdemon
  (package
    (name "r-laplacesdemon")
    (version "16.1.6")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "LaplacesDemon" version))
       (sha256
        (base32 "1dsfp65cg06f25zjzd5ib4qyn1alfhbhpgyvpcw5n6bszn13idap"))))
    (properties `((upstream-name . "LaplacesDemon")))
    (build-system r-build-system)
    (home-page "https://github.com/LaplacesDemonR/LaplacesDemon")
    (synopsis "Complete environment for Bayesian inference")
    (description
     "This package provides a complete environment for Bayesian inference using
a variety of different samplers.")
    (license license:expat)))

(define-public r-rmapshaper
  (package
    (name "r-rmapshaper")
    (version "0.5.0")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "rmapshaper" version))
       (sha256
        (base32 "01c1sd02ws3k2dmlj964c4j5jg93x192s3brhmaw4pi4qfjzc21x"))
       (snippet
        '(delete-file "inst/mapshaper/mapshaper-browserify.min.js"))))
    (properties `((upstream-name . "rmapshaper")))
    (build-system r-build-system)
    (arguments
     (list
      #:modules
      '((guix build r-build-system)
        (guix build minify-build-system)
        (guix build utils)
        (ice-9 match))
      #:imported-modules
      `(,@%r-build-system-modules
        (guix build minify-build-system))
      #:phases
      '(modify-phases (@ (guix build r-build-system) %standard-phases)
         (add-after 'unpack 'process-javascript
           (lambda* (#:key inputs #:allow-other-keys)
             (with-directory-excursion "inst/"
               (for-each (match-lambda
                           ((source . target)
                            (minify source #:target target)))
                         '(("mapshaper/mapshaper-browserify.js"
                            . "mapshaper/mapshaper-browserify.min.js")))))))))
    (propagated-inputs (list r-geojsonsf
                             r-jsonify
                             r-readr
                             r-sf
                             r-sp
                             r-v8))
    (native-inputs (list esbuild r-knitr r-testthat))
    (home-page "https://github.com/ateucher/rmapshaper")
    (synopsis "Client for mapshaper for geospatial operations")
    (description
     "This package lets you edit and simplify @code{geojson}, @code{Spatial},
and @code{sf} objects.  This is a wrapper around the @code{mapshaper}
JavaScript library to perform topologically-aware polygon simplification, as
well as other operations such as clipping, erasing, dissolving, and converting
multi-part to single-part geometries.")
    (license license:expat)))

(define-public r-rmariadb
  (package
    (name "r-rmariadb")
    (version "1.3.4")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "RMariaDB" version))
       (sha256
        (base32 "157qkqv3a4p3dz4l0ah4h47wdsp8z8pm6magfgm63dg6xjsrkhgp"))))
    (properties
     `((upstream-name . "RMariaDB")
       (updater-extra-inputs . ("mariadb"))))
    (build-system r-build-system)
    (inputs (list `(,mariadb "lib") `(,mariadb "dev") openssl zlib))
    (native-inputs (list pkg-config r-dbitest r-testthat r-withr))
    (propagated-inputs (list r-bit64
                             r-blob
                             r-cpp11
                             r-dbi
                             r-hms
                             r-lubridate
                             r-plogr
                             r-rlang))
    (home-page "https://rmariadb.r-dbi.org")
    (synopsis "Database interface and MariaDB driver")
    (description
     "This package implements a DBI-compliant interface to @code{MariaDB} and
@code{MySQL} databases.")
    (license license:expat)))

(define-public r-rmdfiltr
  (package
    (name "r-rmdfiltr")
    (version "0.1.5")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "rmdfiltr" version))
       (sha256
        (base32 "05czq9nvs66zd8wgmy5bvk0k1qfspf3imwxs25gn4d3w188klhnv"))))
    (properties `((upstream-name . "rmdfiltr")))
    (build-system r-build-system)
    (inputs (list pandoc))
    (propagated-inputs (list r-assertthat r-rmarkdown))
    (native-inputs (list r-knitr r-testthat))
    (home-page "https://github.com/crsh/rmdfiltr")
    (synopsis "Lua filters for R Markdown")
    (description
     "This package provides a collection of Lua filters that extend the
functionality of R Markdown templates (e.g., count words or post-process
citations).")
    (license license:expat)))

(define-public r-rmio
  (package
    (name "r-rmio")
    (version "0.4.0")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "rmio" version))
       (sha256
        (base32 "1gkd8nkqyfpkp6nvqb7c698difak5ymih3vy6njzqd3gwdp09mhy"))))
    (properties `((upstream-name . "rmio")))
    (build-system r-build-system)
    (propagated-inputs (list r-bigassertr r-ff))
    (native-inputs (list r-testthat))
    (home-page "https://github.com/privefl/rmio")
    (synopsis "Provides mio C++11 header files for R")
    (description
     "This package provides the header files of mio, a cross-platform C++11
header-only library for memory mapped file IO.")
    (license license:gpl3)))

(define-public r-rmtstat
  (package
    (name "r-rmtstat")
    (version "0.3.1")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "RMTstat" version))
       (sha256
        (base32
         "1r1a2sdqv64m9cpm2pz6r8abf7l810126ayd8iq3gx86c7bjfj5v"))))
    (properties `((upstream-name . "RMTstat")))
    (build-system r-build-system)
    (home-page "https://cran.r-project.org/web/packages/RMTstat")
    (synopsis "Distributions, statistics and tests derived from random matrix theory")
    (description
     "This package provides functions for working with the Tracy-Widom laws
and other distributions related to the eigenvalues of large Wishart
matrices.")
    (license license:bsd-3)))

(define-public r-rmpi
  (package
    (name "r-rmpi")
    (version "0.7-3.3")
    (source (origin
              (method url-fetch)
              (uri (cran-uri "Rmpi" version))
              (sha256
               (base32
                "07izzlr1zxf25jrgwmi9384cqmg9hqsbh673zifzb4k0lvi0ikmw"))))
    (properties
     `((upstream-name . "Rmpi")
       (updater-extra-inputs . ("openmpi"))))
    (build-system r-build-system)
    (arguments
     (list
      #:configure-flags '(list "--configure-args=\"--with-Rmpi-type=OPENMPI\"")
      #:phases
      #~(modify-phases %standard-phases
          (add-before 'install 'mpi-setup
            #$%openmpi-setup))))
    (inputs
     (list openmpi))
    (native-inputs
     (list pkg-config))
    (home-page "http://www.stats.uwo.ca/faculty/yu/Rmpi")
    (synopsis "R interface to message-passing interface (MPI)")
    (description
     "This package provides an interface (wrapper) to MPI APIs.  It also
provides an interactive R manager and worker environment.")
    (license license:gpl2+)))

(define-public r-rmumps
  (package
    (name "r-rmumps")
    (version "5.2.1-35")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "rmumps" version))
       (sha256
        (base32 "0ainsg7gh5jriwxrrq24njb9va57hl24h3nzlg8i0mqddw2ix9xx"))))
    (properties
     `((upstream-name . "rmumps")
       (updater-extra-inputs . ("zlib"))))
    (build-system r-build-system)
    (inputs (list zlib))
    (propagated-inputs (list r-rcpp))
    (native-inputs (list gfortran r-matrix r-slam r-testthat))
    (home-page "https://www.mumps-solver.org/")
    (synopsis "Wrapper for MUMPS library")
    (description
     "Some basic features of @acronym{MUMPS, Multifrontal Massively Parallel
sparse direct Solver} are wrapped in a class whose methods can be used for
sequentially solving a sparse linear system (symmetric or not) with one or
many right hand sides (dense or sparse).  There is a possibility to do
separately symbolic analysis, LU (or LDL^t) factorization and system solving.
Third part ordering libraries are included and can be used: PORD, METIS,
SCOTCH.")
    (license license:gpl2+)))

(define-public r-lmoments
  (package
    (name "r-lmoments")
    (version "1.3-1")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "Lmoments" version))
       (sha256
        (base32
         "0pc63bj9a8hzr5m3yssrc4kin39fffwkl8rggs3sagzr12d4i7bw"))))
    (properties `((upstream-name . "Lmoments")))
    (build-system r-build-system)
    (propagated-inputs
     (list r-rcpp r-rcpparmadillo))
    (home-page "http://www.tilastotiede.fi/juha_karvanen.html")
    (synopsis "L-moments and quantile mixtures")
    (description
     "This package contains functions to estimate L-moments and trimmed
L-moments from the data.  It also contains functions to estimate the
parameters of the normal polynomial quantile mixture and the Cauchy polynomial
quantile mixture from L-moments and trimmed L-moments.")
    (license license:gpl2)))

(define-public r-distillery
  (package
    (name "r-distillery")
    (version "1.2-2")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "distillery" version))
       (sha256
        (base32
         "1rsxrq5j5zzk48r27l7ns7igcij9crwi001h002h2fjcai7m03cr"))))
    (build-system r-build-system)
    (home-page "https://ral.ucar.edu/staff/ericg/")
    (synopsis "Functions for confidence intervals and object information")
    (description
     "This package provides some very simple method functions for confidence
interval calculation and to distill pertinent information from a potentially
complex object; primarily used in common with the packages extRemes and
SpatialVx.")
    (license license:gpl2+)))

(define-public r-etrunct
  (package
   (name "r-etrunct")
   (version "0.1")
   (source (origin
            (method url-fetch)
            (uri (cran-uri "etrunct" version))
            (sha256
             (base32
              "0ayazgyqlc8jcqr03cwfmfhm4pck6xri1r6vkgqy4arqkrrnrcqr"))))
   (properties `((upstream-name . "etrunct")))
   (build-system r-build-system)
   (native-inputs (list r-testthat))
   (home-page "https://cran.r-project.org/web/packages/etrunct")
   (synopsis "Computes moments of univariate truncated T distribution")
   (description "This package computes moments of univariate truncated
T distribution.  There is only one exported function, @code{e_trunct},
which should be seen for details.")
   (license license:expat)))

(define-public r-evd
  (package
    (name "r-evd")
    (version "2.3-7.1")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "evd" version))
       (sha256
        (base32 "0y0vd2q3bjq3kwm5qlya57ijkpdipwfpgv7xs1014gdm6g639l8s"))))
    (properties `((upstream-name . "evd")))
    (build-system r-build-system)
    (home-page "https://cran.r-project.org/package=evd")
    (synopsis "Functions for extreme value distributions")
    (description
     "This package extends simulation, distribution, quantile and density
functions to univariate and multivariate parametric extreme value distributions,
and provides fitting functions which calculate maximum likelihood estimates for
univariate and bivariate maxima models, and for univariate and bivariate
threshold models.")
    (license license:gpl3)))

(define-public r-evmix
  (package
    (name "r-evmix")
    (version "2.12")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "evmix" version))
       (sha256
        (base32 "02rabc9snci00s1x7h0svfr66lmw1wjcdg0149wc52mnccsdaivf"))))
    (properties `((upstream-name . "evmix")))
    (build-system r-build-system)
    (propagated-inputs
     (list r-gsl
           r-mass
           r-sparsem))
    (home-page "http://www.math.canterbury.ac.nz/~c.scarrott/evmix.shtml")
    (synopsis
     "Extreme value threshold estimation and uncertainty quantification")
    (description
     "This package provides the usual distribution functions, maximum likelihood
inference and model diagnostics for univariate stationary extreme value mixture
models.  Also, there are provided kernel density estimation including various
boundary corrected kernel density estimation methods and a wide choice of kernels,
with cross-validation likelihood based bandwidth estimator.  Reasonable
consistency with the base functions in the evd package is provided, so that users
can safely interchange most code.")
    (license license:gpl3)))

;; This package contains minified JavaScript: jExcel CE Spreadsheet,
;; version 3.9.1.  It is not clear how to obtain this particular
;; version as there is no tag for 3.9.1.  There only is 3.6.1 and
;; 4.2.0 at https://github.com/jspreadsheet/ce.
(define-public r-excelr
  (package
    (name "r-excelr")
    (version "0.4.0")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "excelR" version))
       (sha256
        (base32 "1pb4sy54zjv5vrh7gjjv7qlpab74km6mfsmfyl0yhmr0jx01hrw0"))
       (snippet
        '(delete-file "inst/htmlwidgets/lib/jexcel/js/jexcel.min.js"))))
    (properties `((upstream-name . "excelR")))
    (build-system r-build-system)
    (arguments
     (list
      #:modules
      '((guix build r-build-system)
        (guix build minify-build-system)
        (guix build utils))
      #:imported-modules
      `(,@%r-build-system-modules
        (guix build minify-build-system))
      #:phases
      #~(modify-phases (@ (guix build r-build-system) %standard-phases)
          (add-after 'unpack 'process-javascript
            (lambda* (#:key inputs #:allow-other-keys)
              (with-directory-excursion "inst/htmlwidgets/lib/jexcel/js"
                (minify (search-input-file inputs "/dist/jexcel.js")
                        #:target "jexcel.min.js")))))))
    (propagated-inputs (list r-htmlwidgets r-jsonlite))
    (native-inputs
     (list esbuild
           ;; There is no tag for this particular commit, but comparison of
           ;; the contents of the JavaScript files point to this commit as the
           ;; most likely source.
           (let* ((commit "8af1960f76e6803bebc5750013d2ebe95354e88a")
                  (version (git-version "3.9.1" "0" commit)))
             (origin
               (method git-fetch)
               (uri (git-reference
                     (url "https://github.com/jspreadsheet/ce")
                     (commit commit)))
               (file-name (git-file-name "jexcel" version))
               (sha256
                (base32
                 "1zk0wc4h0vax7zgimhwqq2icrvjr84agm3qv42l16gim7gq7fqfq"))))
           r-testthat))
    (home-page "https://github.com/Swechhya/excelR")
    (synopsis "Wrapper of the JavaScript library jExcel")
    (description
     "This package provides an R interface to the jExcel library to create
web-based interactive tables and spreadsheets compatible with spreadsheet
software.")
    (license license:expat)))

(define-public r-extremes
  (package
    (name "r-extremes")
    (version "2.2-1")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "extRemes" version))
       (sha256
        (base32
         "0sg9cbhhqmg5flwwlqn0hnybz9mycf3rf5rzssgw8dvlc0mmv3r6"))))
    (properties `((upstream-name . "extRemes")))
    (build-system r-build-system)
    (propagated-inputs
     (list r-distillery r-lmoments))
    (home-page "https://www.assessment.ucar.edu/toolkit/")
    (synopsis "Extreme value analysis")
    (description
     "ExtRemes is a suite of functions for carrying out analyses on the
extreme values of a process of interest; be they block maxima over long blocks
or excesses over a high threshold.")
    (license license:gpl2+)))

(define-public r-lmtest
  (package
    (name "r-lmtest")
    (version "0.9-40")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "lmtest" version))
       (sha256
        (base32
         "15yr2kx08wy085bnziqmj1p6hf9mg3qp2a8465jk2df6di6hsh34"))))
    (build-system r-build-system)
    (propagated-inputs
     (list r-zoo))
    (native-inputs
     (list gfortran))
    (home-page "https://cran.r-project.org/web/packages/lmtest")
    (synopsis "Testing linear regression models")
    (description
     "This package provides a collection of tests, data sets, and examples for
diagnostic checking in linear regression models.  Furthermore, some generic
tools for inference in parametric models are provided.")
    ;; Either version is okay
    (license (list license:gpl2 license:gpl3))))

(define-public r-idr
  (package
    (name "r-idr")
    (version "1.3")
    (source (origin
              (method url-fetch)
              (uri (cran-uri "idr" version))
              (sha256
               (base32
                "1r6icxf0c0y9wvihwmkk5xqscr1qhacqk3w2076kjm2993f10fbb"))))
    (build-system r-build-system)
    (home-page "https://cran.r-project.org/web/packages/idr/")
    (synopsis "Irreproducible discovery rate")
    (description
     "This is a package for estimating the copula mixture model and plotting
correspondence curves in \"Measuring reproducibility of high-throughput
experiments\" (2011), Annals of Applied Statistics, Vol. 5, No. 3, 1752-1779,
by Li, Brown, Huang, and Bickel")
    (license license:gpl2+)))

(define-public r-imola
  (package
    (name "r-imola")
    (version "0.5.0")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "imola" version))
       (sha256
        (base32 "087zdzn1vkyvqrdlwnackr6jyacrhg69q4b77s8z477kplickw8x"))))
    (properties `((upstream-name . "imola")))
    (build-system r-build-system)
    (propagated-inputs (list r-glue
                             r-htmltools
                             r-magrittr
                             r-shiny
                             r-stringi
                             r-yaml))
    (native-inputs (list r-knitr))
    (home-page "https://github.com/pedrocoutinhosilva/imola")
    (synopsis "CSS layouts (grid and flexbox) for R/Shiny")
    (description
     "This package allows users to create CSS grid and flexbox layouts for
R/Shiny without needing to write custom CSS.")
    (license license:expat)))

(define-public r-inext
  (package
    (name "r-inext")
    (version "3.0.1")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "iNEXT" version))
       (sha256
        (base32 "1nf4jhwqx5im966qzq7si78c5q4jgsa73d74ya8q8aj02n49jcyy"))))
    (properties `((upstream-name . "iNEXT")))
    (build-system r-build-system)
    (propagated-inputs (list r-ggplot2 r-rcpp r-reshape2))
    (native-inputs (list r-knitr r-testthat))
    (home-page "http://chao.stat.nthu.edu.tw/wordpress/software_download/")
    (synopsis "Interpolation and extrapolation for species diversity")
    (description
     "This package provides simple functions to compute and plot two types
(sample-size- and coverage-based) rarefaction and extrapolation curves for
species diversity (Hill numbers) based on individual-based abundance data or
sampling-unit- based incidence data; see Chao and others (2014, Ecological
Monographs) for pertinent theory and methodologies, and Hsieh, Ma and Chao
(2016, Methods in Ecology and Evolution) for an introduction of the R
package.")
    (license license:gpl3+)))

(define-public r-inline
  (package
    (name "r-inline")
    (version "0.3.21")
    (source (origin
              (method url-fetch)
              (uri (cran-uri "inline" version))
              (sha256
               (base32
                "165wg1iyqrcqxrm6k4jb8sdkfc99nrahx35w8sizcirsjc543yby"))))
    (build-system r-build-system)
    (home-page "https://cran.r-project.org/web/packages/inline")
    (synopsis "Functions to inline C, C++, Fortran function calls from R")
    (description
     "This package provides functionality to dynamically define R functions
and S4 methods with inlined C, C++ or Fortran code supporting @code{.C} and
@code{.Call} calling conventions.")
    ;; Any version of the LGPL.
    (license license:lgpl3+)))

(define-public r-inum
  (package
    (name "r-inum")
    (version "1.0-5")
    (source (origin
              (method url-fetch)
              (uri (cran-uri "inum" version))
              (sha256
               (base32
                "1gbbsffbzxjrgi8yw21fl35fsbx7ns8hdrhja50byfqvnghbg5p6"))))
    (build-system r-build-system)
    (propagated-inputs
     (list r-libcoin))
    (home-page "https://cran.r-project.org/web/packages/inum/")
    (synopsis "Interval and enum-type representation of vectors")
    (description
     "This package provides an enum-type representation of vectors and
representation of intervals, including a method of coercing variables
in data frames.")
    (license license:gpl2)))
(define-public r-invgamma
  (package
   (name "r-invgamma")
   (version "1.1")
   (source (origin
            (method url-fetch)
            (uri (cran-uri "invgamma" version))
            (sha256
             (base32
              "12ga2y4wc9bc5zz6vimvxwgjpsx3ys3209nq63gscbw559ydxa5a"))))
   (properties `((upstream-name . "invgamma")))
   (build-system r-build-system)
   (home-page "https://github.com/dkahle/invgamma")
   (synopsis "Inverse gamma distribution")
   (description "This package provides a light weight implementation of the
standard distribution functions for the inverse gamma distribution, wrapping
those for the gamma distribution in the @code{stats} package.")
   (license license:gpl2)))

(define-public r-bdsmatrix
  (package
    (name "r-bdsmatrix")
    (version "1.3-7")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "bdsmatrix" version))
       (sha256
        (base32
         "08krrd7454ixqv4nq55hgf3djp1pz1vl3ndslsrh2pkdq1d5wl63"))))
    (properties `((upstream-name . "bdsmatrix")))
    (build-system r-build-system)
    (home-page "https://cran.r-project.org/web/packages/bdsmatrix/")
    (synopsis "Routines for block diagonal symmetric matrices")
    (description
     "This package provides procedures to work with block diagonal symmetric
matrices, a special case of sparse matrices.")
    (license license:lgpl2.0)))

(define-public r-bbmle
  (package
    (name "r-bbmle")
    (version "1.0.25.1")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "bbmle" version))
       (sha256
        (base32
         "02xnfmjr5ax5pc69jkxmygkwvb68flrf1x8pxfw0hk7y37w0qanr"))))
    (build-system r-build-system)
    (propagated-inputs
     (list r-bdsmatrix
           r-lattice
           r-mass
           r-matrix
           r-mvtnorm
           r-numderiv))
    (native-inputs
     (list r-knitr r-testthat))
    (home-page "https://cran.r-project.org/web/packages/bbmle")
    (synopsis "Tools for General Maximum Likelihood Estimation")
    (description
     "This package provides methods and functions for fitting maximum
likelihood models in R.  This package modifies and extends the @code{mle}
classes in the @code{stats4} package.")
    ;; Any version of the GPL
    (license license:gpl2+)))

(define-public r-emdbook
  (package
    (name "r-emdbook")
    (version "1.3.13")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "emdbook" version))
       (sha256
        (base32
         "069w10i1590bcyzv4kfsg7wsr1yl9nlsyj6yvys088xll5z4n116"))))
    (build-system r-build-system)
    (propagated-inputs
     (list r-bbmle r-coda r-lattice r-mass r-plyr))
    (native-inputs (list r-testthat))
    (home-page "https://www.math.mcmaster.ca/bolker/emdbook")
    (synopsis "Support functions and data for \"Ecological Models and Data\"")
    (description
     "This package provides auxiliary functions and data sets for \"Ecological
Models and Data\", a book presenting maximum likelihood estimation and related
topics for ecologists (ISBN 978-0-691-12522-0).")
    ;; Any GPL version
    (license (list license:gpl2 license:gpl3))))

(define-public r-lpsolve
  (package
    (name "r-lpsolve")
    (version "5.6.23")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "lpSolve" version))
       (sha256
        (base32
         "1mx25kas78w9jygxk56qpk0r20i8fss1zj69fh0y8mpjsc3rdhs6"))))
    (properties `((upstream-name . "lpSolve")))
    (build-system r-build-system)
    (home-page "https://cran.r-project.org/web/packages/lpSolve")
    (synopsis "R interface to Lp_solve to solve linear/integer programs")
    (description
     "Lp_solve is software for solving linear, integer and mixed integer
programs.  This implementation supplies a \"wrapper\" function in C and some R
functions that solve general linear/integer problems, assignment problems, and
transportation problems.")
    (license license:lgpl2.0)))

(define-public r-lpsolveapi
  (package
    (name "r-lpsolveapi")
    (version "5.5.2.0-17.14")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "lpSolveAPI" version))
       (sha256
        (base32 "0kxxqiiwb1aqq7pk9kv1j7m7bjbyyqrf7jnrllag8najd735nh2n"))))
    (properties `((upstream-name . "lpSolveAPI")))
    (build-system r-build-system)
    (home-page "https://cran.r-project.org/package=lpSolveAPI")
    (synopsis "Interface to lp_solve")
    (description
     "The lpSolveAPI package provides an R interface to lp_solve, a @acronym{MILP,
Mixed Integer Linear Programming}, solver with support for pure linear, (mixed)
integer/binary, semi-continuous and @acronym{SOS, special ordered sets} models.")
    (license license:lgpl2.0)))

(define-public r-limsolve
  (package
    (name "r-limsolve")
    (version "1.5.7.2")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "limSolve" version))
       (sha256
        (base32
         "1pdsvynqvx43dc0zlw9k2np3wdlr5pva8gl5b387wzglh5dyarx2"))))
    (properties `((upstream-name . "limSolve")))
    (build-system r-build-system)
    (propagated-inputs
     (list r-lpsolve r-mass r-quadprog))
    (native-inputs (list gfortran))
    (home-page "https://cran.r-project.org/web/packages/limSolve")
    (synopsis "Solving linear inverse models")
    (description
     "This package provides functions that:

@enumerate
@item find the minimum/maximum of a linear or quadratic function,
@item sample an underdetermined or overdetermined system,
@item solve a linear system Ax=B for the unknown x.
@end enumerate

It includes banded and tridiagonal linear systems.  The package calls Fortran
functions from LINPACK.")
    ;; Any GPL version.
    (license (list license:gpl2+ license:gpl3+))))

(define-public r-lintools
  (package
    (name "r-lintools")
    (version "0.1.7")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "lintools" version))
       (sha256
        (base32 "03sfx1w3kl7xk79bpw6hddk7xylh2w2fp9zsgbd50150xp49p1ah"))))
    (properties `((upstream-name . "lintools")))
    (build-system r-build-system)
    (native-inputs (list r-knitr r-tinytest))
    (home-page "https://github.com/data-cleaning/lintools")
    (synopsis "Manipulation of linear systems of (in)equalities")
    (description
     "This is a package for variable elimination (Gaussian elimination,
Fourier-Motzkin elimination), Moore-Penrose pseudoinverse, reduction to
reduced row echelon form, value substitution, projecting a vector on the
convex polytope described by a system of (in)equations, simplify systems by
removing spurious columns and rows and collapse implied equalities, test if a
matrix is totally unimodular, compute variable ranges implied by
linear (in)equalities.")
    (license license:gpl3)))

(define-public r-litedown
  (package
    (name "r-litedown")
    (version "0.7")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "litedown" version))
       (sha256
        (base32 "0wdlplwiww0fb343ckmhikbk469fdwz8dj9vx0hx4sgjkmrb8b77"))))
    (properties `((upstream-name . "litedown")))
    (build-system r-build-system)
    ;; Building the vignettes requires internet access.
    (arguments (list #:test-types '(list "tests")))
    (propagated-inputs (list r-commonmark r-xfun))
    (home-page "https://github.com/yihui/litedown")
    (synopsis "Lightweight version of R Markdown")
    (description
     "Render R Markdown to Markdown (without using @code{knitr}), and Markdown
to lightweight HTML or @code{LaTeX} documents with the @code{commonmark}
package (instead of Pandoc).  Some missing Markdown features in
@code{commonmark} are also supported, such as raw HTML or @code{LaTeX} blocks,
@code{LaTeX} math, superscripts, subscripts, footnotes, element attributes,
and appendices, but not all Pandoc Markdown features are (or will be)
supported.  With additional @code{JavaScript} and CSS, you can also create
HTML slides and articles.  This package can be viewed as a trimmed-down
version of R Markdown and @code{knitr}.  It does not aim at rich Markdown
features or a large variety of output formats (the primary formats are HTML
and @code{LaTeX}).  Book and website projects of multiple input documents are
also supported.")
    (license license:expat)))

(define-public r-littler
  (package
    (name "r-littler")
    (version "0.3.21")
    (source (origin
              (method url-fetch)
              (uri (cran-uri "littler" version))
              (sha256
               (base32
                "11a0wrsrp0na5lwy33njskdgjlnzmm69aigqgb61xwvym6nfg2wy"))))
    (properties
     `((upstream-name . "littler")
       (updater-extra-inputs . ("icu4c" "libdeflate" "zlib"))))
    (build-system r-build-system)
    (arguments
     (list
      #:phases
      #~(modify-phases %standard-phases
          (add-after 'install 'install-executable
            (lambda _
              (install-file "inst/bin/r"
                            (string-append #$output "/bin")))))))
    (inputs (list icu4c libdeflate zlib))
    (native-inputs
     (list r-simplermarkdown))
    (home-page "https://github.com/eddelbuettel/littler")
    (synopsis "R at the command-line via r")
    (description
     "This package provides a scripting and command-line front-end is provided
by r (aka littler) as a lightweight binary wrapper around the GNU R language
and environment for statistical computing and graphics.  While R can be used
in batch mode, the r binary adds full support for both shebang-style scripting
(i.e. using a hash-mark-exclamation-path expression as the first line in
scripts) as well as command-line use in standard pipelines.  In other words, r
provides the R language without the environment.")
    (license license:gpl2+)))

(define-public r-fitdistrplus
  (package
    (name "r-fitdistrplus")
    (version "1.2-2")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "fitdistrplus" version))
       (sha256
        (base32
         "1ms5cisbv7k5kyn79hk13wr9dmf23lzria84w5z9h2d70zgn0hfp"))))
    (build-system r-build-system)
    (arguments
     (list
      #:phases
      '(modify-phases %standard-phases
         (add-after 'unpack 'delete-bad-tests
           (lambda _
             ;; Needs package GeneralizedHyperbolic
             (delete-file "tests/t-fitdist-customoptim.R")
             ;; Needs package rgenoud
             (delete-file "tests/t-fitdistcens.R"))))))
    (propagated-inputs
     (list r-mass r-rlang r-survival))
    (native-inputs
     (list r-actuar
           r-generalizedhyperbolic
           r-ggplot2
           r-knitr
           r-mc2d
           r-npsurv))
    (home-page "https://riskassessment.r-forge.r-project.org")
    (synopsis "Fitting a parametric distribution from data")
    (description
     "This package extends the @code{fitdistr} function of the MASS package
with several functions to help the fit of a parametric distribution to
non-censored or censored data.  Censored data may contain left-censored,
right-censored and interval-censored values, with several lower and upper
bounds.  In addition to @dfn{maximum likelihood estimation} (MLE), the package
provides moment matching (MME), quantile matching (QME) and maximum
goodness-of-fit estimation (MGE) methods (available only for non-censored
data).  Weighted versions of MLE, MME and QME are available.")
    (license license:gpl2+)))

(define-public r-energy
  (package
    (name "r-energy")
    (version "1.7-12")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "energy" version))
       (sha256
        (base32
         "0wkggv423bz9awi3dnxpmf62hdgfn5qgcvw1k4pvcsjczaz288mc"))))
    (build-system r-build-system)
    (propagated-inputs
     (list r-boot r-gsl r-rcpp))
    (home-page "https://cran.r-project.org/web/packages/energy")
    (synopsis "Multivariate inference via the energy of data")
    (description
     "This package provides e-statistics (energy) tests and statistics for
multivariate and univariate inference, including distance correlation,
one-sample, two-sample, and multi-sample tests for comparing multivariate
distributions, are implemented.  Measuring and testing multivariate
independence based on distance correlation, partial distance correlation,
multivariate goodness-of-fit tests, clustering based on energy distance,
testing for multivariate normality, distance components (disco) for
non-parametric analysis of structured data, and other energy
statistics/methods are implemented.")
    (license license:gpl2+)))

(define-public r-envstats
  (package
    (name "r-envstats")
    (version "3.1.0")
    (source (origin
              (method url-fetch)
              (uri (cran-uri "EnvStats" version))
              (sha256
               (base32
                "00ndb0wfhc3mg15b8sjf6l93q7h9mx2hsv8x7n4xi4r14hrvhhy7"))))
    (properties `((upstream-name . "EnvStats")))
    (build-system r-build-system)
    (propagated-inputs (list r-ggplot2 r-mass r-nortest))
    (home-page "https://github.com/alexkowa/EnvStats")
    (synopsis
     "Package for environmental statistics, including US EPA guidance")
    (description
     "This is a package for graphical and statistical analyses of
environmental data, with a focus on analyzing chemical concentrations and
physical parameters, usually in the context of mandated environmental
monitoring.  It provides major environmental statistical methods found in the
literature and regulatory guidance documents, with extensive help that
explains what these methods do, how to use them, and where to find them in the
literature.  It comes with numerous built-in data sets from regulatory
guidance documents and environmental statistics literature.  It includes
scripts reproducing analyses presented in the book \"EnvStats: An R Package
for Environmental Statistics\" (Millard, 2013, Springer, ISBN
978-1-4614-8455-4,
@url{https://link.springer.com/book/10.1007/978-1-4614-8456-1}).")
    (license license:gpl3+)))

(define-public r-suntools
  (package
    (name "r-suntools")
    (version "1.0.1")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "suntools" version))
       (sha256
        (base32 "1j7xz3yxg1azvcshb6sp88diipjiq37895cbipxm0s22dhhx1bqv"))))
    (properties
     `((upstream-name . "suntools")
       (updater-extra-native-inputs . ("tzdata-for-tests"))))
    (build-system r-build-system)
    (propagated-inputs (list r-sf))
    (native-inputs (list r-testthat tzdata-for-tests))
    (home-page "https://github.com/adokter/suntools/")
    (synopsis
     "Calculate sun position, sunrise, sunset, solar noon and twilight")
    (description
     "This package provides a set of convenient functions for calculating
sun-related information, including the sun's position (elevation and azimuth),
and the times of sunrise, sunset, solar noon, and twilight for any given
geographical location on Earth.  These calculations are based on equations
provided by the National Oceanic & Atmospheric Administration (NOAA) as
described in \"Astronomical Algorithms\" by Jean Meeus (1991).  A resource for
researchers and professionals working in fields such as climatology, biology,
and renewable energy.")
    (license license:gpl3+)))

(define-public r-suppdists
  (package
    (name "r-suppdists")
    (version "1.1-9.9")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "SuppDists" version))
       (sha256
        (base32
         "09m9vsrzr8c5ird9avfscnib2rs12scbkmawj78vwhc8jj0hig3z"))))
    (properties `((upstream-name . "SuppDists")))
    (build-system r-build-system)
    (home-page "https://cran.r-project.org/web/packages/SuppDists")
    (synopsis "Supplementary distributions")
    (description
     "This package provides ten distributions supplementing those built into
R.  Inverse Gauss, Kruskal-Wallis, Kendall's Tau, Friedman's chi squared,
Spearman's rho, maximum F ratio, the Pearson product moment correlation
coefficient, Johnson distributions, normal scores and generalized
hypergeometric distributions.  In addition two random number generators of
George Marsaglia are included.")
    (license license:gpl2+)))

(define-public r-kknn
  (package
    (name "r-kknn")
    (version "1.4.1")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "kknn" version))
       (sha256
        (base32
         "0d3gljnj904j7cd0a8pffpgdlyg0kix7dj0kns8xdyf0d31dscjj"))))
    (properties `((upstream-name . "kknn")))
    (build-system r-build-system)
    (propagated-inputs
     (list r-igraph r-matrix))
    (home-page "https://github.com/KlausVigo/kknn")
    (synopsis "Weighted k-nearest neighbors")
    (description
     "This is a package providing tools for weighted k-Nearest neighbors for
classification, regression and clustering.")
    (license license:gpl2+)))

(define-public r-knitr
  (package
    (name "r-knitr")
    (version "1.50")
    (source (origin
              (method url-fetch)
              (uri (cran-uri "knitr" version))
              (sha256
               (base32
                "0h9girrcwkswa786gy02hzpi539nrsrpqy3ap6a6qxmd4225wpqh"))))
    (properties
     ;; We can't have r-litedown among the inputs here to avoid a dependency
     ;; cycle.
     '((updater-ignored-native-inputs . ("r-litedown"))))
    (build-system r-build-system)
    ;; Tests need r-tibble, which needs r-knitr.
    (arguments (list #:tests? #false))
    (propagated-inputs
     (list r-evaluate r-highr r-xfun r-yaml))
    (home-page "https://yihui.org/knitr/")
    (synopsis "General-purpose package for dynamic report generation in R")
    (description
     "This package provides a general-purpose tool for dynamic report
generation in R using Literate Programming techniques.")
    ;; The code is released under any version of the GPL.  As it is used by
    ;; r-markdown which is available under GPLv2 only, we have chosen GPLv2+
    ;; here.
    (license license:gpl2+)))

(define-public r-knitrbootstrap
  (package
    (name "r-knitrbootstrap")
    (version "1.0.3")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "knitrBootstrap" version))
       (sha256
        (base32
         "157mn2gm7djfiw1b55vdr2ylrmgxlpfg95bmm82ghv5g6vr26smd"))))
    (properties `((upstream-name . "knitrBootstrap")))
    (build-system r-build-system)
    (propagated-inputs
     (list r-knitr r-markdown r-rmarkdown))
    (native-inputs (list r-knitr r-testthat))
    (home-page "https://github.com/jimhester/knitrBootstrap")
    (synopsis "Knitr bootstrap framework")
    (description
     "This package provides a framework to create Bootstrap 3 HTML reports
from knitr Rmarkdown.")
    (license license:expat)))

(define-public r-kit
  (package
    (name "r-kit")
    (version "0.0.20")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "kit" version))
       (sha256
        (base32 "11sy1j6k20fxx7fbbdsaqzm9ax74m62534zqi6jafq643fnnzng6"))))
    (properties `((upstream-name . "kit")))
    (build-system r-build-system)
    (home-page "https://cran.r-project.org/package=kit")
    (synopsis "Data manipulation functions implemented in C")
    (description
     "This package provides basic functions, implemented in C, for large data
manipulation.  Fast vectorised @code{ifelse()}/nested @code{if()/switch()}
functions, @code{psum()/pprod()} functions equivalent to @code{pmin()/pmax()}
plus others which are missing from base R.  Most of these functions are
callable at C level.")
    (license license:gpl3)))

(define-public r-kpmt
  (package
    (name "r-kpmt")
    (version "0.1.0")
    (source (origin
              (method url-fetch)
              (uri (cran-uri "kpmt" version))
              (sha256
               (base32
                "15d26khc0v3kc1c7l1avqp48pfqmc6xj32029mv7myivr41ashk3"))))
    (properties `((upstream-name . "kpmt")))
    (build-system r-build-system)
    (propagated-inputs (list r-matrixstats))
    (home-page "https://cran.r-project.org/package=kpmt")
    (synopsis "Known population median test")
    (description
     "This package provides functions that implement the known population
median test.")
    (license license:expat)))

(define-public r-ksamples
  (package
    (name "r-ksamples")
    (version "1.2-10")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "kSamples" version))
       (sha256
        (base32
         "13ap5ggid3w3s3k5mzz1ir31j96hjg6msa2s1hcy66zv242wqrid"))))
    (properties `((upstream-name . "kSamples")))
    (build-system r-build-system)
    (propagated-inputs
     (list r-suppdists))
    (home-page "https://cran.r-project.org/web/packages/kSamples")
    (synopsis "K-Sample rank tests and their combinations")
    (description
     "This package provides tools to compares k samples using the
Anderson-Darling test, Kruskal-Wallis type tests with different rank score
criteria, Steel's multiple comparison test, and the Jonckheere-Terpstra (JT)
test.  It computes asymptotic, simulated or (limited) exact P-values, all
valid under randomization, with or without ties, or conditionally under random
sampling from populations, given the observed tie pattern.  Except for Steel's
test and the JT test it also combines these tests across several blocks of
samples.")
    (license license:gpl2+)))

(define-public r-cvst
  (package
    (name "r-cvst")
    (version "0.2-3")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "CVST" version))
       (sha256
        (base32
         "0bgk0d6w3dyhb5s30idnp6jpb3m8wf3b79wqlg127wwm0cird8pg"))))
    (properties `((upstream-name . "CVST")))
    (build-system r-build-system)
    (propagated-inputs
     (list r-kernlab r-matrix))
    (home-page "https://cran.r-project.org/web/packages/CVST")
    (synopsis "Fast cross-validation via sequential testing")
    (description
     "This package implements the fast cross-validation via sequential
testing (CVST) procedure.  CVST is an improved cross-validation procedure
which uses non-parametric testing coupled with sequential analysis to
determine the best parameter set on linearly increasing subsets of the data.
Additionally to the CVST the package contains an implementation of the
ordinary k-fold cross-validation with a flexible and powerful set of helper
objects and methods to handle the overall model selection process.  The
implementations of the Cochran's Q test with permutations and the sequential
testing framework of Wald are generic and can therefore also be used in other
contexts.")
    (license license:gpl2+)))

(define-public r-cvxr
  (package
    (name "r-cvxr")
    (version "1.0-15")
    (source (origin
              (method url-fetch)
              (uri (cran-uri "CVXR" version))
              (sha256
               (base32
                "13435gwqgdaw7xxxza5k9p10z2wjlw9x5d1znj03h44k6wm1jfy1"))))
    (properties `((upstream-name . "CVXR")))
    (build-system r-build-system)
    (propagated-inputs
     (list r-bit64
           r-cli
           r-ecosolver
           r-gmp
           r-matrix
           r-osqp
           r-rcpp
           r-rcppeigen
           r-rmpfr
           r-scs))
    (native-inputs (list r-knitr r-testthat))
    (home-page "https://cvxr.rbind.io")
    (synopsis "Disciplined convex optimization")
    (description
     "This package provides an object-oriented modeling language for
@dfn{disciplined convex programming} (DCP) as described in Fu,
Narasimhan, and Boyd (2020, <doi:10.18637/jss.v094.i14>).  It allows
the user to formulate convex optimization problems in a natural way
following mathematical convention and DCP rules.  The system analyzes
the problem, verifies its convexity, converts it into a canonical
form, and hands it off to an appropriate solver to obtain the
solution.  Interfaces to solvers on CRAN and elsewhere are provided.")
    (license license:asl2.0)))

(define-public r-squarem
  (package
    (name "r-squarem")
    (version "2021.1")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "SQUAREM" version))
       (sha256
        (base32
         "0n1s32l9p4vdm3h5q6g43s0qbpzry08difsh0yay80wrla6f3rb6"))))
    (properties `((upstream-name . "SQUAREM")))
    (build-system r-build-system)
    (native-inputs (list r-setrng))
    (home-page "https://coah.jhu.edu/people/Faculty_personal_Pages/Varadhan.html")
    (synopsis "Squared Extrapolation Methods for Accelerating EM-Like Monotone Algorithms")
    (description
     "This package provides algorithms for accelerating the convergence of
slow, monotone sequences from smooth, contraction mapping such as the EM
algorithm.  It can be used to accelerate any smooth, linearly convergent
acceleration scheme.  A tutorial style introduction to this package is
available in a vignette.")
    (license license:gpl2+)))

(define-public r-progressr
  (package
    (name "r-progressr")
    (version "0.15.1")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "progressr" version))
       (sha256
        (base32 "09m4a21rwkm2g0z6m9di8vmammzzs391cn5ya00whps011wggn9h"))))
    (properties
     `((upstream-name . "progressr")
       ;; FIXME: these packages don't exist (yet?), but we also don't need
       ;; them for building or running tests.
       (updater-ignored-native-inputs . ("r-apply" "r-notifier"))))
    (build-system r-build-system)
    (propagated-inputs
     (list r-digest))
    (native-inputs (list r-beepr
                         r-dofuture
                         r-furrr
                         r-future
                         r-pbmcapply
                         r-plyr
                         r-progress
                         r-purrr
                         r-rstudioapi
                         r-shiny))
    (home-page "https://progressr.futureverse.org")
    (synopsis "Inclusive, unifying API for progress updates")
    (description
     "This package provides a minimal, unifying API for scripts and packages
to report progress updates from anywhere including when using parallel
processing.  The package is designed such that the developer can to focus on
what progress should be reported on without having to worry about how to
present it.  The end user has full control of how, where, and when to render
these progress updates.")
    (license license:gpl3+)))

(define-public r-lava
  (package
    (name "r-lava")
    (version "1.8.1")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "lava" version))
       (sha256
        (base32
         "10hkh96ms0c3jcwcdkqgficy2cx1qgz1kvq24b0ihgfhv946d7qq"))))
    (build-system r-build-system)
    (propagated-inputs
     (list r-cli
           r-future-apply
           r-numderiv
           r-progressr
           r-squarem
           r-survival))
    (native-inputs
     (list r-future
           r-geepack
           r-knitr
           r-lme4
           r-mass
           r-nlme
           r-polycor
           r-rmarkdown
           r-testthat))
    (home-page "https://github.com/kkholst/lava")
    (synopsis "Latent variable models")
    (description
     "This package provides tools for the estimation and simulation of latent
variable models.")
    (license license:gpl3)))

(define-public r-drat
  (package
    (name "r-drat")
    (version "0.2.5")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "drat" version))
       (sha256
        (base32 "1di28631gi890krazzvmfcpr2gv6gr83dzkn0rq2n2y0pmnkm2kf"))))
    (properties `((upstream-name . "drat")))
    (build-system r-build-system)
    (native-inputs (list r-simplermarkdown))
    (home-page "https://github.com/eddelbuettel/drat")
    (synopsis "Drat R archive template")
    (description
     "This package helps you with creation and use of R repositories via
helper functions to insert packages into a repository, and to add repository
information to the current R session.  Two primary types of repositories are
supported: gh-pages at GitHub, as well as local repositories on either the
same machine or a local network.  Drat is a recursive acronym: Drat R Archive
Template.")
    (license license:gpl2+)))

(define-public r-dreamerr
  (package
    (name "r-dreamerr")
    (version "1.5.0")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "dreamerr" version))
       (sha256
        (base32 "0y010ki78kvnm0mb9wmf1a3i6p3gh1kw1c33sd5d1j5s168602sr"))))
    (properties `((upstream-name . "dreamerr")))
    (build-system r-build-system)
    (propagated-inputs (list r-formula r-stringmagic))
    (native-inputs (list r-knitr))
    (home-page "https://cran.r-project.org/package=dreamerr")
    (synopsis "Error handling made easy")
    (description
     "This package provides a set of tools to facilitate package development
and make R a more user-friendly place.  It is intended mostly for
developers (or anyone who writes/shares functions).  It provides a simple,
powerful and flexible way to check the arguments passed to functions.  The
developer can easily describe the type of argument needed.  If the user
provides a wrong argument, then an informative error message is prompted with
the requested type and the problem clearly stated--saving the user a lot of
time in debugging.")
    (license license:gpl3)))

(define-public r-drr
  (package
    (name "r-drr")
    (version "0.0.4")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "DRR" version))
       (sha256
        (base32
         "1y70si1gig4l7jx5jiqsqliyywfsvimkx53x3zh1lc3yj2j6bqwk"))))
    (properties `((upstream-name . "DRR")))
    (build-system r-build-system)
    (propagated-inputs
     (list r-cvst r-kernlab r-matrix))
    (home-page "https://cran.r-project.org/web/packages/DRR")
    (synopsis "Dimensionality reduction via regression")
    (description
     "This package provides an implementation of dimensionality reduction via
regression using Kernel Ridge Regression.")
    (license license:gpl3)))

(define-public r-prodlim
  (package
    (name "r-prodlim")
    (version "2025.04.28")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "prodlim" version))
       (sha256
        (base32
         "0fpw443s38893rh456cc3d3bf3p5388hq8fb3i7xazclxfd09dv2"))))
    (build-system r-build-system)
    (propagated-inputs
     (list r-data-table
           r-diagram
           r-ggplot2
           r-kernsmooth
           r-lava
           r-rcpp
           r-rlang
           r-survival))
    (home-page "https://cran.r-project.org/web/packages/prodlim")
    (synopsis "Product-limit estimation for censored event history analysis")
    (description
     "This package provides a fast and user-friendly implementation of
nonparametric estimators for censored event history (survival) analysis with
the Kaplan-Meier and Aalen-Johansen methods.")
    (license license:gpl2+)))

(define-public r-dimred
  (package
    (name "r-dimred")
    (version "0.2.7")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "dimRed" version))
       (sha256
        (base32
         "1ivx02cqn5xgvbck7sdiapd4b32spc4h4fsn6n4js4c979fv8sxa"))))
    (properties `((upstream-name . "dimRed")))
    (build-system r-build-system)
    (propagated-inputs
     (list r-drr r-magrittr))
    (native-inputs
     (list r-knitr r-testthat))
    (home-page "https://github.com/gdkrmr/dimRed")
    (synopsis "Framework for dimensionality reduction")
    (description
     "This package provides a collection of dimensionality reduction
techniques from R packages and provides a common interface for calling the
methods.")
    (license license:gpl3)))

(define-public r-timechange
  (package
    (name "r-timechange")
    (version "0.3.0")
    (source (origin
              (method url-fetch)
              (uri (cran-uri "timechange" version))
              (sha256
               (base32
                "1d26mr3avw6bpx786k223bnylzqr7z1h7rrjc38pi5db2iahnp6q"))))
    (properties `((upstream-name . "timechange")))
    (build-system r-build-system)
    (arguments
     (list
      #:phases
      '(modify-phases %standard-phases
         ;; We need this for tests.
         (add-before 'check 'set-timezone
           (lambda* (#:key inputs #:allow-other-keys)
             (setenv "TZ" "UTC")
             (setenv "TZDIR"
                     (search-input-directory inputs
                                             "share/zoneinfo")))))))
    (propagated-inputs (list r-cpp11))
    (native-inputs (list r-testthat tzdata-for-tests))
    (home-page "https://github.com/vspinu/timechange/")
    (synopsis "Efficient manipulation of Date-Times")
    (description
     "This package provides efficient routines for manipulation of
date-time objects while accounting for time-zones and daylight saving
times.  The package includes utilities for updating of date-time
components (year, month, day etc.), modification of time-zones,
rounding of date-times, period addition and subtraction etc.  Parts of
the CCTZ source code, released under the Apache 2.0 License, are
included in this package.")
    (license license:gpl3)))

(define-public r-timedate
  (package
    (name "r-timedate")
    (version "4041.110")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "timeDate" version))
       (sha256
        (base32
         "1rvi1h7jm02vnsrk9mm0fldymf7zyjkv1id6xvn1iwgb5psz2syf"))))
    (properties `((upstream-name . "timeDate")))
    (build-system r-build-system)
    (arguments
     (list
      #:phases
      '(modify-phases %standard-phases
         (add-before 'check 'set-TZDIR
           (lambda* (#:key inputs #:allow-other-keys)
             ;; Tests would fail without this.
             (setenv "TZDIR"
                     (search-input-directory inputs "share/zoneinfo")))))))
    (native-inputs (list r-runit tzdata-for-tests))
    (home-page "https://www.rmetrics.org")
    (synopsis "Chronological and calendar objects")
    (description
     "This package provides an environment for teaching \"Financial
Engineering and Computational Finance\" and for managing chronological and
calendar objects.")
    (license license:gpl2+)))

(define-public r-magic
  (package
    (name "r-magic")
    (version "1.6-1")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "magic" version))
       (sha256
        (base32
         "0xkrrg5qk62pfqx0avijdjaljzslpwd0hv2m52qnqwrbx5xfqyfa"))))
    (build-system r-build-system)
    (propagated-inputs
     (list r-abind))
    (home-page "https://github.com/RobinHankin/magic.git")
    (synopsis "Create and investigate magic squares")
    (description
     "This package provides a collection of efficient, vectorized algorithms
for the creation and investigation of magic squares and hypercubes, including
a variety of functions for the manipulation and analysis of arbitrarily
dimensioned arrays.")
    (license license:gpl2)))

(define-public r-magicaxis
  (package
    (name "r-magicaxis")
    (version "2.4.5")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "magicaxis" version))
       (sha256
        (base32 "04wj0g345mlndd1s7v7klxldxlp293xdgjyrnfpzxckg59804j3d"))))
    (properties `((upstream-name . "magicaxis")))
    (build-system r-build-system)
    (propagated-inputs
     (list r-celestial
           r-mapproj
           r-mass
           r-plotrix
           r-rann
           r-sm))
    (home-page "https://cran.r-project.org/package=magicaxis")
    (synopsis "Scientific plotting with minor-tick and log minor-tick support")
    (description
     "This package provides functions to make useful (and pretty) plots for
scientific plotting.  Additional plotting features are added for base plotting,
with particular emphasis on making attractive log axis plots.")
    (license license:gpl3)))

(define-public r-rmysql
  (package
    (name "r-rmysql")
    (version "0.11.1")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "RMySQL" version))
       (sha256
        (base32
         "049nd1f9h7rgci6b7h183rl5z7xgikq8l9xxkdhhbvrnybk7m3l6"))))
    (properties `((upstream-name . "RMySQL")))
    (build-system r-build-system)
    (inputs
     (list `(,mariadb "dev") zlib))
    (propagated-inputs
     (list r-dbi))
    (native-inputs (list pkg-config r-testthat))
    (home-page "https://github.com/r-dbi/RMySQL")
    (synopsis "Database interface and MySQL driver for R")
    (description
     "This package provides a DBI interface to MySQL / MariaDB.  The RMySQL
package contains an old implementation based on legacy code from S-PLUS which
is being phased out.  A modern MySQL client based on Rcpp is available from
the RMariaDB package.")
    (license license:gpl2)))

(define-public r-rpanglaodb
  (package
    (name "r-rpanglaodb")
    (version "0.2.1")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "rPanglaoDB" version))
       (sha256
        (base32 "1ykzih3idgp2yhbw4039hhhzv0nmrmn3wx2c4dxmgp5qzhrg42nf"))))
    (properties `((upstream-name . "rPanglaoDB")))
    (build-system r-build-system)
    (propagated-inputs (list r-matrix r-pbapply r-seurat r-xml r-xml2))
    (home-page "https://github.com/dosorio/rPanglaoDB/")
    (synopsis
     "Download and merge Single-Cell RNA-Seq data from the PanglaoDB database")
    (description
     "This R package downloads labeled single-cell RNA-seq data from PanglaoDB.
It merges the data into a Seurat object for streamlined analysis.")
    (license license:gpl3)))

(define-public r-rpmm
  (package
    (name "r-rpmm")
    (version "1.25")
    (source (origin
              (method url-fetch)
              (uri (cran-uri "RPMM" version))
              (sha256
               (base32
                "1j48dh434wfhfzka0l21w6f73qlwfm70r9gdddhn504i2d5m4jph"))))
    (properties `((upstream-name . "RPMM")))
    (build-system r-build-system)
    (propagated-inputs (list r-cluster))
    (home-page "https://cran.r-project.org/package=RPMM")
    (synopsis "Recursively partitioned mixture model")
    (description
     "This package provides a recursively partitioned mixture model for Beta
and Gaussian mixtures.  This is a model-based clustering algorithm that
returns a hierarchy of classes, similar to hierarchical clustering, but also
similar to finite mixture models.")
    (license license:gpl2+)))

(define-public r-rpostgresql
  (package
    (name "r-rpostgresql")
    (version "0.7-8")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "RPostgreSQL" version))
       (sha256
        (base32
         "0g4ny3l6dl4grk99nvpm9fw3052f051bnz7h31hfacr5zrpsn5gj"))))
    (properties
     '((upstream-name . "RPostgreSQL")
       (updater-extra-inputs . ("postgresql"))
       (updater-ignored-inputs . ("openssl" "zlib"))))
    (build-system r-build-system)
    (inputs (list postgresql))
    (propagated-inputs (list r-dbi))
    (home-page "https://github.com/tomoakin/RPostgreSQL")
    (synopsis "R interface to the PostgreSQL database system")
    (description
     "This package provides a Database Interface (DBI) compliant driver for R
to access PostgreSQL database systems.")
    ;; The whole package is released under GPL version 2.  It includes code
    ;; under the PostgreSQL license.
    (license license:gpl2)))

(define-public r-rpostgres
  (package
    (name "r-rpostgres")
    (version "1.4.8")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "RPostgres" version))
       (sha256
        (base32
         "19382zfy9mqxkw3iksmcsiknrffkxpr6c2pcykf96x9qxsd84v0c"))))
    (properties
     '((upstream-name . "RPostgres")
       (updater-extra-inputs . ("postgresql"))))
    (build-system r-build-system)
    (inputs (list openssl postgresql))
    (propagated-inputs
     (list r-bit64
           r-blob
           r-cpp11
           r-dbi
           r-hms
           r-lubridate
           r-plogr
           r-withr))
    (native-inputs
     (list pkg-config
           r-callr
           r-dbitest
           r-knitr
           r-rlang
           r-testthat))
    (home-page "https://rpostgres.r-dbi.org")
    (synopsis "Rcpp Interface to PostgreSQL")
    (description
     "This package provides a fully @code{DBI}-compliant @code{Rcpp}-backed
interface to @code{PostgreSQL}, a relational database.")
    (license license:gpl3)))

(define-public r-linprog
  (package
    (name "r-linprog")
    (version "0.9-4")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "linprog" version))
       (sha256
        (base32
         "1d34m2nyk7m6j2dci69bhy5mlw479xax1517j7f14pq7vhpsm9l1"))))
    (build-system r-build-system)
    (propagated-inputs (list r-lpsolve))
    (home-page "https://linprog.r-forge.r-project.org/")
    (synopsis "Linear programming and optimization")
    (description
     "This package can be used to solve Linear Programming / Linear
Optimization problems by using the simplex algorithm.")
    (license license:gpl2+)))

(define-public r-geojsonsf
  (package
    (name "r-geojsonsf")
    (version "2.0.3")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "geojsonsf" version))
       (sha256
        (base32 "1la6zfzv14ascwds0bp67d7x3am0v14mylc4b2lyd0nrf93a2p17"))))
    (properties `((upstream-name . "geojsonsf")))
    (build-system r-build-system)
    (propagated-inputs (list r-geometries r-jsonify r-rapidjsonr r-rcpp
                             r-sfheaders))
    (native-inputs (list r-knitr))
    (home-page "https://github.com/SymbolixAU/geojsonsf")
    (synopsis "GeoJSON to Simple Feature converter")
    (description "This package converts between @code{GeoJSON} and Simple
Feature objects.")
    (license license:expat)))

(define-public r-geometries
  (package
    (name "r-geometries")
    (version "0.2.4")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "geometries" version))
       (sha256
        (base32 "040ljxmzbjdr76p81ygnn5y0gzckz5k2arxkih5m5f3b6g62laf6"))))
    (properties `((upstream-name . "geometries")))
    (build-system r-build-system)
    (propagated-inputs (list r-rcpp))
    (native-inputs (list r-knitr))
    (home-page "https://dcooley.github.io/geometries/")
    (synopsis "Convert between R objects and geometric structures")
    (description
     "Geometry shapes in R are typically represented by matrices (points,
lines), with more complex shapes being lists of matrices (polygons).
Geometries will convert various R objects into these shapes.  Conversion
functions are available at both the R level, and through Rcpp.")
    (license license:expat)))

(define-public r-geometry
  (package
    (name "r-geometry")
    (version "0.5.2")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "geometry" version))
       (sha256
        (base32
         "19a6kgnq01s80pca9289lwdgvwg0h3dlv7fr1shi4cd8mlbiwfn8"))))
    (build-system r-build-system)
    (propagated-inputs
     (list r-linprog r-lpsolve r-magic r-rcpp r-rcppprogress))
    (native-inputs (list r-spelling r-testthat))
    (home-page "https://geometry.r-forge.r-project.org/")
    (synopsis "Mesh generator and surface tessellator")
    (description
     "This package makes the qhull library available in R, in a similar manner
as in Octave.  Qhull computes convex hulls, Delaunay triangulations, halfspace
intersections about a point, Voronoi diagrams, furthest-site Delaunay
triangulations, and furthest-site Voronoi diagrams.  It runs in 2-d, 3-d, 4-d,
and higher dimensions.  It implements the Quickhull algorithm for computing
the convex hull.  Qhull does not support constrained Delaunay triangulations,
or mesh generation of non-convex objects, but the package does include some R
functions that allow for this.  Currently the package only gives access to
Delaunay triangulation and convex hull computation.")
    ;; The Qhull sources are included and are distributed under a custom
    ;; non-copyleft license.  The R sources are released under GPL version 2.
    (license (list license:gpl2
                   (license:non-copyleft "http://www.qhull.org/COPYING.txt")))))

(define-public r-ddalpha
  (package
    (name "r-ddalpha")
    (version "1.3.16")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "ddalpha" version))
       (sha256
        (base32
         "1139a50ili4w04034fmpxsbn2j17nx1ns5f07cijgqpskxjgi41r"))))
    (build-system r-build-system)
    (propagated-inputs
     (list r-bh
           r-class
           r-geometry
           r-mass
           r-rcpp
           r-robustbase
           r-sfsmisc))
    (native-inputs
     (list gfortran))
    (home-page "https://cran.r-project.org/web/packages/ddalpha")
    (synopsis "Depth-Based classification and calculation of data depth")
    (description
     "This package contains procedures for depth-based supervised learning,
which are entirely non-parametric, in particular the DDalpha-procedure (Lange,
Mosler and Mozharovskyi, 2014).  The training data sample is transformed by a
statistical depth function to a compact low-dimensional space, where the final
classification is done.  It also offers an extension to functional data and
routines for calculating certain notions of statistical depth functions.  50
multivariate and 5 functional classification problems are included.")
    (license license:gpl2)))

(define-public r-gower
  (package
    (name "r-gower")
    (version "1.0.2")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "gower" version))
       (sha256
        (base32
         "0lap31w6y82z65r5byfpijgrn31lh42ssiwncbakn4r60fjnkmag"))))
    (build-system r-build-system)
    (home-page "https://github.com/markvanderloo/gower")
    (synopsis "Gower's distance")
    (description
     "This package provides tools to compute Gower's distance (or similarity)
coefficient between records, and to compute the top-n matches between records.
Core algorithms are executed in parallel on systems supporting OpenMP.")
    (license license:gpl3)))

(define-public r-rcpproll
  (package
    (name "r-rcpproll")
    (version "0.3.1")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "RcppRoll" version))
       (sha256
        (base32
         "1prnc3svhc2v1w97vbdzfyxh545zx2h0p9d1q4753f7ynrwdkxfj"))))
    (properties `((upstream-name . "RcppRoll")))
    (build-system r-build-system)
    (propagated-inputs
     (list r-rcpp))
    (native-inputs (list r-testthat))
    (home-page "https://cran.r-project.org/web/packages/RcppRoll")
    (synopsis "Efficient rolling and windowed operations")
    (description
     "This package provides fast and efficient routines for common rolling /
windowed operations.  Routines for the efficient computation of windowed mean,
median, sum, product, minimum, maximum, standard deviation and variance are
provided.")
    (license license:gpl2+)))

(define-public r-ipred
  (package
    (name "r-ipred")
    (version "0.9-15")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "ipred" version))
       (sha256
        (base32
         "0jzfq06l2vxyjy46sjgqyk6l4pp06kx3w5j39hzjy9i127hjsxd4"))))
    (build-system r-build-system)
    (propagated-inputs
     (list r-class
           r-mass
           r-nnet
           r-prodlim
           r-rpart
           r-survival))
    (native-inputs (list r-mlbench r-th-data))
    (home-page "https://cran.r-project.org/web/packages/ipred")
    (synopsis "Improved predictors")
    (description
     "This package provides improved predictive models by indirect
classification and bagging for classification, regression and survival
problems as well as resampling based estimators of prediction error.")
    (license license:gpl2+)))

(define-public r-psych
  (package
    (name "r-psych")
    (version "2.5.3")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "psych" version))
       (sha256
        (base32
         "1glgpbsf83b9ibj4rbxhz433634jhfx7jh4r0czfzf76w92vr76x"))))
    (build-system r-build-system)
    (propagated-inputs
     (list r-gparotation r-lattice r-mnormt r-nlme))
    (native-inputs
     (list r-knitr))
    (home-page "https://cran.r-project.org/web/packages/psych/")
    (synopsis "Procedures for psychological, psychometric, and personality research")
    (description
     "This package provides a general purpose toolbox for personality,
psychometric theory and experimental psychology.  Functions are primarily for
multivariate analysis and scale construction using factor analysis, principal
component analysis, cluster analysis and reliability analysis, although others
provide basic descriptive statistics.  Item Response Theory is done using
factor analysis of tetrachoric and polychoric correlations.  Functions for
analyzing data at multiple levels include within and between group statistics,
including correlations and factor analysis.  Functions for simulating and
testing particular item and test structures are included.  Several functions
serve as a useful front end for structural equation modeling.  Graphical
displays of path diagrams, factor analysis and structural equation models are
created using basic graphics.")
    (license license:gpl2+)))

(define-public r-psychotools
  (package
    (name "r-psychotools")
    (version "0.7-4")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "psychotools" version))
       (sha256
        (base32 "197hym0fxfsyg6kf0pf9g5wbsa1kkicd4lqrxfy2g3c7aczad9zy"))))
    (properties `((upstream-name . "psychotools")))
    (build-system r-build-system)
    (home-page "https://cran.r-project.org/package=psychotools")
    (synopsis "Psychometric modeling infrastructure")
    (description
     "This package provides infrastructure for psychometric modeling such as
data classes (for item response data and paired comparisons), basic model
fitting functions (for Bradley-Terry, Rasch, parametric logistic IRT,
generalized partial credit, rating scale, multinomial processing tree models),
extractor functions for different types of parameters (item, person,
threshold, discrimination, guessing, upper asymptotes), unified inference and
visualizations, and various datasets for illustration.  It is intended as a
common lightweight and efficient toolbox for psychometric modeling and a
common building block for fitting psychometric mixture models in package
@code{psychomix} and trees based on psychometric models in package
@code{psychotree}.")
    (license (list license:gpl2 license:gpl3))))

(define-public r-psychotree
  (package
    (name "r-psychotree")
    (version "0.16-1")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "psychotree" version))
       (sha256
        (base32 "04ipl6kadfvyl28wx8jbpisb4pcswrwq1qiqm90h47ldbnmha932"))))
    (properties `((upstream-name . "psychotree")))
    (build-system r-build-system)
    (propagated-inputs (list r-formula r-partykit r-psychotools))
    (home-page "https://cran.r-project.org/package=psychotree")
    (synopsis "Recursive Partitioning Based on Psychometric Models")
    (description
     "Recursive partitioning based on psychometric models, employing the general MOB
algorithm (from package partykit) to obtain Bradley-Terry trees, Rasch trees,
rating scale and partial credit trees, and MPT trees, trees for 1PL, 2PL, 3PL
and 4PL models and generalized partial credit models.")
    (license (list license:gpl2 license:gpl3))))

(define-public r-generalizedhyperbolic
  (package
    (name "r-generalizedhyperbolic")
    (version "0.8-7")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "GeneralizedHyperbolic" version))
       (sha256
        (base32 "08z4jz9lzyc0afvxqw6m2p9h54lqk6hn1a8mva5lrddxlxf04qbv"))))
    (properties `((upstream-name . "GeneralizedHyperbolic")))
    (build-system r-build-system)
    (propagated-inputs (list r-distributionutils r-mass))
    (home-page "https://r-forge.r-project.org/projects/rmetrics/")
    (synopsis "Generalized hyperbolic distribution")
    (description
     "This package provides functions for the hyperbolic and related
distributions.  Density, distribution and quantile functions and random number
generation are provided for the hyperbolic distribution, the generalized
hyperbolic distribution, the generalized inverse Gaussian distribution and the
skew-Laplace distribution.  Additional functionality is provided for the
hyperbolic distribution, normal inverse Gaussian distribution and generalized
inverse Gaussian distribution, including fitting of these distributions to
data.  Linear models with hyperbolic errors may be fitted using
@code{hyperblmFit}.")
    (license license:gpl2+)))

(define-public r-generics
  (package
    (name "r-generics")
    (version "0.1.4")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "generics" version))
       (sha256
        (base32
         "0088il4adipaicxy65shbvm6cnxry6576xz6nz1qzlwjfw4mmsdv"))))
    (build-system r-build-system)
    (native-inputs (list r-testthat))
    (home-page "https://github.com/r-lib/generics")
    (synopsis "Common S3 generics not provided by base R methods")
    (description
     "In order to reduce potential package dependencies and conflicts,
generics provides a number of commonly used S3 generics that are not provided
by base R methods related to model fitting.")
    (license license:gpl2)))

(define-public r-broom
  (package
    (name "r-broom")
    (version "1.0.8")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "broom" version))
       (sha256
        (base32
         "0i4b80vs29b064930qvlhfxpkx3a49kvf4r0psnsknyayr18asfl"))))
    (build-system r-build-system)
    (propagated-inputs
     (list r-backports
           r-cli
           r-dplyr
           r-generics
           r-glue
           r-lifecycle
           r-purrr
           r-rlang
           r-stringr
           r-tibble
           r-tidyr))
    (native-inputs
     (list r-knitr r-testthat))
    (home-page "https://github.com/tidyverse/broom")
    (synopsis "Convert statistical analysis objects into tidy data frames")
    (description
     "This package provides tools to convert statistical analysis objects from
R into tidy data frames, so that they can more easily be combined, reshaped
and otherwise processed with tools like @code{dplyr}, @code{tidyr} and
@code{ggplot2}.  The package provides three S3 generics: @code{tidy}, which
summarizes a model's statistical findings such as coefficients of a
regression; @code{augment}, which adds columns to the original data such as
predictions, residuals and cluster assignments; and @code{glance}, which
provides a one-row summary of model-level statistics.")
    (license license:expat)))

(define-public r-recipes
  (package
    (name "r-recipes")
    (version "1.3.1")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "recipes" version))
       (sha256
        (base32
         "1i6wk6yhdmhm37vihyh1r3s1nxhihwacmhlj4yaygsfdzyqnzfnf"))))
    (properties
     ;; Avoid dependency cycle as r-workflows depends on r-recipes.  r-disp is
     ;; not packaged, but we don't seem to need it.
     '((updater-ignored-native-inputs . ("r-disp" "r-workflows"))))
    (build-system r-build-system)
    (propagated-inputs
     (list r-cli
           r-clock
           r-dplyr
           r-generics
           r-glue
           r-gower
           r-hardhat
           r-ipred
           r-lifecycle
           r-lubridate
           r-magrittr
           r-matrix
           r-purrr
           r-rlang
           r-sparsevctrs
           r-tibble
           r-tidyr
           r-tidyselect
           r-timedate
           r-vctrs
           r-withr))
    (native-inputs
     (list r-ddalpha
           r-dials
           r-kernlab
           r-knitr
           r-modeldata
           r-parsnip
           r-rpart
           r-rsample
           r-splines2
           r-testthat))
    (home-page "https://github.com/topepo/recipes")
    (synopsis "Preprocessing tools to create design matrices")
    (description
     "Recipes is an extensible framework to create and preprocess design
matrices.  Recipes consist of one or more data manipulation and analysis
\"steps\".  Statistical parameters for the steps can be estimated from an
initial data set and then applied to other data sets.  The resulting design
matrices can then be used as inputs into statistical or machine learning
models.")
    (license license:gpl2)))

(define-public r-pdist
  (package
    (name "r-pdist")
    (version "1.2.1")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "pdist" version))
       (sha256
        (base32
         "0bvg8si81hs79v39d7svv4zbv2p0sk2r6m9vamibvkh9qvl4x406"))))
    (build-system r-build-system)
    (home-page "https://github.com/jeffwong/pdist")
    (synopsis "Partitioned distance function")
    (description
     "Pdist computes the euclidean distance between rows of a matrix X and
rows of another matrix Y.  Previously, this could be done by binding the two
matrices together and calling @code{dist}, but this creates unnecessary
computation by computing the distances between a row of X and another row of
X, and likewise for Y.  Pdist strictly computes distances across the two
matrices, not within the same matrix, making computations significantly faster
for certain use cases.")
    (license license:gpl3+)))

(define-public r-ggrepel
  (package
    (name "r-ggrepel")
    (version "0.9.6")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "ggrepel" version))
       (sha256
        (base32
         "04kj9qzcws6wfw9pf3s6w4phpqywyv6j617l7907plkpcgd6x2i6"))))
    (build-system r-build-system)
    (properties
     '((updater-extra-native-inputs . ("v-diffr"))))
    (propagated-inputs
     (list r-ggplot2 r-rcpp r-rlang r-scales r-withr))
    (native-inputs
     (list r-knitr r-testthat r-vdiffr))
    (home-page "https://github.com/slowkow/ggrepel")
    (synopsis "Repulsive text and label geometries for ggplot2")
    (description
     "This package provides text and label geometries for ggplot2 that help to
avoid overlapping text labels.  Labels repel away from each other and away
from the data points.")
    (license license:gpl3)))

(define-public r-coro
  (package
    (name "r-coro")
    (version "1.1.0")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "coro" version))
       (sha256
        (base32 "1kvaf5484s6dn6zm4nw0ns6fi09lcqnljb51w4fdgsm80s04k6kc"))))
    (properties
     '((upstream-name . "coro")
       (updater-extra-native-inputs . ("r-later" "r-promises"))))
    (build-system r-build-system)
    (propagated-inputs (list r-rlang))
    (native-inputs (list r-knitr r-later r-promises r-testthat))
    (home-page "https://github.com/r-lib/coro")
    (synopsis "Coroutines for R")
    (description
     "This package provides coroutines for R, a family of functions that can
be suspended and resumed later on.  This includes async functions (which
await) and generators (which yield).  Async functions are based on the
concurrency framework of the @code{promises} package.  Generators are based on
a dependency free iteration protocol defined in @code{coro} and are compatible
with iterators from the @code{reticulate} package.")
    (license license:expat)))

(define-public r-corrplot
  (package
    (name "r-corrplot")
    (version "0.95")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "corrplot" version))
       (sha256
        (base32
         "0xnpi4cqclsikd00mjn0qb611g1a619hfr2d3ch8kra1a1kiz8w4"))))
    (build-system r-build-system)
    (native-inputs
     (list r-knitr r-testthat))
    (home-page "https://github.com/taiyun/corrplot")
    (synopsis "Visualization of a correlation matrix")
    (description
     "This package provides a graphical display of a correlation matrix or
general matrix.  It also contains some algorithms to do matrix reordering.  In
addition, corrplot is good at details, including choosing color, text labels,
color labels, layout, etc.")
    ;; Any version of the GPL
    (license license:gpl2+)))

(define-public r-stable
  (package
    (name "r-stable")
    (version "1.1.6")
    (source (origin
              (method url-fetch)
              (uri (cran-uri "stable" version))
              (sha256
               (base32
                "194xsa291v5f0jya1c3aigbclg8cci427ffpb8brxamm6n57hf12"))))
    (properties `((upstream-name . "stable")))
    (build-system r-build-system)
    (propagated-inputs (list r-rmutil))
    (home-page "https://www.commanster.eu/rcode.html")
    (synopsis
     "Probability functions and regression models for stable distributions")
    (description
     "This package provides density, distribution, quantile and hazard
functions of a stable variate, as well as generalized regression models for
the parameters of a stable distribution.")
    (license license:gpl2+)))

(define-public r-stabm
  (package
    (name "r-stabm")
    (version "1.2.2")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "stabm" version))
       (sha256
        (base32 "1vslidq2pzpwhsrsklghaqsdjjf4w4wqs2dng0p68zhrv5vlivhq"))))
    (properties
     '((upstream-name . "stabm")
       (updater-extra-native-inputs
        . ("r-cowplot" "r-ggdendro" "r-ggplot2" "r-igraph"))))
    (build-system r-build-system)
    (propagated-inputs (list r-checkmate r-matrix))
    (native-inputs (list r-cowplot
                         r-ggdendro
                         r-ggplot2
                         r-igraph
                         r-knitr r-testthat))
    (home-page "https://bommert.github.io/stabm/")
    (synopsis "Stability measures for feature selection")
    (description
     "This package provides an implementation of many measures for the
assessment of the stability of feature selection.  Both simple measures and
measures which take into account the similarities between features are
available.")
    (license license:lgpl3)))

(define-public r-statip
  (package
    (name "r-statip")
    (version "0.2.3")
    (source (origin
              (method url-fetch)
              (uri (cran-uri "statip" version))
              (sha256
               (base32
                "0kymc3ds1nx0h11ffmm3vmqr1w34gd0k788vf72x2v45h8c1ma2n"))))
    (properties `((upstream-name . "statip")))
    (build-system r-build-system)
    (propagated-inputs
     (list r-clue r-rpart))
    (native-inputs (list r-testthat))
    (home-page "https://github.com/paulponcet/statip")
    (synopsis "Statistical functions for probability distributions and regression")
    (description
     "This package provides a collection of miscellaneous statistical
functions for:
@itemize
@item probability distributions,
@item probability density estimation,
@item most frequent value estimation,
@item other statistical measures of location,
@item construction of histograms,
@item calculation of the Hellinger distance,
@item use of classical kernels, and
@item univariate piecewise-constant regression.
@end itemize")
    (license license:gpl3)))

(define-public r-statsexpressions
  (package
    (name "r-statsexpressions")
    (version "1.7.0")
    (source (origin
              (method url-fetch)
              (uri (cran-uri "statsExpressions" version))
              (sha256
               (base32
                "06znshf4wlg4ffqywabxrramii919zbywapn5b5wx1mdwayxkf51"))))
    (properties `((upstream-name . "statsExpressions")))
    (build-system r-build-system)
    (propagated-inputs (list r-afex
                             r-bayesfactor
                             r-bayestestr
                             r-correlation
                             r-datawizard
                             r-dplyr
                             r-effectsize
                             r-glue
                             r-insight
                             r-magrittr
                             r-parameters
                             r-performance
                             r-pmcmrplus
                             r-purrr
                             r-rlang
                             r-rstantools
                             r-tidyr
                             r-withr
                             r-wrs2
                             r-zeallot))
    (native-inputs (list r-datapasta
                         r-ggplot2
                         r-knitr
                         r-patrick
                         r-survival
                         r-testthat))
    (home-page "https://indrajeetpatil.github.io/statsExpressions/")
    (synopsis "Dataframes and expressions with statistical details")
    (description
     "This package provides tools for creating detailed dataframes for common
statistical approaches and tests.  These include parametric, nonparametric,
robust, and Bayesian t-test, one-way ANOVA, correlation analyses, contingency
table analyses, and meta-analyses.  The functions are pipe-friendly and
provide a consistent syntax to work with tidy data.  These dataframes
additionally contain expressions with statistical details, and can be used in
graphing packages.  This package also forms the statistical processing backend
for ggstatsplot.")
    (license license:gpl3)))

(define-public r-stddiff
  (package
    (name "r-stddiff")
    (version "3.1")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "stddiff" version))
       (sha256
        (base32 "1lirfxqiq59vhjkq1zv27ycybbs9n62c14klkkcf74j15a54cmbn"))))
    (properties `((upstream-name . "stddiff")))
    (build-system r-build-system)
    (home-page "https://cran.r-project.org/package=stddiff")
    (synopsis
     "Calculate standardized difference for numeric, binary and category variables")
    (description
     "This package contains three main functions including
@code{stddiff.numeric()}, @code{stddiff.binary()} and
@code{stddiff.category()}.  These are used to calculate the standardized
difference between two groups.  It is especially used to evaluate the balance
between two groups before and after propensity score matching.")
    (license license:gpl3)))

(define-public r-strawr
  (package
    (name "r-strawr")
    (version "0.0.92")
    (source (origin
              (method url-fetch)
              (uri (cran-uri "strawr" version))
              (sha256
               (base32
                "0dy6pagwvmswmrlvb9ndy8lz3krcm8fqik83l0gmv9wjb9vba27s"))))
    (properties `((upstream-name . "strawr")))
    (build-system r-build-system)
    (inputs (list curl zlib))
    (propagated-inputs (list r-rcpp))
    (home-page "https://github.com/aidenlab/straw/tree/master/R")
    (synopsis "Fast implementation of reading / dumping of .hic files")
    (description
     "This package provides an API for efficient @file{.hic} file data
extraction with programmatic matrix access.  It doesn't store the pointer data
for all the matrices, only the one queried, and currently it only supports
matrices.")
    (license license:expat)))

(define-public r-stringdist
  (package
    (name "r-stringdist")
    (version "0.9.15")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "stringdist" version))
       (sha256
        (base32 "06151jksz8iaigvi20qbcrqjh684w5gii4wmxvnm5v1iwm5bxks4"))))
    (build-system r-build-system)
    (home-page "https://github.com/markvanderloo/stringdist")
    (synopsis "Approximate string matching and string distance functions")
    (description
     "This package implements an approximate string matching version of R's
native @code{match} function.  It can calculate various string distances based
on edits (Damerau-Levenshtein, Hamming, Levenshtein, optimal string alignment),
qgrams (q- gram, cosine, jaccard distance) or heuristic metrics (Jaro,
Jaro-Winkler).  An implementation of soundex is provided as well.  Distances
can be computed between character vectors while taking proper care of encoding
or between integer vectors representing generic sequences.")
    (license license:gpl3+)))

(define-public r-stringmagic
  (package
    (name "r-stringmagic")
    (version "1.2.0")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "stringmagic" version))
       (sha256
        (base32 "180kzm9gbl4jr9vwh58r9qyp78svmakh68zkhxfb43bxk3zq20m6"))))
    (properties `((upstream-name . "stringmagic")))
    (build-system r-build-system)
    ;; There are no tests in the ./tests/ directory.
    (arguments (list #:tests? #false))
    (propagated-inputs (list r-rcpp))
    (native-inputs (list r-knitr))
    (home-page "https://lrberge.github.io/stringmagic/")
    (synopsis "Character string operations and interpolation, magic edition")
    (description
     "This package performs complex string operations compactly and
efficiently.  It supports string interpolation jointly with over 50 string
operations.  It also enhances regular string functions (like @code{grep()} and
co).")
    (license license:gpl2+)))

(define-public r-uchardet
  (package
    (name "r-uchardet")
    (version "1.1.1")
    (source (origin
              (method url-fetch)
              (uri (cran-uri "uchardet" version))
              (sha256
               (base32
                "0m3xy807smqdxhkhd9cwrcf3ljlyvfmnkd7831qzpgcadam2jcdj"))))
    (properties `((upstream-name . "uchardet")))
    (build-system r-build-system)
    (native-inputs (list r-knitr))
    (home-page "https://artemklevtsov.gitlab.io/uchardet")
    (synopsis "Universal character encoding detector")
    (description
     "This package provides R bindings to the uchardet encoding detector
library from Mozilla.  It takes a sequence of bytes in an unknown character
encoding without any additional information, and attempts to get the encoding
of the text.  All return names of the encodings are iconv-compatible.")
    (license license:gpl2)))

(define-public r-ucminf
  (package
    (name "r-ucminf")
    (version "1.2.2")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "ucminf" version))
       (sha256
        (base32
         "0adxynpi6mn5n37i1260yr6z7dm39dadr4nwrxks2jgsd7knmnsb"))))
    (build-system r-build-system)
    (native-inputs (list gfortran))
    (home-page "https://cran.r-project.org/web/packages/ucminf/")
    (synopsis "General-purpose unconstrained non-linear optimization")
    (description
     "This package provides an implementation of an algorithm for
general-purpose unconstrained non-linear optimization.  The algorithm is of
quasi-Newton type with BFGS updating of the inverse Hessian and soft line
search with a trust region type monitoring of the input to the line search
algorithm.  The interface of @code{ucminf} is designed for easy interchange
with the package @code{optim}.")
    (license license:gpl2+)))

(define-public r-usedist
  (package
    (name "r-usedist")
    (version "0.4.0")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "usedist" version))
       (sha256
        (base32 "0ddf1zcalbrn293qmr9kdzz3x16fzc4k1bwb1pjmwnspisqfi8kj"))))
    (properties
     '((upstream-name . "usedist")
       (updater-extra-native-inputs . ("r-dplyr" "r-tidyr" "r-tibble"))))
    (build-system r-build-system)
    (native-inputs (list r-dplyr r-testthat r-tidyr r-tibble))
    (home-page "https://cran.r-project.org/package=usedist")
    (synopsis "Distance matrix utilities")
    (description
     "This package provides functions to re-arrange, extract, and work with
distances.")
    (license license:gpl3)))

(define-public r-useful
  (package
   (name "r-useful")
   (version "1.2.6.1")
   (source (origin
            (method url-fetch)
            (uri (cran-uri "useful" version))
            (sha256
             (base32
              "1gb9hqvbm6pr56dfqlsgz26lan7xargfsm8jpdja18mpgli2gyvc"))))
   (properties `((upstream-name . "useful")))
   (build-system r-build-system)
   (propagated-inputs
    (list r-assertthat
          r-dplyr
          r-ggplot2
          r-magrittr
          r-matrix
          r-plyr
          r-purrr
          r-scales))
   (native-inputs (list r-testthat))
   (home-page "https://github.com/jaredlander/useful")
   (synopsis "Collection of handy, useful functions")
   (description "This package provides a set of little functions that have been
found useful to do little odds and ends such as plotting the results of K-means
clustering, substituting special text characters, viewing parts of a
@code{data.frame}, constructing formulas from text and building design and
response matrices.")
   (license license:bsd-3)))

(define-public r-ordinal
  (package
    (name "r-ordinal")
    (version "2023.12-4.1")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "ordinal" version))
       (sha256
        (base32
         "1c9qiv0zz77i80gbhljj9hm4lh2zs9chfg834lcgyr6972jcz79c"))))
    (build-system r-build-system)
    (propagated-inputs
     (list r-mass r-matrix r-nlme r-numderiv r-ucminf))
    (native-inputs (list r-lme4 r-testthat r-xtable))
    (home-page "https://github.com/runehaubo/ordinal")
    (synopsis "Regression models for ordinal data")
    (description
     "This package provides an implementation of cumulative link (mixed)
models also known as ordered regression models, proportional odds models,
proportional hazards models for grouped survival times and ordered models.
Estimation is via maximum likelihood and mixed models are fitted with the
Laplace approximation and adaptive Gauss-Hermite quadrature.")
    (license license:gpl2+)))

(define-public r-jomo
  (package
    (name "r-jomo")
    (version "2.7-6")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "jomo" version))
       (sha256
        (base32
         "1np2sw0kq21kdhkv227pz2rqvpxg06r3mk93ggkrz5nl45ajmyiz"))))
    (build-system r-build-system)
    (propagated-inputs
     (list r-lme4 r-mass r-ordinal r-survival r-tibble))
    (home-page "https://cran.r-project.org/web/packages/jomo/")
    (synopsis "Multilevel Joint Modelling Multiple Imputation")
    (description
     "Similarly to Schafer's package pan, jomo is a package for multilevel
joint modelling multiple imputation @url{Carpenter and Kenward (2013),
http://doi.org/10.1002/9781119942283}.  Novel aspects of jomo are the
possibility of handling binary and categorical data through latent normal
variables, the option to use cluster-specific covariance matrices and to
impute compatibly with the substantive model.")
    (license license:gpl2)))

(define-public r-pan
  (package
    (name "r-pan")
    (version "1.9")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "pan" version))
       (sha256
        (base32 "1skfdh8mg3hs9h651shyn80maas71jlbmvn06izym0rpclnj74fd"))))
    (build-system r-build-system)
    (native-inputs (list gfortran))
    (home-page "https://cran.r-project.org/web/packages/pan/")
    (synopsis "Multiple imputation for multivariate panel or clustered data")
    (description
     "This package implements multiple imputation for multivariate panel or
clustered data.")
    (license license:gpl3)))

(define-public r-mitml
  (package
    (name "r-mitml")
    (version "0.4-5")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "mitml" version))
       (sha256
        (base32
         "1szfw993ma4qn377bab08bkvm4s0sxs5x2hdcj9kgk47661fqsh5"))))
    (build-system r-build-system)
    (propagated-inputs
     (list r-haven r-jomo r-pan))
    (native-inputs
     (list r-knitr))
    (home-page "https://cran.r-project.org/web/packages/mitml/")
    (synopsis "Tools for multiple imputation in multilevel modeling")
    (description
     "This package provides tools for multiple imputation of missing data in
multilevel modeling.  It includes a user-friendly interface to the packages
pan and jomo, and several functions for visualization, data management and the
analysis of multiply imputed data sets.")
    (license license:gpl2+)))

(define-public r-mice
  (package
    (name "r-mice")
    (version "3.18.0")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "mice" version))
       (sha256
        (base32
         "18nz7v4lkicyqzdaz7992fap0vl86fqvzrm3svsd5vb8gxx0kkn0"))))
    (build-system r-build-system)
    (propagated-inputs
     (list r-broom
           r-cpp11
           r-dplyr
           r-glmnet
           r-lattice
           r-mitml
           r-nnet
           r-rcpp
           r-rpart
           r-tidyr))
    (native-inputs (list r-lme4
                         r-lmtest
                         r-mass
                         r-pan
                         r-survival
                         r-testthat))
    (home-page "https://cran.r-project.org/web/packages/mice/")
    (synopsis "Multivariate imputation by chained equations")
    (description
     "Multiple imputation using @dfn{Fully Conditional Specification} (FCS)
implemented by the MICE algorithm as described in @url{Van Buuren and
Groothuis-Oudshoorn (2011), http://doi.org/10.18637/jss.v045.i03}.  Each
variable has its own imputation model.  Built-in imputation models are
provided for continuous data (predictive mean matching, normal), binary
data (logistic regression), unordered categorical data (polytomous logistic
regression) and ordered categorical data (proportional odds).  MICE can also
impute continuous two-level data (normal model, pan, second-level variables).
Passive imputation can be used to maintain consistency between variables.
Various diagnostic plots are available to inspect the quality of the
imputations.")
    ;; Any of these two versions.
    (license (list license:gpl2 license:gpl3))))

(define-public r-transformr
  (package
    (name "r-transformr")
    (version "0.1.5")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "transformr" version))
       (sha256
        (base32 "125y99wpgvp92qsg7934nzjqy6irjzaj21c0dcq7apqd2hqamfxw"))))
    (properties `((upstream-name . "transformr")))
    (build-system r-build-system)
    (propagated-inputs (list r-cpp11
                             r-lpsolve
                             r-rlang
                             r-sf
                             r-tweenr
                             r-vctrs))
    (home-page "https://github.com/thomasp85/transformr")
    (synopsis "Polygon and path transformations")
    (description
     "In order to smoothly animate the transformation of polygons and paths,
many aspects needs to be taken into account, such as differing number of
control points, changing center of rotation, etc.  The transformr package
provides an extensive framework for manipulating the shapes of polygons and
paths and can be seen as the spatial brother to the tweenr package.")
    (license license:expat)))

(define-public r-truncnorm
  (package
    (name "r-truncnorm")
    (version "1.0-9")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "truncnorm" version))
       (sha256
        (base32
         "0267gvcg6mmf28x26z6njw373prwpaq8aqkd6aavyhrjsv2aqmji"))))
    (build-system r-build-system)
    (native-inputs (list r-testthat))
    (home-page "https://cran.r-project.org/web/packages/truncnorm/")
    (synopsis "Truncated normal distribution")
    (description "This package provides functions for the truncated normal
distribution with mean equal to @code{mean} and standard deviation equal to
@code{sd}.  It includes density, distribution, quantile, and expected value
functions, as well as a random generation function.")
    (license license:gpl2)))

(define-public r-truncdist
  (package
    (name "r-truncdist")
    (version "1.0-2")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "truncdist" version))
       (sha256
        (base32 "02ihw4ixhadwr3sqm6r264i8vpcaz8pn69vkzabd8fwqvn5vcj5q"))))
    (properties `((upstream-name . "truncdist")))
    (build-system r-build-system)
    (propagated-inputs (list r-evd))
    (home-page "https://cran.r-project.org/package=truncdist")
    (synopsis "Truncated random variables")
    (description
     "This package provides a collection of tools to evaluate probability density
functions, cumulative distribution functions, quantile functions and random
numbers for truncated random variables.  These functions are provided to also
compute the expected value and variance.  @acronym{Q-Q, quantile–quantile} plots
can be produced.  All the probability functions in the stats, stats4 and evd
packages are automatically available for truncation.")
    (license license:gpl2+)))

(define-public r-trust
  (package
    (name "r-trust")
    (version "0.1-8")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "trust" version))
       (sha256
        (base32 "1b6wsx4vybr5952ii3ska6jbcb3654iibz83n645khxfca5k8blm"))))
    (properties `((upstream-name . "trust")))
    (build-system r-build-system)
    (home-page "https://www.stat.umn.edu/geyer/trust/")
    (synopsis "Trust region optimization")
    (description
     "This package does local optimization using two derivatives and trust
regions.  Guaranteed to converge to local minimum of objective function.")
    (license license:expat)))

(define-public r-trycatchlog
  (package
    (name "r-trycatchlog")
    (version "1.3.1")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "tryCatchLog" version))
       (sha256
        (base32 "0k40a48qzwmardjnkf0h5s5zryivzvdanz61kxdqdfqlil19ma0d"))))
    (properties `((upstream-name . "tryCatchLog")))
    (build-system r-build-system)
    (native-inputs (list r-knitr r-testthat))
    (home-page "https://github.com/aryoda/tryCatchLog")
    (synopsis "Advanced tryCatch and try functions")
    (description
     "This package provides advanced @code{tryCatch} and @code{try} functions
for better error handling (logging, stack trace with source code references
and support for post-mortem analysis via dump files).")
    (license license:gpl3)))

(define-public r-rsolnp
  (package
    (name "r-rsolnp")
    (version "1.16")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "Rsolnp" version))
       (sha256
        (base32
         "0w7nkj6igr0gi7r7jg950lsx7dj6aipgxi6vbjsf5f5yc9h7fhii"))))
    (properties `((upstream-name . "Rsolnp")))
    (build-system r-build-system)
    (propagated-inputs
     (list r-truncnorm))
    (home-page "https://cran.r-project.org/web/packages/Rsolnp/")
    (synopsis "General non-linear optimization")
    (description "The Rsolnp package implements a general non-linear augmented
Lagrange multiplier method solver, a @dfn{sequential quadratic
programming} (SQP) based solver).")
    ;; Any version of the GPL.
    (license license:gpl2+)))

(define-public r-hardyweinberg
  (package
    (name "r-hardyweinberg")
    (version "1.7.8")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "HardyWeinberg" version))
       (sha256
        (base32
         "1wddy32zljyya37isqb54sqhpp07s2kizjl36i08pj37bbza7yac"))))
    (properties `((upstream-name . "HardyWeinberg")))
    (build-system r-build-system)
    (propagated-inputs
     (list r-mice r-nnet r-rcpp r-rsolnp r-shape))
    (native-inputs (list r-knitr r-rmarkdown))
    (home-page "https://cran.r-project.org/package=HardyWeinberg")
    (synopsis "Statistical tests and graphics for Hardy-Weinberg equilibrium")
    (description
     "This package contains tools for exploring Hardy-Weinberg equilibrium for
diallelic genetic marker data.  All classical tests (chi-square, exact,
likelihood-ratio and permutation tests) for Hardy-Weinberg equilibrium are
included in the package, as well as functions for power computation and for
the simulation of marker data under equilibrium and disequilibrium.  Routines
for dealing with markers on the X-chromosome are included.  Functions for
testing equilibrium in the presence of missing data by using multiple
imputation are also provided.  Implements several graphics for exploring the
equilibrium status of a large set of diallelic markers: ternary plots with
acceptance regions, log-ratio plots and Q-Q plots.")
    (license license:gpl2+)))

(define-public r-sm
  (package
    (name "r-sm")
    (version "2.2-6.0")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "sm" version))
       (sha256
        (base32
         "0q8xav1alammiyiw2p8y0qq94ag5rln910jry8q3sb2p38ly79i7"))))
    (build-system r-build-system)
    (native-inputs (list gfortran))
    (home-page "http://www.stats.gla.ac.uk/~adrian/sm/")
    (synopsis "Smoothing methods for nonparametric regression and density estimation")
    (description
     "This is software accompanying the book 'Applied Smoothing Techniques for
Data Analysis---The Kernel Approach with S-Plus Illustrations', Oxford
University Press.  It provides smoothing methods for nonparametric regression
and density estimation")
    (license license:gpl2+)))

(define-public r-smd
  (package
    (name "r-smd")
    (version "0.8.0")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "smd" version))
       (sha256
        (base32 "1f5pph3728jb15bmyv0xdanww490gjm5ixz9dbvdv27av02p12js"))))
    (properties `((upstream-name . "smd")))
    (build-system r-build-system)
    (propagated-inputs (list r-mass))
    (native-inputs (list r-knitr r-purrr r-stddiff r-tableone r-testthat))
    (home-page "https://bsaul.github.io/smd/")
    (synopsis "Compute standardized mean differences")
    (description
     "This package computes standardized mean differences and confidence
intervals for multiple data types based on Yang, D., & Dalton, J. E. (2012)
<https://support.sas.com/resources/papers/proceedings12/335-2012.pdf>.")
    (license license:expat)))

(define-public r-smoof
  (package
    (name "r-smoof")
    (version "1.6.0.3")
    (source (origin
              (method url-fetch)
              (uri (cran-uri "smoof" version))
              (sha256
               (base32
                "1cazhnd0m5jjzixaqgqh2h3rsa2sw3k8slj5cmgm8v47aaqn91mg"))))
    (properties `((upstream-name . "smoof")))
    (build-system r-build-system)
    (propagated-inputs (list r-bbmisc
                             r-checkmate
                             r-ggplot2
                             r-paramhelpers
                             r-rcpp
                             r-rcpparmadillo))
    (native-inputs (list r-testthat))
    (home-page "https://jakobbossek.github.io/smoof/")
    (synopsis "Single and multi-objective optimization test functions")
    (description
     "This tool generates high number of both single- and multi-objective test
functions.  These functions are frequently used for the benchmarking of
(numerical) optimization algorithms.  Moreover, it offers a set of convenient
functions to generate, plot and work with objective functions.")
    (license license:bsd-2)))

(define-public r-smurf
  (package
    (name "r-smurf")
    (version "1.1.7")
    (source (origin
              (method url-fetch)
              (uri (cran-uri "smurf" version))
              (sha256
               (base32
                "19b24ibx32jmrsjn47xkz3qanpx7a6kmkws1yyj8aj193mi5s0q0"))))
    (properties `((upstream-name . "smurf")))
    (build-system r-build-system)
    (propagated-inputs
     (list r-catdata
           r-glmnet
           r-mass
           r-matrix
           r-mgcv
           r-rcolorbrewer
           r-rcpp
           r-rcpparmadillo))
    (native-inputs (list r-knitr r-testthat))
    (home-page "https://gitlab.com/TReynkens/smurf")
    (synopsis "Sparse multi-type regularized feature modeling")
    (description
     "The @code{smurf} package contains the implementation of the
@dfn{Sparse Multi-type Regularized Feature} (SMuRF) modeling algorithm
to fit @dfn{generalized linear models} (GLMs) with multiple types of
predictors via regularized maximum likelihood.  Next to the fitting
procedure, following functionality is available:

@itemize
@item Selection of the regularization tuning parameter lambda using
  three different approaches: in-sample, out-of-sample or using
  cross-validation.
@item S3 methods to handle the fitted object including visualization
  of the coefficients and a model summary.
@end itemize")
    (license license:gpl2+)))

(define-public r-venndiagram
  (package
    (name "r-venndiagram")
    (version "1.7.3")
    (source (origin
              (method url-fetch)
              (uri (cran-uri "VennDiagram" version))
              (sha256
               (base32
                "0ilcxcp8qskmb5cp7fyb7i0qizg42lrx0ny8ws3if90kfrglghp7"))))
    (properties `((upstream-name . "VennDiagram")))
    (build-system r-build-system)
    (propagated-inputs
     (list r-futile-logger))
    (native-inputs (list r-testthat))
    (home-page "https://cran.r-project.org/web/packages/VennDiagram/")
    (synopsis "Generate High-Resolution Venn and Euler Plots")
    (description
     "This package provides a set of functions to generate high-resolution
Venn and Euler plots.  It includes handling for several special cases,
including two-case scaling, and extensive customization of plot shape and
structure.")
    (license license:gpl2+)))

(define-public r-vioplot
  (package
    (name "r-vioplot")
    (version "0.5.1")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "vioplot" version))
       (sha256
        (base32
         "004g8xkdj0ghp365xgvwk5pf2ahrhxxq2f8482a73h59gwr11ff3"))))
    (build-system r-build-system)
    (propagated-inputs
     (list r-sm r-zoo))
    (native-inputs
     (list r-knitr r-testthat))
    (home-page "http://wsopuppenkiste.wiso.uni-goettingen.de/~dadler")
    (synopsis "Violin plot")
    (description
     "This package provides a violin plot, which is a combination of a box
plot and a kernel density plot.")
    (license license:bsd-3)))

(define-public r-rsofia
  (package
    (name "r-rsofia")
    (version "1.1")
    (source (origin
              (method url-fetch)
              ;; This package has been removed from CRAN, so we can
              ;; only fetch it from the archives.
              (uri (string-append "https://cran.r-project.org/src/"
                                  "contrib/Archive/RSofia/RSofia_"
                                  version ".tar.gz"))
              (sha256
               (base32
                "0q931y9rcf6slb0s2lsxhgqrzy4yqwh8hb1124nxg0bjbxvjbihn"))))
    (properties `((upstream-name . "RSofia")))
    (build-system r-build-system)
    (propagated-inputs
     (list r-rcpp))
    (home-page "https://cran.r-project.org/src/contrib/Archive/RSofia")
    (synopsis "Port of sofia-ml to R")
    (description "This package is a port of sofia-ml to R.  Sofia-ml is a
suite of fast incremental algorithms for machine learning that can be used for
training models for classification or ranking.")
    (license license:asl2.0)))

(define-public r-xts
  (package
    (name "r-xts")
    (version "0.14.1")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "xts" version))
       (sha256
        (base32
         "0kvz75dygr1riyijxsz8vx86fk6yyghilgc9l74lqx405yrnpaax"))
       (modules '((guix build utils)))
       (snippet
        '(with-directory-excursion "inst/doc"
           ;; These files are generated from Rnw files.
           (for-each delete-file
                     (list "xts-faq.R"
                           "xts-faq.Rnw"
                           "xts-faq.pdf"
                           "xts.R"
                           "xts.Rnw"
                           "xts.pdf"))))))
    (build-system r-build-system)
    (propagated-inputs (list r-zoo))
    (home-page "https://github.com/joshuaulrich/xts")
    (synopsis "Extensible time series")
    (description
     "This package provides for uniform handling of R's different time-based
data classes by extending @code{zoo}, maximizing native format information
preservation and allowing for user-level customization and extension, while
simplifying cross-class interoperability.")
    (license license:gpl2+)))

(define-public r-pedigreemm
  (package
    (name "r-pedigreemm")
    (version "0.3-5")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "pedigreemm" version))
       (sha256
        (base32 "1bnvd25z8ff0d00wijp2vw9xw11fczqrlblw3ag39pjzn98a1zf7"))))
    (properties `((upstream-name . "pedigreemm")))
    (build-system r-build-system)
    (propagated-inputs (list r-lme4 r-matrix))
    (home-page "https://github.com/anainesvs/pedigreemm/")
    (synopsis "Pedigree-based mixed-effects models")
    (description "This package lets you fit pedigree-based mixed-effects
models.")
    (license license:gpl2+)))

(define-public r-performanceanalytics
  (package
    (name "r-performanceanalytics")
    (version "2.0.8")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "PerformanceAnalytics" version))
       (sha256
        (base32
         "1hsycy1warjs5ffn2p3nhv455a56svwy3x5605zh7q9qh200kqk4"))))
    (properties
     `((upstream-name . "PerformanceAnalytics")))
    (build-system r-build-system)
    (arguments
     (list
      #:phases
      '(modify-phases %standard-phases
         ;; Needed for vignettes
         (add-after 'unpack 'set-HOME
           (lambda _ (setenv "HOME" "/tmp"))))))
    (propagated-inputs
     (list r-quadprog r-xts r-zoo))
    (native-inputs (list r-r-rsp r-tinytest))
    (home-page "https://r-forge.r-project.org/projects/returnanalytics/")
    (synopsis "Econometric tools for performance and risk analysis")
    (description "This is a collection of econometric functions for
performance and risk analysis.  This package aims to aid practitioners and
researchers in utilizing the latest research in analysis of non-normal return
streams.  In general, it is most tested on return (rather than price) data on
a regular scale, but most functions will work with irregular return data as
well, and increasing numbers of functions will work with P&L or price data
where possible.")
    ;; Either version may be picked.
    (license (list license:gpl2 license:gpl3))))

(define-public r-laeken
  (package
    (name "r-laeken")
    (version "0.5.3")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "laeken" version))
       (sha256
        (base32
         "02z8jyya6xv0pyfqaalbry174fw44h13s7p1jk5b4h9a9x4myjb0"))))
    (build-system r-build-system)
    (propagated-inputs
     (list r-boot r-mass))
    (home-page "https://cran.r-project.org/web/packages/laeken/")
    (synopsis "Estimation of indicators on social exclusion and poverty")
    (description "This package provides tools for the estimation of indicators
on social exclusion and poverty, as well as an implementation of Pareto tail
modeling for empirical income distributions.")
    (license license:gpl2+)))

(define-public r-vcd
  (package
    (name "r-vcd")
    (version "1.4-13")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "vcd" version))
       (sha256
        (base32
         "1k7q3nl437bmg1pylivfykwx4l0k104qkypml5b6xvwkwfn65b4x"))))
    (build-system r-build-system)
    ;; Vignettes require r-coin, which needs r-vcd.
    (arguments (list #:test-types '(list "tests")))
    (propagated-inputs
     (list r-colorspace r-lmtest r-mass))
    (home-page "https://cran.r-project.org/web/packages/vcd/")
    (synopsis "Visualizing categorical data")
    (description "This package provides visualization techniques, data sets,
summary and inference procedures aimed particularly at categorical data.
Special emphasis is given to highly extensible grid graphics.  The package was
originally inspired by the book \"Visualizing Categorical Data\" by Michael
Friendly and is now the main support package for a new book, \"Discrete Data
Analysis with R\" by Michael Friendly and David Meyer (2015).")
    (license license:gpl2)))

(define-public r-vcfr
  (package
   (name "r-vcfr")
   (version "1.15.0")
   (source (origin
            (method url-fetch)
            (uri (cran-uri "vcfR" version))
            (sha256
             (base32
              "1yj91cphin232m09wrpj8l27vxblyryh658siakz55hxjs5y85yz"))))
   (build-system r-build-system)
   (native-inputs
    (list r-adegenet r-knitr r-testthat))
   (inputs
    (list zlib))
   (propagated-inputs
    (list r-ape
          r-dplyr
          r-magrittr
          r-memuse
          r-pinfsc50
          r-rcpp
          r-stringr
          r-tibble
          r-vegan
          r-viridislite))
   (home-page "https://github.com/knausb/vcfR")
   (synopsis "Manipulate and visualize VCF data")
   (description "This package facilitates easy manipulation of variant call
format (VCF) data.  Functions are provided to rapidly read from and write to
VCF files.  Once VCF data is read into R, a parser function extracts matrices
of data.  This information can then be used for quality control or other
purposes.  Additional functions provide visualization of genomic data.  Once
processing is complete data may be written to a VCF file.  It also may be
converted into other popular R objects.  This package provides a link between
VCF data and familiar R software.")
   (license license:gpl3)))

(define-public r-rvcg
  (package
    (name "r-rvcg")
    (version "0.25")
    (source (origin
              (method url-fetch)
              (uri (cran-uri "Rvcg" version))
              (sha256
               (base32
                "1653ra7aj9xh0bxrv8wq4p1xiw4m8401misn8lzsy5702jhv7sx0"))))
    (properties `((upstream-name . "Rvcg")))
    (build-system r-build-system)
    (propagated-inputs (list r-rcpp r-rcpparmadillo r-rcppeigen))
    (home-page "https://github.com/zarquon42b/Rvcg")
    (synopsis "Manipulations of triangular meshes based on the VCGLIB API")
    (description
     "This is a package for operations on triangular meshes based on VCGLIB.
This package integrates nicely with the R-package rgl to render the meshes
processed by Rvcg.  The Visualization and Computer Graphics Library (VCG for
short) is a library for manipulation, processing and displaying with OpenGL of
triangle and tetrahedral meshes.")
    (license license:gpl2+)))

(define-public r-ica
  (package
    (name "r-ica")
    (version "1.0-3")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "ica" version))
       (sha256
        (base32
         "0rdqd3kz2cv3xvf6yz55bwhsg3k7j90d450i3azs2xkbn4q3aka7"))))
    (build-system r-build-system)
    (home-page "https://cran.r-project.org/web/packages/ica/")
    (synopsis "Independent component analysis")
    (description "This package provides tools for @dfn{Independent Component
Analysis} (ICA) using various algorithms: FastICA,
Information-Maximization (Infomax), and @dfn{Joint Approximate Diagonalization
of Eigenmatrices} (JADE).")
    (license license:gpl2+)))

(define-public r-ips
  (package
    (name "r-ips")
    (version "0.0.12")
    (source (origin
              (method url-fetch)
              (uri (cran-uri "ips" version))
              (sha256
               (base32
                "0vnsalm94vzagksqv4ph6x7vdwhd1lq278sak30pr4m9bc9xxchw"))))
    (properties `((upstream-name . "ips")))
    (build-system r-build-system)
    (propagated-inputs (list r-ape r-data-table r-phangorn r-plyr r-xml))
    (home-page "https://cran.r-project.org/package=ips")
    (synopsis "Interfaces to phylogenetic software in R")
    (description
     "This package provides functions that wrap popular phylogenetic software
for sequence alignment, masking of sequence alignments, and estimation of
phylogenies and ancestral character states.")
    (license license:gpl3)))

(define-public r-dtwclust
  (package
    (name "r-dtwclust")
    (version "6.0.0")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "dtwclust" version))
       (sha256
        (base32 "0by01x4qpf1pin5l61wmm600bmsnlnns9knwb0qmjlj72pmwfkqh"))))
    (properties `((upstream-name . "dtwclust")))
    (build-system r-build-system)
    (propagated-inputs
     (list r-clue
           r-cluster
           r-dplyr
           r-dtw
           r-flexclust
           r-foreach
           r-ggplot2
           r-ggrepel
           r-matrix
           r-proxy
           r-rcpp
           r-rcpparmadillo
           r-rcppparallel
           r-rcppthread
           r-reshape2
           r-rlang
           r-rspectra
           r-shiny
           r-shinyjs))
    (native-inputs (list r-knitr r-testthat))
    (home-page "https://github.com/asardaes/dtwclust")
    (synopsis
     "Clustering time series with dynamic time warping distance optimization")
    (description
     "This package implements time series clustering along with optimized
techniques related to the dynamic time warping distance and its corresponding
lower bounds.  The implementations of partitional, hierarchical, fuzzy, k-Shape
and TADPole clustering are available.  Functionality can be easily extended with
custom distance measures and centroid definitions.  Implementations of @acronym{
DTW, dynamic time warping} barycenter averaging, a distance based on global
alignment kernels, and the soft-DTW distance and centroid routines are also
provided.  All included distance functions have custom loops optimized for the
calculation of cross-distance matrices, including parallelization support.
Several cluster validity indices are included.")
    (license license:gpl3)))

(define-public r-dtw
  (package
    (name "r-dtw")
    (version "1.23-1")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "dtw" version))
       (sha256
        (base32
         "0vc2is1hf1g0sw92kzl8mddck264qwiqgm5q2wkcwwz65fss7mkf"))))
    (build-system r-build-system)
    (propagated-inputs (list r-proxy))
    (home-page "https://dtw.r-forge.r-project.org/")
    (synopsis "Dynamic Time Warping Algorithms")
    (description "This package provides a comprehensive implementation of
@dfn{dynamic time warping} (DTW) algorithms in R.  DTW computes the
optimal (least cumulative distance) alignment between points of two time
series.  Common DTW variants covered include local (slope) and global (window)
constraints, subsequence matches, arbitrary distance definitions,
normalizations, minimum variance matching, and so on.")
    (license license:gpl2+)))

(define-public r-sdmtools
  (package
    (name "r-sdmtools")
    (version "1.1-221.2")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "SDMTools" version))
       (sha256
        (base32
         "1xvcd97ikqsfdpk2fddy3k0z1ajqga7nv9bgac9c1wnjk1gqrpgh"))))
    (properties `((upstream-name . "SDMTools")))
    (build-system r-build-system)
    (propagated-inputs (list r-r-utils))
    (home-page "https://www.rforge.net/SDMTools/")
    (synopsis "Species distribution modelling tools")
    (description "This package provides a set of tools for post processing
the outcomes of species distribution modeling exercises.  It includes novel
methods for comparing models and tracking changes in distributions through
time.  It further includes methods for visualizing outcomes, selecting
thresholds, calculating measures of accuracy and landscape fragmentation
statistics, etc.")
    (license license:gpl3+)))

(define-public r-scatterplot3d
  (package
    (name "r-scatterplot3d")
    (version "0.3-44")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "scatterplot3d" version))
       (sha256
        (base32
         "1hkfislhzx05y5qqa7pvrils3qf9rhxbf37lkpsjbn9yihs0i70w"))))
    (build-system r-build-system)
    (home-page "https://cran.r-project.org/web/packages/scatterplot3d/")
    (synopsis "3D scatter plot")
    (description "This package provides an implementation of scatter plots for
plotting.  a three dimensional point cloud.")
    (license license:gpl2)))

(define-public r-ggridges
  (package
    (name "r-ggridges")
    (version "0.5.6")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "ggridges" version))
       (sha256
        (base32
         "0dafd10ny6l2rlr1y453rhjiy17a33k15f82nk31238mk8qamk7g"))))
    (build-system r-build-system)
    (propagated-inputs
     (list r-ggplot2 r-scales r-withr))
    (native-inputs
     (list r-knitr r-testthat))
    (home-page "https://github.com/clauswilke/ggridges")
    (synopsis "Ridgeline plots in ggplot2")
    (description
     "Ridgeline plots provide a convenient way of visualizing changes in
distributions over time or space.  This package enables the creation of such
plots in @code{ggplot2}.")
    (license license:gpl2)))

(define-public r-ggjoy
  (package
    (name "r-ggjoy")
    (version "0.4.1")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "ggjoy" version))
       (sha256
        (base32
         "012md2m0jqfcccb933j423m3ck31v3p0pd41gjxpyg9082y7ixyj"))))
    (build-system r-build-system)
    (propagated-inputs
     (list r-ggplot2 r-ggridges))
    (home-page "https://github.com/clauswilke/ggjoy")
    (synopsis "Joyplots in ggplot2")
    (description "Joyplots provide a convenient way of visualizing changes in
distributions over time or space.  This package enables the creation of such
plots in @code{ggplot2}.")
    (license license:gpl2)))

(define-public r-gss
  (package
    (name "r-gss")
    (version "2.2-9")
    (source (origin
              (method url-fetch)
              (uri (cran-uri "gss" version))
              (sha256
               (base32
                "0iqfx02q8rkv8s0xcc6jylbj123wnvjh0hnwjsj12xahq5cnb8bf"))))
    (properties `((upstream-name . "gss")))
    (build-system r-build-system)
    (native-inputs (list gfortran))
    (home-page "https://cran.r-project.org/package=gss")
    (synopsis "General smoothing splines")
    (description
     "This package provides a comprehensive collection for structural
multivariate function estimation using smoothing splines.")
    (license license:gpl2+)))

(define-public r-cli
  (package
    (name "r-cli")
    (version "3.6.5")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "cli" version))
       (sha256
        (base32
         "0ycn8px9ac7iigfpzknzkiyfm44p59zgikyxss55sa3awr333glf"))))
    (properties
     ;; We can't have r-testthat among the inputs, because that would lead to
     ;; a dependency cycle.
     '((updater-ignored-native-inputs . ("r-testthat"))))
    (build-system r-build-system)
    (arguments
     (list
      ;; Tests require r-testthat, but that package needs r-cli.
      #:tests? #false
      #:phases
      '(modify-phases %standard-phases
         ;; Do not embed the PID of the build process.
         (add-after 'unpack 'build-reproducibly
           (lambda _
             (setenv "GUIX_BUILD" "yes")
             (substitute* '("R/onload.R" "R/app.R")
               (("\\<- Sys\\.getpid\\(\\)")
                (lambda _
                  (string-append
                   "<- if (Sys.getenv(\"GUIX_BUILD\") == \"\") { Sys.getpid() } else { 12345 }")))))))))
    (home-page "https://github.com/r-lib/cli#readme")
    (synopsis "Helpers for developing command line interfaces")
    (description "This package provides a suite of tools designed to build
attractive command line interfaces (CLIs).  It includes tools for drawing
rules, boxes, trees, and Unicode symbols with ASCII alternatives.")
    (license license:expat)))

(define-public r-argparser
  (package
    (name "r-argparser")
    (version "0.7.2")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "argparser" version))
       (sha256
        (base32
         "0j9hnbyzbyzclgm4qwyqqkrqcrblxfm190489sgcvr5i7vg2smr8"))))
    (build-system r-build-system)
    (native-inputs (list r-testthat))
    (home-page "https://bitbucket.org/djhshih/argparser")
    (synopsis "Command-line argument parser")
    (description
     "This package provides a cross-platform command-line argument parser
written purely in R with no external dependencies.  It is useful with the
Rscript front-end and facilitates turning an R script into an executable
script.")
    (license license:gpl3+)))

(define-public r-aricode
  (package
    (name "r-aricode")
    (version "1.0.3")
    (source (origin
              (method url-fetch)
              (uri (cran-uri "aricode" version))
              (sha256
               (base32
                "02nrw66jfpzf6dy0zy21sbdjxjc8c11iv9fkjqj5akzb7wskk9qh"))))
    (properties `((upstream-name . "aricode")))
    (build-system r-build-system)
    (propagated-inputs (list r-matrix r-rcpp))
    (native-inputs (list r-testthat))
    (home-page "https://github.com/jchiquet/aricode")
    (synopsis "Efficient computations of standard clustering comparison measures")
    (description
     "This package implements an efficient O(n) algorithm based on
bucket-sorting for fast computation of standard clustering comparison
measures.  Available measures include @dfn{adjusted Rand index} (ARI),
@dfn{normalized information distance} (NID), @dfn{normalized mutual
information} (NMI), @dfn{adjusted mutual information} (AMI), @dfn{normalized
variation information} (NVI) and entropy.")
    (license license:gpl3+)))

(define-public r-attempt
  (package
    (name "r-attempt")
    (version "0.3.1")
    (source (origin
              (method url-fetch)
              (uri (cran-uri "attempt" version))
              (sha256
               (base32
                "1ylgg7jcp8wqmxgf1mydnvh26k0mr8jyjla4hw06730r40yrs58m"))))
    (properties `((upstream-name . "attempt")))
    (build-system r-build-system)
    (propagated-inputs (list r-rlang))
    (native-inputs (list r-knitr r-testthat))
    (home-page "https://github.com/ColinFay/attempt")
    (synopsis "Tools for defensive programming")
    (description
     "This package provides tools for defensive programming.  It is inspired
by @code{purrr} mappers and based on @code{rlang}.  Attempt extends and
facilitates defensive programming by providing a consistent grammar, and a set
of functions for common tests and conditions.  Attempt only depends on
@code{rlang}, and focuses on speed, so it can be integrated with other
functions and used in the data analysis.")
    (license license:expat)))

(define-public r-debugme
  (package
    (name "r-debugme")
    (version "1.2.0")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "debugme" version))
       (sha256
        (base32
         "16ghf60rj0l8ypm0hxjp23zxdi2ndq8ii74cilq61m107fnha9mj"))))
    (properties
     '((updater-extra-native-inputs . ("r-mockery"))))
    (build-system r-build-system)
    (propagated-inputs (list r-crayon))
    (native-inputs (list r-mockery r-testthat))
    (home-page "https://github.com/r-lib/debugme#readme")
    (synopsis "Debug R packages")
    (description
     "This package allows the user to specify debug messages as special string
constants, and control debugging of packages via environment variables.")
    (license license:expat)))

(define-public r-processx
  (package
    (name "r-processx")
    (version "3.8.6")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "processx" version))
       (sha256
        (base32 "08a2fdazjyschgr2xd0g9ldxsfvb99bqi2192bswlla31vywmwf5"))))
    (properties
     ;; We can't have testthat among the inputs, because that would lead to a
     ;; dependency cycle.
     '((updater-ignored-native-inputs . ("r-testthat" "r-callr"))))
    (build-system r-build-system)
    ;; Tests require r-testthat, which indirectly depends on this package.
    (arguments (list #:tests? #false))
    (propagated-inputs
     (list r-ps r-r6))
    (home-page "https://github.com/r-lib/processx3")
    (synopsis "Execute and control system processes")
    (description
     "This package provides portable tools to run system processes in the
background.  It can check if a background process is running; wait on a
background process to finish; get the exit status of finished processes; kill
background processes and their children; restart processes.  It can read the
standard output and error of the processes, using non-blocking connections.
@code{processx} can poll a process for standard output or error, with a
timeout.  It can also poll several processes at once.")
    (license license:expat)))

(define-public r-timeseries
  (package
    (name "r-timeseries")
    (version "4041.111")
    (source (origin
              (method url-fetch)
              (uri (cran-uri "timeSeries" version))
              (sha256
               (base32
                "0hwazbv91lcxcddas7hwyc86rzl5fbyw6mrpksbyb6025ivj8g85"))))
    (properties `((upstream-name . "timeSeries")))
    (build-system r-build-system)
    ;; Vignettes require a large number of other packages.
    (arguments (list #:test-types '(list "tests")))
    (propagated-inputs (list r-timedate))
    (native-inputs (list r-runit))
    (home-page
     "https://r-forge.r-project.org/scm/viewvc.php/pkg/timeSeries/?root=rmetrics")
    (synopsis "Metrics for financial time series objects")
    (description
     "This package implements S4 classes and various tools for financial time
series.  Basic functions such as scaling and sorting, subsetting, mathematical
operations and statistical functions are provided.")
    (license license:gpl2+)))

(define-public r-tsp
  (package
    (name "r-tsp")
    (version "1.2-5")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "TSP" version))
       (sha256
        (base32
         "082cmbv943bb8ibpfvczjvkv1s9k6dzj4619b64d8sni2hawlldb"))))
    (properties `((upstream-name . "TSP")))
    (build-system r-build-system)
    (propagated-inputs (list r-foreach))
    (native-inputs (list r-maps r-testthat))
    (home-page "https://cran.r-project.org/web/packages/TSP/")
    (synopsis "Traveling salesperson problem (TSP)")
    (description "This package provides basic infrastructure and some
algorithms for the @dfn{traveling salesperson problem}(TSP) (also known as the
traveling salesman problem).")
    (license license:gpl3)))

(define-public r-qap
  (package
    (name "r-qap")
    (version "0.1-2")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "qap" version))
       (sha256
        (base32
         "19adb1bw46pcnmmhqz2jklr0vmma3llxajqp0j9mqfksmsisv927"))))
    (build-system r-build-system)
    (native-inputs (list gfortran r-testthat))
    (home-page "https://cran.r-project.org/web/packages/qap/")
    (synopsis "Heuristics for the quadratic assignment problem (QAP)")
    (description "This package implements heuristics for the @dfn{quadratic
assignment problem} (QAP).  Currently only a simulated annealing heuristic is
available.")
    (license license:gpl3)))

(define-public r-gclus
  (package
    (name "r-gclus")
    (version "1.3.3")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "gclus" version))
       (sha256
        (base32
         "0542yv9gv93l41dsijkr19fpzhs42z6qhh00h13mqkwcc4d54s36"))))
    (build-system r-build-system)
    (propagated-inputs (list r-cluster))
    (home-page "https://cran.r-project.org/web/packages/gclus/")
    (synopsis "Clustering graphics")
    (description "This package orders panels in scatterplot matrices and
parallel coordinate displays by some merit index.  It contains various indices
of merit, ordering functions, and enhanced versions of @code{pairs} and
@code{parcoord} which color panels according to their merit level.")
    (license license:gpl2+)))

(define-public r-webchem
  (package
    (name "r-webchem")
    (version "1.3.0")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "webchem" version))
       (sha256
        (base32 "06b9i9jipg564zyw4gkgiidz7501rlp40hxm4z3k5mzy148lr5vq"))))
    (properties `((upstream-name . "webchem")))
    (build-system r-build-system)
    (propagated-inputs (list r-base64enc
                             r-data-tree
                             r-dplyr
                             r-httr
                             r-jsonlite
                             r-purrr
                             r-rlang
                             r-rvest
                             r-stringr
                             r-tibble
                             r-xml2))
    (native-inputs (list r-knitr r-testthat))
    (home-page "https://docs.ropensci.org/webchem/")
    (synopsis "Chemical information from the web")
    (description
     "This package interacts with a suite of web services for chemical
information.  Sources include: Alan Wood's Compendium of Pesticide Common
Names, Chemical Identifier Resolver, ChEBI, Chemical Translation Service,
ChemSpider, ETOX, Flavornet, NIST Chemistry WebBook, OPSIN, PubChem, SRS,
Wikidata.")
    (license license:expat)))

(define-public r-webshot
  (package
    (name "r-webshot")
    (version "0.5.5")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "webshot" version))
       (sha256
        (base32
         "04xrrf72323sgzsdkbl05p2fdsi486i9avrrxvw0l3n8r8y92xfn"))))
    (build-system r-build-system)
    (propagated-inputs
     (list r-callr r-jsonlite r-magrittr))
    (native-inputs (list r-testthat))
    (home-page "https://github.com/wch/webshot/")
    (synopsis "Take screenshots of web pages")
    (description
     "Webshot makes it easy to take screenshots of web pages from within R.
It can also run Shiny applications locally and take screenshots of the
application; and it can render and screenshot static as well as interactive R
Markdown documents.")
    (license license:gpl2)))

(define-public r-seriation
  (package
    (name "r-seriation")
    (version "1.5.7")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "seriation" version))
       (sha256
        (base32
         "0m98qhk3mkdny728v90cwmq24qinn7v03fyj4vmaw7hsjrzmj6kc"))))
    (build-system r-build-system)
    (propagated-inputs
     (list r-ca
           r-cluster
           r-colorspace
           r-foreach
           r-gclus
           r-mass
           r-qap
           r-registry
           r-tsp
           r-vegan))
    (native-inputs (list gfortran r-dendextend r-testthat))
    (home-page "https://s2.smu.edu/IDA/seriation/")
    (synopsis "Infrastructure for ordering objects using seriation")
    (description
     "This package provides infrastructure for seriation with an
implementation of several seriation/sequencing techniques to reorder matrices,
dissimilarity matrices, and dendrograms.  It also provides (optimally)
reordered heatmaps, color images and clustering visualizations like
dissimilarity plots, and visual assessment of cluster tendency plots (VAT and
iVAT).")
    (license license:gpl3)))

(define-public r-xfun
  (package
    (name "r-xfun")
    (version "0.52")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "xfun" version))
       (sha256
        (base32 "1yls1zi47ysd6wm8yik03cjxfsi7pc7bl014yp9s6c9ivc1gy1il"))))
    (build-system r-build-system)
    (properties
     ;; knitr itself depends on xfun
     '((updater-ignored-native-inputs . ("r-knitr" "r-litedown"))
       (updater-extra-native-inputs . ("r-codetools"))))
    (arguments
     (list
      ;; Do not build vignettes, because they require r-litedown, which
      ;; depends on r-xfun.
      #:test-types '(list "tests")
      #:phases
      '(modify-phases %standard-phases
         ;; Needed for tests
         (add-after 'unpack 'set-HOME
           (lambda _ (setenv "HOME" "/tmp"))))))
    (native-inputs (list r-codetools r-testit))
    (home-page "https://github.com/yihui/xfun")
    (synopsis "Miscellaneous functions")
    (description
     "This package provides miscellaneous functions commonly used in other
packages maintained by Yihui Xie.")
    (license license:expat)))

(define-public r-utf8
  (package
    (name "r-utf8")
    (version "1.2.5")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "utf8" version))
       (sha256
        (base32
         "091xj6vhikxadqbvswx6zhnvh5yvzgpqk2kn1dcp9v8rq5iq5gig"))))
    (build-system r-build-system)
    (native-inputs
     (list r-cli
           r-knitr
           r-rlang
           r-rmarkdown
           r-testthat
           r-withr)) ; for vignettes
    (home-page "https://github.com/patperry/r-utf8")
    (synopsis "Unicode text processing")
    (description
     "This package provides tools to process and print UTF-8 encoded
international text (Unicode).  Input, validate, normalize, encode, format, and
display.")
    (license license:asl2.0)))

(define-public r-zeallot
  (package
    (name "r-zeallot")
    (version "0.2.0")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "zeallot" version))
       (sha256
        (base32
         "1fwjv8lck5jz3gd67lr5wrpj1m7k70mkx6riyxv2yxndnzdrfsvz"))))
    (build-system r-build-system)
    (native-inputs (list r-codetools r-knitr r-testthat))
    (home-page "https://github.com/nteetor/zeallot")
    (synopsis "Multiple, unpacking, and destructuring assignment")
    (description
     "This package provides a @code{%<-%} operator to perform multiple,
unpacking, and destructuring assignment in R.  The operator unpacks the
right-hand side of an assignment into multiple values and assigns these values
to variables on the left-hand side of the assignment.")
    (license license:expat)))

(define-public r-zlog
  (package
    (name "r-zlog")
    (version "1.0.2")
    (source (origin
              (method url-fetch)
              (uri (cran-uri "zlog" version))
              (sha256
               (base32
                "0fi9aqrmikdg5ibwhn82kslj4lxih03vm27jmi14m73h09yy4in5"))))
    (properties `((upstream-name . "zlog")))
    (build-system r-build-system)
    (native-inputs (list r-knitr r-testthat))
    (home-page "https://cran.r-project.org/package=zlog")
    (synopsis "Transformation for laboratory easurements")
    (description
     "The @code{zlog} package offers functions to transform laboratory
measurements into standardised z or @math{z(log)-values}.  Therefore the lower
and upper reference limits are needed.  If these are not known they could be
estimated from a given sample.")
    (license license:gpl3+)))

(define-public r-vctrs
  (package
    (name "r-vctrs")
    (version "0.6.5")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "vctrs" version))
       (sha256
        (base32
         "00p4r1z4xc05m25y0qa7svr67lbypcfqyp2b0ja9asgx90i7s5j3"))))
    (properties
     ;; We can't have r-knitr among the inputs here, because r-vctrs ends up
     ;; being an eventual input to r-knitr.
     '((updater-ignored-native-inputs . ("r-knitr" "r-testthat"))))
    (build-system r-build-system)
    ;; Some tests require tibble, which depends on this package.
    (arguments (list #:tests? #false))
    (propagated-inputs
     (list r-cli r-glue r-lifecycle r-rlang))
    (home-page "https://github.com/r-lib/vctrs")
    (synopsis "Vector helpers")
    (description
     "There are three main goals to the @code{vctrs} package:

@enumerate
@item To propose @code{vec_size()} and @code{vec_type()} as alternatives to
  @code{length()} and @code{class()}.  These definitions are paired with a
  framework for type-coercion and size-recycling.
@item To define type- and size-stability as desirable function properties, use
  them to analyse existing base function, and to propose better alternatives.
  This work has been particularly motivated by thinking about the ideal
  properties of @code{c()}, @code{ifelse()}, and @code{rbind()}.
@item To provide a new @code{vctr} base class that makes it easy to create new
  S3 vectors.  @code{vctrs} provides methods for many base generics in terms of
  a few new @code{vctrs} generics, making implementation considerably simpler
  and more robust.
@end enumerate\n")
    (license license:gpl3)))

(define-public r-pillar
  (package
    (name "r-pillar")
    (version "1.10.2")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "pillar" version))
       (sha256
        (base32
         "0ifnarggd1anxslf2yknc18dvq3lr31nzchai0q2bdi83gzf7nrc"))))
    (properties
     ;; Avoid dependency cycles.
     '((updater-ignored-native-inputs . ("r-ggplot2" "r-tibble"))
       (updater-extra-native-inputs . ("tzdata-for-tests"))))
    (build-system r-build-system)
    (propagated-inputs
     (list r-cli
           r-glue
           r-lifecycle
           r-rlang
           r-utf8
           r-vctrs))
    (native-inputs
     (list r-bit64
           r-dbi
           r-evaluate
           r-knitr
           r-lubridate
           r-nanotime
           r-survival
           r-testthat
           r-vdiffr
           r-withr
           tzdata-for-tests))
    (home-page "https://github.com/r-lib/pillar")
    (synopsis "Coloured formatting for columns")
    (description
     "This package provides a @code{pillar} generic designed for formatting
columns of data using the full range of colours provided by modern
terminals.")
    (license license:gpl3)))

(define-public r-pinfsc50
  (package
   (name "r-pinfsc50")
   (version "1.3.0")
   (source (origin
            (method url-fetch)
            (uri (cran-uri "pinfsc50" version))
            (sha256
             (base32
              "1gs9x328qqvqwx3k4z9jgzq5zb6g8kdz4430n96v7zb78p7jf5lp"))))
   (build-system r-build-system)
   (home-page "https://cran.r-project.org/web/packages/pinfsc50/")
   (synopsis "Genomic data for the plant pathogen Phytophthora infestans")
   (description "This package contains genomic data for the plant pathogen
Phytophthora infestans.  It includes a variant file, a sequence file and an
annotation file.  This package is intended to be used as example data for
packages that work with genomic data.")
   (license license:gpl2+)))

(define-public r-piton
  (package
    (name "r-piton")
    (version "1.0.0")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "piton" version))
       (sha256
        (base32 "1krf6zi238m275nxjlpyayv8y2drbgs2kg19dpkqm0lmlz5y5ar8"))))
    (properties `((upstream-name . "piton")))
    (build-system r-build-system)
    (propagated-inputs (list r-rcpp))
    (native-inputs (list r-testthat))
    (home-page "https://github.com/Ironholds/piton")
    (synopsis "Parsing expression grammars in Rcpp")
    (description
     "This package provides a wrapper around the Parsing Expression Grammar
Template Library, a C++11 library for generating parsing expression grammars,
that makes it accessible within Rcpp.  With this, developers can implement
their own grammars and easily expose them in R packages.")
    (license license:expat)))

(define-public r-uuid
  (package
    (name "r-uuid")
    (version "1.2-1")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "uuid" version))
       (sha256
        (base32
         "15jbzj0i4qphakbi8s9yk55lm8z9s2vhgp5bj77sfvkx7mrlj3pr"))))
    (build-system r-build-system)
    (home-page "https://www.rforge.net/uuid")
    (synopsis "Tools for generating and handling of UUIDs")
    (description
     "This package provides tools for generating and handling of
@dfn{Universally Unique Identifiers} (UUIDs).")
    (license license:expat)))

(define-public r-tinylabels
  (package
    (name "r-tinylabels")
    (version "0.2.5")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "tinylabels" version))
       (sha256
        (base32 "0jplsnqjrr0y8rbin4i3yxgv3cvb6pbmh2y2in1smmy5ywsyyz3d"))))
    (properties
     '((upstream-name . "tinylabels")))
    (build-system r-build-system)
    (native-inputs (list r-knitr r-testthat r-vctrs))
    (home-page "https://github.com/mariusbarth/tinylabels")
    (synopsis "Lightweight variable labels")
    (description
     "This package lets you assign, extract, or remove variable labels from R
vectors.")
    (license license:expat)))

(define-public r-tinytex
  (package
    (name "r-tinytex")
    (version "0.57")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "tinytex" version))
       (sha256
        (base32
         "05nrmlh107g7zw2lv2r2xsvgfri66wg7fhd6z6xsj137jd8y039j"))))
    (build-system r-build-system)
    (propagated-inputs
     (list r-xfun))
    (native-inputs (list r-testit))
    (home-page "https://github.com/yihui/tinytex")
    (synopsis "Helper functions for TeX Live and compiling LaTeX documents")
    (description
     "This package provides helper functions to install and maintain the LaTeX
distribution named TinyTeX, a lightweight, cross-platform, portable, and
easy-to-maintain version of TeX Live.  This package also contains helper
functions to compile LaTeX documents, and install missing LaTeX packages
automatically.")
    (license license:expat)))

(define-public r-tinytest
  (package
    (name "r-tinytest")
    (version "1.4.1")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "tinytest" version))
       (sha256
        (base32
         "0x0w1fiqd98vmpz8yrp9ig0ry1wfr16g6bkjzd2a8sq9gn417z7n"))))
    (properties `((upstream-name . "tinytest")))
    (build-system r-build-system)
    ;; Vignettes complain about a missing file, which is in fact there.
    (arguments (list #:test-types '(list "tests")))
    (home-page "https://github.com/markvanderloo/tinytest")
    (synopsis "Lightweight unit testing framework")
    (description
     "This package provides a lightweight unit testing framework.  Main
features:

@enumerate
@item install tests with the package;
@item test results are treated as data that can be stored and manipulated;
@item test files are R scripts interspersed with test commands, that can be
  programmed over;
@item fully automated build-install-test sequence for packages;
@item skip tests when not run locally (e.g. on CRAN);
@item flexible and configurable output printing;
@item compare computed output with output stored with the package;
@item run tests in parallel;
@item extensible by other packages;
@item report side effects.
@end enumerate
")
    (license license:gpl3)))

(define-public r-n2r
  (package
    (name "r-n2r")
    (version "1.0.3")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "N2R" version))
       (sha256
        (base32 "0bbxl0y36bmsxwi4rs4f6jwhf9bhag2rkvvzcg5669vgm2p4scjr"))))
    (properties `((upstream-name . "N2R")))
    (build-system r-build-system)
    (propagated-inputs
     (list r-matrix
           r-rcpp
           r-rcppeigen
           r-rcppspdlog))
    (native-inputs (list r-testthat))
    (home-page "https://github.com/kharchenkolab/N2R")
    (synopsis "Fast and scalable approximate k-Nearest Neighbor search methods")
    (description
     "This package implements methods to perform fast approximate K-nearest
neighbor search on the input matrix.  The algorithm is based on the N2
implementation of an approximate nearest neighbor search using hierarchical
@acronym{NSW, Navigable Small World} graphs.")
    (license license:asl2.0)))

(define-public r-name
  (package
    (name "r-name")
    (version "0.0.1")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "name" version))
       (sha256
        (base32 "1va2qqcxgvc4nzkylxyyzz8yx6ndgb1hx7af3qjzf8m4mzg8qnvm"))))
    (properties `((upstream-name . "name")))
    (build-system r-build-system)
    (propagated-inputs (list r-cli
                             r-dplyr
                             r-rlang
                             r-stringr
                             r-tibble
                             r-tidyselect))
    (native-inputs (list r-testthat))
    (home-page "https://github.com/christopherkenny/name")
    (synopsis "Tools for working with names")
    (description
     "This package provides a system for organizing column names in data.
It is aimed at supporting a prefix-based and suffix-based column naming
scheme.  It extends dplyr functionality to add ordering by function and more
explicit renaming.")
    (license license:expat)))

(define-public r-naniar
  (package
    (name "r-naniar")
    (version "1.1.0")
    (source (origin
              (method url-fetch)
              (uri (cran-uri "naniar" version))
              (sha256
               (base32
                "0i3gijr1l7hbcp75cyj26pxmm493lnvasl8aba9vv4w8lz1lck59"))))
    (build-system r-build-system)
    (propagated-inputs
     (list r-cli
           r-dplyr
           r-forcats
           r-ggplot2
           r-glue
           r-lifecycle
           r-magrittr
           r-norm
           r-purrr
           r-rlang
           r-tibble
           r-tidyr
           r-upsetr
           r-vctrs
           r-viridis
           r-visdat))
    (native-inputs
     (list r-knitr r-testthat))
    (home-page "https://github.com/njtierney/naniar")
    (synopsis
     "Data structures, summaries, and visualisations for missing data")
    (description
     "Missing values are ubiquitous in data and need to be explored and
handled in the initial stages of analysis.  The package provides data
structures and functions that facilitate the plotting of missing values and
examination of imputations.  This allows missing data dependencies to be
explored with minimal deviation from the common work patterns of
@code{ggplot2} and tidy data.")
    (license license:expat)))

(define-public r-nanonext
  (package
    (name "r-nanonext")
    (version "1.6.0")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "nanonext" version))
       (sha256
        (base32 "0n2lq6czshp4r5jsrabz6al36s3d9dai8dkf80h9bskga36bfkp3"))))
    (properties `((upstream-name . "nanonext")))
    (build-system r-build-system)
    (arguments
     (list
      #:tests? #false                   ;some tests require Internet access
      #:phases
      '(modify-phases %standard-phases
         (add-after 'unpack 'find-libraries
           (lambda _
             (setenv "INCLUDE_DIR" (getenv "C_INCLUDE_PATH"))
             (setenv "LIB_DIR" (getenv "LIBRARY_PATH")))))))
    (inputs (list mbedtls-lts nng-1.10))
    (native-inputs (list r-later r-litedown r-promises))
    (home-page "https://shikokuchuo.net/nanonext/")
    (synopsis "NNG (Nanomsg Next Gen) lightweight messaging library")
    (description
     "This package provides R bindings for NNG (Nanomsg Next Gen), a successor
to ZeroMQ.  NNG is a socket library for reliable, high-performance messaging
over in-process, IPC, TCP, WebSocket and secure TLS transports.  It implements
Scalability Protocols, a standard for common communications patterns including
publish/subscribe, request/reply and service discovery.  As its own threaded
concurrency framework, it provides a toolkit for asynchronous programming and
distributed computing.  Intuitive @code{aio} objects resolve automatically
when asynchronous operations complete, and synchronisation primitives allow R
to wait upon events signalled by concurrent threads.")
    (license license:gpl3+)))

(define-public r-nestedcv
  (package
    (name "r-nestedcv")
    (version "0.8.0")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "nestedcv" version))
       (sha256
        (base32 "1cymz961bcc9ga2dk2fnqi8iiz9da95fxw242l0brp3w0ymdcx4q"))))
    (properties `((upstream-name . "nestedcv")))
    (build-system r-build-system)
    (propagated-inputs (list r-caret
                             r-data-table
                             r-doparallel
                             r-foreach
                             r-future-apply
                             r-ggplot2
                             r-glmnet
                             r-matrixstats
                             r-matrixtests
                             r-proc
                             r-rfast
                             r-rhpcblasctl
                             r-rlang
                             r-rocr))
    (native-inputs (list r-knitr))
    (home-page "https://github.com/myles-lewis/nestedcv")
    (synopsis "Nested cross-validation with glmnet and caret")
    (description
     "This package implements nested cross-validation applied to the
@code{glmnet} and @code{caret} packages.  With glmnet this includes
cross-validation of elastic net alpha parameter.  A number of feature
selection filter functions (t-test, Wilcoxon test, ANOVA, Pearson/Spearman
correlation, random forest, ReliefF) for feature selection are provided and
can be embedded within the outer loop of the nested CV.  Nested CV can be also
be performed with the @code{caret} package giving access to the large number
of prediction methods available in @code{caret}.")
    (license license:expat)))

(define-public r-ncdfcf
  (package
    (name "r-ncdfcf")
    (version "0.6.0")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "ncdfCF" version))
       (sha256
        (base32 "00hys99h9znyx3xbzkllramaraaib6fn5rjswn2x9xy926b8q9q8"))))
    (properties `((upstream-name . "ncdfCF")))
    (build-system r-build-system)
    (propagated-inputs (list r-abind r-cftime r-r6 r-rnetcdf r-stringr))
    (native-inputs (list r-knitr))
    (home-page "https://github.com/pvanlaake/ncdfCF")
    (synopsis "Easy access to NetCDF files with CF Metadata Conventions")
    (description
     "@dfn{Network Common Data Form} (netCDF) files are widely used for
scientific data.  Library-level access in R is provided through packages
RNetCDF and ncdf4.  The package ncdfCF is built on top of RNetCDF and makes
the data and its attributes available as a set of R6 classes that are informed
by the Climate and Forecasting Metadata Conventions.  Access to the data uses
standard R subsetting operators and common function forms.")
    (license license:expat)))

(define-public r-ncmeta
  (package
    (name "r-ncmeta")
    (version "0.4.0")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "ncmeta" version))
       (sha256
        (base32 "1aamxs3yza1hsgvkp6740lv1dc21a87mzl06n6w3zxkjshri020w"))))
    (properties
     '((upstream-name . "ncmeta")
       ;; These packages do not exist.
       (updater-ignored-native-inputs
        . ("r-raadfiles" "r-raadtools"))))
    (build-system r-build-system)
    (propagated-inputs (list r-cftime
                             r-dplyr
                             r-rlang
                             r-rnetcdf
                             r-tibble
                             r-tidyr))
    (native-inputs (list r-testthat))
    (home-page "https://github.com/hypertidy/ncmeta")
    (synopsis "Straightforward NetCDF metadata")
    (description
     "Extract metadata from @code{NetCDF} data sources; these can be files,
file handles or servers.  This package leverages and extends the lower level
functions of the RNetCDF package providing a consistent set of functions that
all return data frames.")
    (license license:gpl3)))

(define-public r-network
  (package
    (name "r-network")
    (version "1.19.0")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "network" version))
       (sha256
        (base32
         "04i02ld1wq5qij2q7sx7k1kmpz1gb2xkwbqhhvriwh8nzc3s04px"))))
    (build-system r-build-system)
    (properties
     '((updater-ignored-native-inputs . ("r-sna"))))
    (arguments
     (list
      ;; Vignettes require r-sna, which depends on r-network.
      #:test-types '(list "tests")
      #:phases
      '(modify-phases %standard-phases
         (add-after 'unpack 'delete-bad-tests
           (lambda _
             ;; One test requires access to the internet.
             (delete-file "tests/testthat/test-read.paj.R"))))))
    (propagated-inputs
     (list r-magrittr r-statnet-common r-tibble))
    (native-inputs (list r-testthat))
    (home-page "https://statnet.org/")
    (synopsis "Classes for relational data")
    (description
     "This package provides tools to create and modify network objects.  The
@code{network} class can represent a range of relational data types, and
supports arbitrary vertex/edge/graph attributes.")
    (license license:gpl2+)))

(define-public r-nistunits
  (package
    (name "r-nistunits")
    (version "1.0.1")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "NISTunits" version))
       (sha256
        (base32 "0km9l3k9p35sb1qrhrz4ijjsdihvsp6j7cz5kh46lgf7nn6xdk7a"))))
    (properties `((upstream-name . "NISTunits")))
    (build-system r-build-system)
    (home-page "https://cran.r-project.org/package=NISTunits")
    (synopsis "Fundamental physical constants and unit conversions")
    (description
     "This package provides fundamental physical constants (quantity, value,
uncertainty, unit) for @acronym{SI, International System of Units} and non-SI
units, plus unit conversions based on the data from @acronym{NIST, National
Institute of Standards and Technology}, USA.")
    (license license:gpl3+)))

(define-public r-nlme
  (package
    (name "r-nlme")
    (version "3.1-168")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "nlme" version))
       (sha256
        (base32 "0qkki4x49808cmvj1fmsivq68b836f0rq3ayxrfpgdjc6il89dr3"))))
    (build-system r-build-system)
    (propagated-inputs
     (list r-lattice))
    (native-inputs
     (list gfortran))
    (home-page "https://cran.r-project.org/web/packages/nlme")
    (synopsis "Linear and nonlinear mixed effects models")
    (description
     "This package provides tools to fit and compare Gaussian linear and
nonlinear mixed-effects models.")
    (license license:gpl2+)))

(define-public r-nloptr
  (package
    (name "r-nloptr")
    (version "2.2.1")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "nloptr" version))
       (sha256
        (base32
         "1x6pmqh3k5ckjbzkallndpqnlx61y02rwv58sqd8np271dsl1fkn"))))
    (properties
     '((updater-extra-inputs . ("nlopt"))))
    (build-system r-build-system)
    (native-inputs
     (list pkg-config r-knitr r-tinytest))
    (inputs (list nlopt))
    (home-page "https://cran.r-project.org/web/packages/nloptr")
    (synopsis "R interface to NLopt")
    (description
     "This package is interface to NLopt, a library for nonlinear
optimization.  NLopt is a library for nonlinear optimization, providing a
common interface for a number of different free optimization routines
available online as well as original implementations of various other
algorithms.")
    (license license:lgpl3)))

(define-public r-norm
  (package
    (name "r-norm")
    (version "1.0-11.1")
    (source (origin
              (method url-fetch)
              (uri (cran-uri "norm" version))
              (sha256
               (base32
                "1g33g721c0f2b275b334ir6n0h81fh567vs9vrxk60y21z1ydzy2"))))
    (build-system r-build-system)
    (native-inputs (list gfortran))
    (home-page "https://cran.r-project.org/web/packages/norm/")
    (synopsis "Analysis of multivariate normal datasets with missing values")
    (description "This package provides an integrated set of functions for the
analysis of multivariate normal datasets with missing values, including
implementation of the EM algorithm, data augmentation, and multiple
imputation.")
    (license license:gpl2+)))

(define-public r-numderiv
  (package
    (name "r-numderiv")
    (version "2016.8-1.1")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "numDeriv" version))
       (sha256
        (base32
         "0idk02pqkziik932bd8k72d1q775g1is3m4bc861pcxfz6gx3i6q"))))
    (properties `((upstream-name . "numDeriv")))
    (build-system r-build-system)
    (home-page "https://cran.r-project.org/web/packages/numDeriv")
    (synopsis "Accurate numerical derivatives")
    (description
     "This package provides methods for calculating accurate numerical first
and second order derivatives.")
    (license license:gpl2)))

(define-public r-numero
  (package
    (name "r-numero")
    (version "1.9.8")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "Numero" version))
       (sha256
        (base32 "038nyc1chis326kgdbwzl0w24v7pk3cdwb5x94q2g6lvf5ffh5y3"))))
    (properties `((upstream-name . "Numero")))
    (build-system r-build-system)
    (propagated-inputs (list r-rcpp))
    (native-inputs (list r-knitr r-rmarkdown))
    (home-page "https://cran.r-project.org/package=Numero")
    (synopsis "Statistical framework to define subgroups in complex datasets")
    (description
     "The package includes the necessary functions to construct a
self-organizing map of data, to evaluate the statistical significance of the
observed data patterns, and to visualize the results.")
    (license license:gpl2+)))

(define-public r-nycflights13
  (package
    (name "r-nycflights13")
    (version "1.0.2")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "nycflights13" version))
       (sha256
        (base32 "07aa76c77pm1wpzkwjmzv8n6ir5i6fxawx8wx586gwc5wajcb1qf"))))
    (properties `((upstream-name . "nycflights13")))
    (build-system r-build-system)
    (propagated-inputs (list r-tibble))
    (home-page "https://github.com/hadley/nycflights13")
    (synopsis "Flights that departed NYC in 2013")
    (description
     "This package provides airline on-time data for all flights departing NYC
in 2013.  It also includes useful metadata on airlines, airports, weather, and
planes.")
    (license license:cc0)))

(define-public r-s7
  (package
    (name "r-s7")
    (version "0.2.0")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "S7" version))
       (sha256
        (base32 "16yllj1a2m9akli5z2q8fv7jlgc2y0z3bk919d96wfbsmizmlrxq"))))
    (properties `((upstream-name . "S7")))
    (build-system r-build-system)
    (native-inputs (list r-callr
                         r-knitr
                         r-name
                         r-testthat
                         r-tibble
                         r-withr))
    (home-page "https://rconsortium.github.io/S7/")
    (synopsis
     "Object-oriented system meant to become a successor to S3 and S4")
    (description
     "This package provides a new object oriented programming system designed
to be a successor to S3 and S4.  It includes formal class, generic, and method
specification, and a limited form of multiple dispatch.  It has been designed
and implemented collaboratively by the R Consortium Object-Oriented
Programming Working Group, which includes representatives from R-Core,
Bioconductor, Posit/tidyverse, and the wider R community.")
    (license license:expat)))

(define-public r-stabs
  (package
    (name "r-stabs")
    (version "0.6-4")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "stabs" version))
       (sha256
        (base32
         "1nf1yg14cgxrs4np1yghpzw1nczaslfv3rvf3918wrlzg0vp6l7q"))))
    (build-system r-build-system)
    (native-inputs
     (list r-knitr r-testthat))
    (home-page "https://github.com/hofnerb/stabs")
    (synopsis "Stability selection with error control")
    (description
     "This package provides resampling procedures to assess the stability of
selected variables with additional finite sample error control for
high-dimensional variable selection procedures such as Lasso or boosting.
Both, standard stability selection (Meinshausen & Buhlmann, 2010) and
complementary pairs stability selection with improved error bounds
(Shah & Samworth, 2013) are implemented.  The package can be combined with
arbitrary user specified variable selection approaches.")
    (license license:gpl2)))

(define-public r-rle
  (package
    (name "r-rle")
    (version "0.10.0")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "rle" version))
       (sha256
        (base32
         "1arlb1lhwyk8744f1inlghd3rkmzfgmfdq7zs353v0rs1yl9j5qr"))))
    (properties `((upstream-name . "rle")))
    (build-system r-build-system)
    (home-page "https://cran.r-project.org/web/packages/rle/")
    (synopsis "Common functions for run-length encoded vectors")
    (description
     "This package provides common @code{base} and @code{stats} methods for
@code{rle} objects, aiming to make it possible to treat them transparently as
vectors.")
    (license license:gpl3)))

(define-public r-statnet-common
  (package
    (name "r-statnet-common")
    (version "4.12.0")
    (source
      (origin
        (method url-fetch)
        (uri (cran-uri "statnet.common" version))
        (sha256
          (base32
            "1z448l4mh4kfv79rf033hf93lg6msp6xdrrg6v1spn0bqg0wkij5"))))
    (properties
      `((upstream-name . "statnet.common")))
    (build-system r-build-system)
    (propagated-inputs
     (list r-coda r-matrix))
    (home-page "https://statnet.org")
    (synopsis "R scripts and utilities used by the Statnet software")
    (description "This package provides non-statistical utilities used by the
software developed by the Statnet Project.")
    (license license:gpl3)))

(define-public r-statcheck
  (package
    (name "r-statcheck")
    (version "1.5.0")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "statcheck" version))
       (sha256
        (base32
         "0gsr068if5k8124x1cbm48720l9qvnfmdg6rmh7rwh6jvxxgknd7"))))
    (build-system r-build-system)
    (propagated-inputs
     (list r-ggplot2 r-plyr r-rlang r-rmarkdown r-stringi))
    (native-inputs (list r-testthat))
    (home-page "https://cran.r-project.org/web/packages/statcheck/")
    (synopsis "Extract statistics from articles and recompute p-values")
    (description "This package can automatically extract statistical
null-hypothesis significant testing (NHST) results from articles and recompute
the p-values based on the reported test statistic and degrees of freedom to
detect possible inconsistencies.")
    (license license:gpl2)))

(define-public r-sna
  (package
    (name "r-sna")
    (version "2.8")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "sna" version))
       (sha256
        (base32
         "0k4r5a3p3ngdc8szy6xdvgaibasggcrpb5hdxplnmmawa27dn2pj"))))
    (build-system r-build-system)
    (propagated-inputs
     (list r-network r-statnet-common))
    (home-page "https://statnet.org")
    (synopsis "Tools for social network analysis")
    (description
     "This package provides a range of tools for social network analysis,
including node and graph-level indices, structural distance and covariance
methods, structural equivalence detection, network regression, random graph
generation, and 2D/3D network visualization.")
    (license license:gpl2+)))

(define-public r-tfisher
  (package
    (name "r-tfisher")
    (version "0.2.0")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "TFisher" version))
       (sha256
        (base32
         "0vz74ww1lf1prfwz74hfsi3a8nzq8ss7aqjr85c1d87vss2796xx"))))
    (properties `((upstream-name . "TFisher")))
    (build-system r-build-system)
    (propagated-inputs
     (list r-matrix r-mvtnorm r-sn))
    (home-page "https://cran.r-project.org/web/packages/TFisher/")
    (synopsis "Optimal thresholding Fisher's p-value combination method")
    (description
     "This package provides the @dfn{cumulative distribution function} (CDF),
quantile, and statistical power calculator for a collection of thresholding
Fisher's p-value combination methods, including Fisher's p-value combination
method, truncated product method and, in particular, soft-thresholding
Fisher's p-value combination method which is proven to be optimal in some
context of signal detection.  The p-value calculator for the omnibus version
of these tests are also included.")
    (license license:gpl2)))

(define-public r-ttr
  (package
    (name "r-ttr")
    (version "0.24.4")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "TTR" version))
       (sha256
        (base32
         "1102f4i776asqb281mq20ymhzhcp12gn9nr3rm0jzblv6nf2nww9"))))
    (properties `((upstream-name . "TTR")))
    (build-system r-build-system)
    (propagated-inputs
     (list r-curl r-xts r-zoo))
    (native-inputs (list r-runit))
    (home-page "https://github.com/joshuaulrich/TTR")
    (synopsis "Technical trading rules")
    (description
     "This package provides functions and data to construct technical trading
rules with R.")
    (license license:gpl2)))

(define-public r-leaflet-providers
  (package
    (name "r-leaflet-providers")
    (version "2.0.0")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "leaflet.providers" version))
       (sha256
        (base32 "0rl69bfx2l10x80rl8cppqch3fnd05sk9w29h8589jc8h3ffmkn5"))))
    (properties `((upstream-name . "leaflet.providers")))
    (build-system r-build-system)
    (propagated-inputs (list r-htmltools))
    (native-inputs (list r-testthat))
    (home-page "https://github.com/rstudio/leaflet.providers")
    (synopsis "Leaflet map tile providers")
    (description
     "This package contains third-party map tile provider information from
Leaflet.js, to be used with the @code{leaflet} R package.  Additionally,
@code{leaflet.providers} enables users to retrieve up-to-date provider
information between package updates.")
    (license license:bsd-2)))

;; This package contains a lot of minified JavaScript with unclear provenance.
;; When upgrading please make sure that all minified JavaScript files are
;; removed in a snippet and that the replacement sources correspond to the
;; original minified scripts.
(define-public r-leaflet
  (package
    (name "r-leaflet")
    (version "2.2.2")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "leaflet" version))
       (sha256
        (base32 "1sxq38dcjhn1bkav7fxglzk8nwi5p32jia2nhijcq5j1766pp1yj"))
       (snippet
        '(for-each
          delete-file
          (list "inst/htmlwidgets/lib/leaflet/leaflet.js"
                "inst/htmlwidgets/lib/leaflet-measure/leaflet-measure.min.js"
                "inst/htmlwidgets/lib/leaflet-omnivore/leaflet-omnivore.min.js"
                "inst/htmlwidgets/plugins/Leaflet-MiniMap/Control.MiniMap.min.js"
                "inst/htmlwidgets/plugins/Leaflet.awesome-markers/bootstrap.min.js"
                "inst/htmlwidgets/plugins/Leaflet.awesome-markers/leaflet.awesome-markers.min.js"
                "inst/htmlwidgets/plugins/Leaflet.markercluster/leaflet.markercluster.js"
                "inst/htmlwidgets/plugins/Leaflet.markercluster/leaflet.markercluster.freezable.js"
                "inst/htmlwidgets/plugins/Leaflet.markercluster/leaflet.markercluster.layersupport.js"
                "inst/legacy/www/leaflet.js")))))
    (properties
     '((upstream-name . "leaflet")
       (updater-extra-native-inputs . ("r-shiny"))))
    (build-system r-build-system)
    (arguments
     `(#:modules ((guix build utils)
                  (guix build r-build-system)
                  (srfi srfi-1))
       #:phases
       (modify-phases %standard-phases
         (add-after 'unpack 'process-javascript
           (lambda* (#:key inputs #:allow-other-keys)
             ;; The inst directory contains some minified JavaScript files.
             ;; Regenerate them from sources.
             (invoke "unzip" "-d" "/tmp" (assoc-ref inputs "js-leaflet"))
             (with-directory-excursion "inst/"
               (call-with-values
                   (lambda ()
                     (unzip2
                      `(("/tmp/leaflet-src.js"
                         "htmlwidgets/lib/leaflet/leaflet.js")
                        (,(assoc-ref inputs "js-leaflet-measure")
                         "htmlwidgets/lib/leaflet-measure/leaflet-measure.min.js")
                        (,(assoc-ref inputs "js-leaflet-omnivore")
                         "htmlwidgets/lib/leaflet-omnivore/leaflet-omnivore.min.js")
                        ("htmlwidgets/plugins/Leaflet-MiniMap/Control.MiniMap.js"
                         "htmlwidgets/plugins/Leaflet-MiniMap/Control.MiniMap.min.js")
                        (,(assoc-ref inputs "js-bootstrap3")
                         "htmlwidgets/plugins/Leaflet.awesome-markers/bootstrap.min.js")
                        ("htmlwidgets/plugins/Leaflet.awesome-markers/leaflet.awesome-markers.js"
                         "htmlwidgets/plugins/Leaflet.awesome-markers/leaflet.awesome-markers.min.js")
                        (,(string-append (assoc-ref inputs "js-leaflet-markercluster")
                                         "/dist/leaflet.markercluster-src.js")
                         "htmlwidgets/plugins/Leaflet.markercluster/leaflet.markercluster.js")
                        (,(assoc-ref inputs "js-leaflet-markercluster-freezable")
                         "htmlwidgets/plugins/Leaflet.markercluster/leaflet.markercluster.freezable.js")
                        (,(assoc-ref inputs "js-leaflet-markercluster-layersupport")
                         "htmlwidgets/plugins/Leaflet.markercluster/leaflet.markercluster.layersupport.js")
                        (,(assoc-ref inputs "js-proj4leaflet")
                         "htmlwidgets/plugins/Proj4Leaflet/proj4.min.js")
                        ("legacy/www/leaflet-src.js"
                         "legacy/www/leaflet.js"))))
                 (lambda (sources targets)
                   (for-each (lambda (source target)
                               (format #true "Processing ~a --> ~a~%"
                                       source target)
                               (invoke "esbuild" source "--minify"
                                       (string-append "--outfile=" target)))
                             sources targets)))))))))
    (native-inputs
     `(("esbuild" ,esbuild)
       ("unzip" ,unzip)
       ("js-bootstrap3"
        ,(origin
           (method url-fetch)
           (uri "https://raw.githubusercontent.com/twbs/bootstrap/v3.3.7/dist/js/bootstrap.js")
           (sha256
            (base32
             "1j1qjagwj0m3q322z9wxxnpkd8zbk6g3kl047dsbmqad6gmqvgha"))))
       ("js-leaflet"
        ,(origin
           (method url-fetch)
           (uri "http://cdn.leafletjs.com/leaflet/v1.3.1/leaflet.zip")
           (sha256
            (base32
             "10phzd2vczy3zm1b64whp2nna69cf9hlj2bndc9yq47vf3ddqx8f"))))
       ("js-leaflet-omnivore"
        ,(origin
           (method url-fetch)
           (uri (string-append "https://api.tiles.mapbox.com/mapbox.js/plugins/"
                               "leaflet-omnivore/v0.3.1/leaflet-omnivore.js"))
           (sha256
            (base32
             "1b8zxrp6xwzpw25apn8j4qws0f6sr7qr7h2va5h1mjyfqvn29anq"))))
       ("js-leaflet-markercluster"
        ,(origin
           (method git-fetch)
           (uri (git-reference
                 (url "https://github.com/Leaflet/Leaflet.markercluster.git")
                 (commit "v1.1.0")))
           (file-name (git-file-name "js-leaflet-markercluster" "1.1.0"))
           (sha256
            (base32
             "0ds8c7picqjmc86bm5n6hm8k71fwsa2cpgib19sbdamzr9hm0rs1"))))
       ("js-leaflet-markercluster-freezable"
        ,(origin
           (method url-fetch)
           (uri (string-append
                 "https://raw.githubusercontent.com/ghybs/Leaflet.MarkerCluster.Freezable/"
                 "9db80a3fba7dff4aee940e05d3d4dceaa1fffcf9/src/freezable.js"))
           (file-name "leaflet-markercluster-freezable.js")
           (sha256
            (base32
             "1k6sn5n0z2x3an91vwvkzmqq4b8ppswgk5hi5qrr79klas1hbx1k"))))
       ("js-leaflet-markercluster-layersupport"
        ,(origin
           (method url-fetch)
           (uri (string-append
                 "https://raw.githubusercontent.com/ghybs/Leaflet.MarkerCluster.LayerSupport/"
                 "87f3848b92e0516d9c98f6d4cd175f7b8a4e3805/src/layersupport.js"))
           (file-name "leaflet-markercluster-layersupport.js")
           (sha256
            (base32
             "15qa21xif94y762c65yxxysxykz3mma6y6agw3nxpr3s7wbb75ff"))))
       ("js-leaflet-measure"
        ,(origin
           (method url-fetch)
           (uri "https://unpkg.com/leaflet-measure@1.5.2/dist/leaflet-measure.js")
           (file-name "js-leaflet-measure-1.5.2.js")
           (sha256
            (base32
             "0ggg3ffmm7pj9ry4gssrh0a17pnad3p6gwi0dg98y819pmpqa7y0"))))
       ("js-proj4leaflet"
        ,(origin
           (method url-fetch)
           (uri "https://raw.githubusercontent.com/kartena/Proj4Leaflet/1.0.2/lib/proj4.js")
           (file-name "js-proj4leaflet-1.0.2.js")
           (sha256
            (base32
             "0vyrbf6gv2lyh4c2bzp5349ivwvvg28gpn87y52a7jdb13rlkpab"))))
       ("r-shiny" ,r-shiny)
       ("r-testthat" ,r-testthat)))
    (propagated-inputs
     (list r-crosstalk
           r-htmltools
           r-htmlwidgets
           r-jquerylib
           r-leaflet-providers
           r-magrittr
           r-png
           r-raster
           r-rcolorbrewer
           r-scales
           r-sp
           r-viridislite
           r-xfun))
    (home-page "https://rstudio.github.io/leaflet/")
    (synopsis "Create interactive web maps with the JavaScript Leaflet library")
    (description
     "Create and customize interactive maps using the Leaflet JavaScript
library and the @code{htmlwidgets} package.  These maps can be used directly
from the R console, from RStudio, in Shiny applications and R Markdown
documents.")
    (license license:gpl3)))

(define-public r-leaps
  (package
    (name "r-leaps")
    (version "3.2")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "leaps" version))
       (sha256
        (base32
         "1bbgm6l12gj1y28ks21awxphpmp07hb0ffiyrw7dqp3fcyxvxmm0"))))
    (build-system r-build-system)
    (native-inputs (list gfortran))
    (home-page "https://cran.r-project.org/web/packages/leaps/")
    (synopsis "Regression subset selection")
    (description
     "This package provides tools for regression subset selection, including
exhaustive search.")
    (license license:gpl2+)))

(define-public r-splus2r
  (package
    (name "r-splus2r")
    (version "1.3-5")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "splus2R" version))
       (sha256
        (base32
         "097bpzazw5ryb6izbmz2sdlghn3qvh7c7wsnn0j08j65f9bfmc77"))))
    (properties `((upstream-name . "splus2R")))
    (build-system r-build-system)
    (home-page "https://cran.r-project.org/web/packages/splus2R/")
    (synopsis "Supplemental S-PLUS functionality in R")
    (description
     "Currently there are many functions in S-PLUS that are missing in R.  To
facilitate the conversion of S-PLUS packages to R packages, this package
provides some missing S-PLUS functionality in R.")
    (license license:gpl2)))

(define-public r-ifultools
  (package
    (name "r-ifultools")
    (version "2.0-26")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "ifultools" version))
       (sha256
        (base32
         "1lkmzrh65j6vdb8523axxk9gig5q4zxy08wiqsp16w482d2q2sl1"))))
    (build-system r-build-system)
    (arguments
     (list
      #:phases
      `(modify-phases %standard-phases
         (add-after 'unpack 'compatibility
           (lambda _
             ;; These definitions are no longer part of R since 4.2.0.  See
             ;; https://cran.r-project.org/doc/manuals/r-devel/NEWS.html for
             ;; details.
             (substitute* "inst/include/ut_RS.h"
               (("#include \"R.h\"" m)
                (string-append "\
#define R_PROBLEM_BUFSIZE 4096
#define PROBLEM	{char R_problem_buf[R_PROBLEM_BUFSIZE];(sprintf)(R_problem_buf,
#define MESSAGE {char R_problem_buf[R_PROBLEM_BUFSIZE];(sprintf)(R_problem_buf,
#define ERROR	),error(R_problem_buf);}
#define WARNING(x)		),warning(R_problem_buf);}
#define WARN			WARNING(NULL)
" m))))))))
    (propagated-inputs
     (list r-mass r-splus2r))
    (home-page "https://cran.r-project.org/web/packages/ifultools/")
    (synopsis "Insightful research tools")
    (description "This package provides C code used by the wmtsa, fractal, and
sapa R packages.")
    (license license:gpl2)))

(define-public r-sapa
  (package
    (name "r-sapa")
    (version "2.0-3")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "sapa" version))
       (sha256
        (base32
         "0kj681rd4c2lvqr926lb6f4qwp281x5274dg6vbk8pf5y7s0qlpc"))
       (patches (search-patches "r-sapa-lapack.patch"))))
    (build-system r-build-system)
    (propagated-inputs
     (list r-ifultools r-splus2r))
    (home-page "https://cran.r-project.org/web/packages/sapa/")
    (synopsis "Spectral analysis for physical applications")
    (description "This package provides software for the book Spectral
Analysis for Physical Applications, Donald B. Percival and Andrew T. Walden,
Cambridge University Press, 1993.")
    (license license:gpl2)))

(define-public r-aggregation
  (package
    (name "r-aggregation")
    (version "1.0.1")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "aggregation" version))
       (sha256
        (base32
         "0j9g604m2ccc7hcy02539yja9cf3xcbl25gvp838bp4x8w18my46"))))
    (build-system r-build-system)
    (home-page "https://cran.r-project.org/web/packages/aggregation/")
    (synopsis "Methods for p-value aggregation")
    (description
     "This package contains functionality for performing the following methods
of p-value aggregation: Fisher's method, the Lancaster method (weighted
Fisher's method), and Sidak correction.")
    (license license:gpl3)))

(define-public r-quantmod
  (package
    (name "r-quantmod")
    (version "0.4.27")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "quantmod" version))
       (sha256
        (base32
         "0h81c9jcj51r4v146z6lgpwilq1v96gas5rv5jmv2bn2c4mw1lvi"))))
    (build-system r-build-system)
    (arguments
     (list
      ;; FIXME: identical(sQuote(api.key), default.key) is not TRUE
      #:tests? #false
      #:phases
      '(modify-phases %standard-phases
         (add-after 'unpack 'build-reproducibly
           (lambda _
             (substitute* "R/buildModel.R"
               (("Sys.time\\(\\)")
                "if (\"\" != Sys.getenv(\"SOURCE_DATE_EPOCH\")) {\
 as.numeric(Sys.getenv(\"SOURCE_DATE_EPOCH\"))\
} else { Sys.time() }\n")))))))
    (propagated-inputs
     (list r-curl r-jsonlite r-ttr r-xts r-zoo))
    (home-page "https://cran.r-project.org/web/packages/quantmod/")
    (synopsis "Quantitative financial modelling framework")
    (description "This package provides a quantitative financial modelling
framework to allow users to specify, build, trade, and analyse quantitative
financial trading strategies.")
    (license license:gpl3)))

(define-public r-quantpsyc
  (package
    (name "r-quantpsyc")
    (version "1.6")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "QuantPsyc" version))
       (sha256
        (base32
         "1dbj830p5837fiwa800nzsaf19lf95vc3n7jmds2q9v06mrz6syq"))))
    (properties `((upstream-name . "QuantPsyc")))
    (build-system r-build-system)
    (propagated-inputs
     (list r-boot
           r-dplyr
           r-mass
           r-purrr))
    (home-page "https://cran.r-project.org/web/packages/QuantPsyc/")
    (synopsis "Quantitative psychology tools")
    (description
     "This package contains functions useful for data screening, testing
moderation, mediation and estimating power.")
    (license license:gpl2+)))

(define-public r-quantreg
  (package
    (name "r-quantreg")
    (version "6.1")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "quantreg" version))
       (sha256
        (base32 "16hnw2kynr4s75iybzgf17z95wgyx8fkk4sv54wmz895mg2r48pl"))))
    (build-system r-build-system)
    (arguments
     (list
      #:phases
      '(modify-phases %standard-phases
         ;; This is needed for building vignettes
         (add-after 'unpack 'set-HOME
           (lambda _ (setenv "HOME" "/tmp"))))))
    (native-inputs
     (list gfortran r-r-rsp))           ;for vignettes
    (propagated-inputs
     (list r-mass r-matrix r-matrixmodels r-sparsem r-survival))
    (home-page "https://www.r-project.org")
    (synopsis "Quantile regression")
    (description
     "This package provides an estimation and inference methods for models
of conditional quantiles: linear and nonlinear parametric and non-parametric
models for conditional quantiles of a univariate response and several methods
for handling censored survival data.  Portfolio selection methods based on
expected shortfall risk are also included.")
    (license license:gpl2+)))

(define-public r-quarto
  (package
    (name "r-quarto")
    (version "1.4.4")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "quarto" version))
       (sha256
        (base32 "18403v03hh57fm09csg6jmxh6biih7dgq9sakn0hg6x3kn8vnnaf"))))
    (properties `((upstream-name . "quarto")))
    (build-system r-build-system)
    ;; Vignettes require the quarto binary.
    (arguments (list #:test-types '(list "tests")))
    (propagated-inputs (list r-cli
                             r-jsonlite
                             r-later
                             r-processx
                             r-rlang
                             r-rmarkdown
                             r-rstudioapi
                             r-yaml))
    (native-inputs (list r-knitr r-testthat r-withr r-xfun))
    (home-page "https://github.com/quarto-dev/quarto-r")
    (synopsis "R Interface to Quarto markdown publishing system")
    (description
     "This package lets you convert R Markdown documents and Jupyter notebooks
to a variety of output formats using Quarto.")
    (license license:gpl2+)))

(define-public r-tseries
  (package
    (name "r-tseries")
    (version "0.10-58")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "tseries" version))
       (sha256
        (base32
         "0957pi65myp6qnrk710kcbw83401v226lsxdxkas73mv84cygphf"))))
    (build-system r-build-system)
    (propagated-inputs
     (list r-jsonlite r-quadprog r-quantmod r-zoo))
    (native-inputs
     (list gfortran))
    (home-page "https://cran.r-project.org/web/packages/tseries/")
    (synopsis "Time series analysis and computational finance")
    (description
     "This package provides functions relating to time series analysis and
computational finance.")
    (license license:gpl2)))

(define-public r-wmtsa
  (package
    (name "r-wmtsa")
    (version "2.0-3")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "wmtsa" version))
       (sha256
        (base32
         "1q436krz5p1f4a7a7sya6a9rh9x9mi8zzcgq66gbk9w9w4hcqcj6"))))
    (build-system r-build-system)
    (propagated-inputs
     (list r-ifultools r-mass r-splus2r))
    (home-page "https://cran.r-project.org/web/packages/wmtsa/")
    (synopsis "Wavelet methods for time series analysis")
    (description
     "This package provides software to accompany the book \"Wavelet Methods
for Time Series Analysis\", Donald B. Percival and Andrew T. Walden, Cambridge
University Press, 2000.")
    (license license:gpl2)))

(define-public r-tsa
  (package
    (name "r-tsa")
    (version "1.3.1")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "TSA" version))
       (sha256
        (base32
         "14g58s2w7wma1fgcg3b51267b3676zrv0w8v4hpypxygz023d9bx"))))
    (properties `((upstream-name . "TSA")))
    (build-system r-build-system)
    (propagated-inputs
     (list r-leaps r-locfit r-mgcv r-tseries))
    (home-page "https://homepage.divms.uiowa.edu/~kchan/TSA.htm")
    (synopsis "Time series analysis")
    (description
     "This package contains R functions and datasets detailed in the book
\"Time Series Analysis with Applications in R (second edition)\" by Jonathan
Cryer and Kung-Sik Chan.")
    (license license:gpl2+)))

(define-public r-extradistr
  (package
    (name "r-extradistr")
    (version "1.10.0")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "extraDistr" version))
       (sha256
        (base32
         "1ad3xp4axbbid9i9vd4q8iccs3g3917yic2mas37mfwm5in4l9pl"))))
    (properties `((upstream-name . "extraDistr")))
    (build-system r-build-system)
    (propagated-inputs
     (list r-rcpp))
    (native-inputs (list r-testthat))
    (home-page "https://github.com/twolodzko/extraDistr")
    (synopsis "Additional univariate and multivariate distributions")
    (description
     "This package implements density, distribution functions, quantile
functions and random generation functions for a large number of univariate and
multivariate distributions.")
    (license license:gpl2)))

(define-public r-fbasics
  (package
    (name "r-fbasics")
    (version "4041.97")
    (source (origin
              (method url-fetch)
              (uri (cran-uri "fBasics" version))
              (sha256
               (base32
                "1aqm973km7z8b6r90j3dcqi7dgf8fxcjb5ps2q3f14p80rg0ahlr"))))
    (properties `((upstream-name . "fBasics")))
    (build-system r-build-system)
    (propagated-inputs
     (list r-gss
           r-mass
           r-spatial
           r-stabledist
           r-timedate
           r-timeseries))
    (native-inputs (list r-runit))
    (home-page
     "https://r-forge.r-project.org/scm/viewvc.php/pkg/fBasics/?root=rmetrics")
    (synopsis "Metrics for markets and basic statistics")
    (description
     "This package provides a collection of functions to explore and to
investigate basic properties of financial returns and related quantities.  The
covered fields include techniques of explorative data analysis and the
investigation of distributional properties, including parameter estimation and
hypothesis testing.  Even more, there are several utility functions for data
handling and management.")
    (license license:gpl2+)))

(define-public r-fractal
  (package
    (name "r-fractal")
    (version "2.0-4")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "fractal" version))
       (sha256
        (base32
         "18lr9z0gslvfc3z8vyj3krqj3bfhg60zv1fzinrwwkc4cpk1w7mp"))))
    (build-system r-build-system)
    (propagated-inputs
     (list r-ifultools
           r-mass
           r-sapa
           r-scatterplot3d
           r-splus2r
           r-wmtsa))
    (home-page "https://cran.r-project.org/web/packages/fractal/")
    (synopsis "Fractal time series modeling and analysis")
    (description
     "This package provides tools for stochastic fractal and deterministic
chaotic time series analysis.")
    (license license:gpl2)))

(define-public r-fresh
  (package
    (name "r-fresh")
    (version "0.2.1")
    (source (origin
              (method url-fetch)
              (uri (cran-uri "fresh" version))
              (sha256
               (base32
                "19ki4hxlqzshdmy981gcvbn8wxqa893p5rs55l0q7iipkcmhf9jq"))))
    (properties `((upstream-name . "fresh")))
    (build-system r-build-system)
    (propagated-inputs (list r-bslib r-htmltools r-rstudioapi r-sass r-shiny))
    (native-inputs (list r-knitr r-testthat))
    (home-page "https://github.com/dreamRs/fresh")
    (synopsis "Create custom Bootstrap themes to use in Shiny")
    (description
     "Customize Bootstrap and Bootswatch themes, like colors, fonts,
grid layout, to use in Shiny applications, rmarkdown documents and
flexdashboard.")
    (license license:gpl3)))

(define-public r-urca
  (package
    (name "r-urca")
    (version "1.3-4")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "urca" version))
       (sha256
        (base32
         "05nb1an5a8r0w6gca6cf40nws2v4hxhznz8kyfm7q7hz0kjnqggy"))))
    (build-system r-build-system)
    (propagated-inputs (list r-nlme))
    (native-inputs (list gfortran))
    (home-page "https://cran.r-project.org/web/packages/urca/")
    (synopsis "Unit root and cointegration tests for time series data")
    (description
     "This package provides unit root and cointegration tests encountered in
applied econometric analysis.")
    (license license:gpl2+)))

(define-public r-cubature
  (package
    (name "r-cubature")
    (version "2.1.3")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "cubature" version))
       (sha256
        (base32
         "1vpiiw40kxmm0s8qfz3582f77wjzknipykx9rpmqv4p2mjcghaz6"))))
    (build-system r-build-system)
    (propagated-inputs
     (list r-rcpp))
    (native-inputs
     (list r-knitr r-testthat))
    (home-page "https://github.com/bnaras/cubature")
    (synopsis "Adaptive multivariate integration over hypercubes")
    (description
     "This package is an R wrapper around the cubature C library for adaptive
multivariate integration over hypercubes.  This version provides both
@code{hcubature} and @code{pcubature} routines in addition to a vector
interface.")
    ;; The included cubature C library is released under GPLv2+, but the
    ;; wrapper declares the license to be GPLv3+.
    (license (list license:gpl2+ license:gpl3+))))

(define-public r-trend
  (package
    (name "r-trend")
    (version "1.1.6")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "trend" version))
       (sha256
        (base32
         "0991fp6kjk704rfg0l1m7kwbck9fj1rg27zy4llm5ikczd55w05h"))))
    (build-system r-build-system)
    (propagated-inputs
     (list r-extradistr))
    (native-inputs
     (list gfortran))
    (home-page "https://cran.r-project.org/web/packages/trend/")
    (synopsis "Non-parametric trend tests and change-point detection")
    (description
     "The analysis of environmental data often requires the detection of
trends and change-points.  This package includes tests for trend
detection (Cox-Stuart Trend Test, Mann-Kendall Trend Test, (correlated)
Hirsch-Slack Test, partial Mann-Kendall Trend Test, multivariate (multisite)
Mann-Kendall Trend Test, (Seasonal) Sen's slope, partial Pearson and Spearman
correlation trend test), change-point detection (Lanzante's test procedures,
Pettitt's test, Buishand Range Test, Buishand U Test, Standard Normal
Homogeinity Test), detection of non-randomness (Wallis-Moore Phase Frequency
Test, Bartels rank von Neumann's ratio test, Wald-Wolfowitz Test) and the two
sample Robust Rank-Order Distributional Test.")
    (license license:gpl3)))

(define-public r-expm
  (package
    (name "r-expm")
    (version "1.0-0")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "expm" version))
       (sha256
        (base32
         "0m5jm92mjn83zvh4jz7rdf04jdaad7lv2l0a44rb2mdgyvw3di82"))))
    (build-system r-build-system)
    (propagated-inputs (list r-matrix))
    (native-inputs (list gfortran))
    (home-page "https://r-forge.r-project.org/projects/expm/")
    (synopsis "Tools for matrix exponentials and related quantities")
    (description
     "This package provides tools for the computation of the matrix
exponential, logarithm, square root, and related quantities.")
    (license license:gpl2+)))

(define-public r-exposition
  (package
    (name "r-exposition")
    (version "2.11.0")
    (source (origin
              (method url-fetch)
              (uri (cran-uri "ExPosition" version))
              (sha256
               (base32
                "1lqbvqbzzy6lxdfaaayrw5slqm3ry9p4annvx405f2sbp6dg9jgr"))))
    (properties `((upstream-name . "ExPosition")))
    (build-system r-build-system)
    (propagated-inputs (list r-prettygraphs))
    (home-page "https://cran.r-project.org/package=ExPosition")
    (synopsis "Exploratory analysis with the singular value decomposition")
    (description
     "This package provides a variety of descriptive multivariate analyses
with the singular value decomposition, such as principal components analysis,
correspondence analysis, and multidimensional scaling.  See An ExPosition of
the Singular Value Decomposition in R (Beaton et al 2014)
<doi:10.1016/j.csda.2013.11.006>.")
    (license license:gpl2)))

(define-public r-complexplus
  (package
    (name "r-complexplus")
    (version "2.1")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "complexplus" version))
       (sha256
        (base32
         "16w9v7d1ckavqmr86l34frr37pkvdn0iqnb17ssb8xaggns5lgqx"))))
    (build-system r-build-system)
    (propagated-inputs
     (list r-expm r-matrix))
    (home-page "https://cran.r-project.org/web/packages/complexplus/")
    (synopsis "Functions of complex or real variables")
    (description
     "This package extends several functions to the complex domain, including
the matrix exponential and logarithm, and the determinant.")
    (license license:gpl2)))

(define-public r-complexupset
  (package
    (name "r-complexupset")
    (version "1.3.3")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "ComplexUpset" version))
       (sha256
        (base32 "1sk4v5kc2wkgfaws0hjlp30mngm907r5gz1iglf68j46lfs9jbsv"))))
    (properties `((upstream-name . "ComplexUpset")))
    (build-system r-build-system)
    (propagated-inputs (list r-colorspace r-ggplot2 r-patchwork r-scales))
    (native-inputs (list r-knitr r-testthat))
    (home-page "https://github.com/krassowski/complex-upset")
    (synopsis "Create complex UpSet plots using ggplot2 components")
    (description
     "@code{UpSet} plots are an improvement over Venn Diagram for set overlap
visualizations.  Striving to bring the best of the @code{UpSetR} and ggplot2,
this package offers a way to create complex overlap visualisations, using
simple and familiar tools.")
    (license license:expat)))

(define-public r-phontools
  (package
    (name "r-phontools")
    (version "0.2-2.2")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "phonTools" version))
       (sha256
        (base32
         "0r5ylbxvzpa23yys4rxdlglfc5jq997ziw6yf8v9jyavy4p1ppkx"))))
    (properties `((upstream-name . "phonTools")))
    (build-system r-build-system)
    (home-page "http://www.santiagobarreda.com/rscripts.html")
    (synopsis "Tools for phonetic and acoustic analyses")
    (description
     "This package contains tools for the organization, display, and analysis
of the sorts of data frequently encountered in phonetics research and
experimentation, including the easy creation of IPA vowel plots, and the
creation and manipulation of WAVE audio files.")
    (license license:bsd-2)))

(define-public r-np
  (package
    (name "r-np")
    (version "0.60-18")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "np" version))
       (sha256
        (base32
         "16ragidbi560fvkl4pwn8wxsbcj40hp03bxqhx811cicmk0m875j"))))
    (build-system r-build-system)
    (propagated-inputs
     (list r-boot r-cubature r-quadprog r-quantreg))
    (native-inputs
     (list r-gam r-mass r-mgcv))
    (home-page "https://github.com/JeffreyRacine/R-Package-np")
    (synopsis "Non-parametric kernel smoothing methods for mixed data types")
    (description "This package provides non-parametric (and semi-parametric)
kernel methods that seamlessly handle a mix of continuous, unordered, and
ordered factor data types.")
    ;; Any version of the GPL.
    (license license:gpl3+)))

(define-public r-powerplus
  (package
    (name "r-powerplus")
    (version "3.1")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "powerplus" version))
       (sha256
        (base32
         "0ayp6x34hkzgris4j3zbbs0r23n81bhww3wgfyy630ri4sk6brrn"))))
    (build-system r-build-system)
    (propagated-inputs
     (list r-complexplus r-expm r-mass r-matrix r-phontools))
    (home-page "https://cran.r-project.org/web/packages/powerplus/")
    (synopsis "Exponentiation operations")
    (description
     "This package provides tools for the computation of matrix and scalar
exponentiation.")
    (license license:gpl2)))

(define-public r-egg
  (package
    (name "r-egg")
    (version "0.4.5")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "egg" version))
       (sha256
        (base32
         "1fy7srpiavfn8kyrr1m84an7acgwi6ydzrg71m3b0vk7y9ybmj0m"))))
    (properties `((upstream-name . "egg")))
    (build-system r-build-system)
    (propagated-inputs
     (list r-ggplot2 r-gridextra r-gtable))
    (home-page "https://cran.r-project.org/web/packages/egg")
    (synopsis "Extensions for ggplot2")
    (description
     "This package provides miscellaneous functions to help customize ggplot2
objects.  High-level functions are provided to post-process ggplot2 layouts
and allow alignment between plot panels, as well as setting panel sizes to
fixed values.  Other functions include a custom @code{geom}, and helper
functions to enforce symmetric scales or add tags to facetted plots.")
    (license license:gpl3)))

(define-public r-heatmap3
  (package
    (name "r-heatmap3")
    (version "1.1.9")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "heatmap3" version))
       (sha256
        (base32
         "0sfvizmmwfk1bjhn6zfx5a4qqfgj1ldg8x90b65crqibgfa36k2r"))))
    (build-system r-build-system)
    (propagated-inputs
     (list r-fastcluster))
    (native-inputs
     (list r-knitr))
    (home-page "https://cran.r-project.org/web/packages/heatmap3/")
    (synopsis "Improved heatmap package")
    (description
     "This package provides an improved heatmap package.  It is completely
compatible with the original R function @code{heatmap}, and provides more
powerful and convenient features.")
    (license license:gpl2+)))

(define-public r-heatmaply
  (package
    (name "r-heatmaply")
    (version "1.5.0")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "heatmaply" version))
       (sha256
        (base32
         "1crdm7avxv3zx59byz2fqbcw95728crwf9cckjb9gal1065xv95c"))))
    (build-system r-build-system)
    (propagated-inputs
     (list r-assertthat
           r-colorspace
           r-dendextend
           r-egg
           r-ggplot2
           r-htmlwidgets
           r-magrittr
           r-plotly
           r-rcolorbrewer
           r-reshape2
           r-scales
           r-seriation
           r-viridis
           r-webshot))
    (native-inputs
     (list r-knitr r-testthat))
    (home-page "https://cran.r-project.org/package=heatmaply")
    (synopsis "Interactive cluster heat maps using plotly")
    (description
     "This package enables you to create interactive cluster heatmaps that can
be saved as a stand-alone HTML file, embedded in R Markdown documents or in a
Shiny app, and made available in the RStudio viewer pane.  Hover the mouse
pointer over a cell to show details or drag a rectangle to zoom.  A heatmap is
a popular graphical method for visualizing high-dimensional data, in which a
table of numbers is encoded as a grid of colored cells.  The rows and columns
of the matrix are ordered to highlight patterns and are often accompanied by
dendrograms.")
    ;; Either version of the license.
    (license (list license:gpl2 license:gpl3))))

(define-public r-cgdsr
  (package
    (name "r-cgdsr")
    (version "1.3.0")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "cgdsr" version))
       (sha256
        (base32
         "07yc819hkabpzzh0g0cbqza6bcfy67b2marrzz1lj97f9iba78ja"))))
    (build-system r-build-system)
    ;; FIXME: Tests fail with: could not find function "context"
    (arguments (list #:tests? #false))
    (propagated-inputs
     (list r-httr r-r-methodss3 r-r-oo))
    (native-inputs (list r-testthat))
    (home-page "https://github.com/cBioPortal/cgdsr")
    (synopsis "R-based API for accessing the MSKCC Cancer Genomics Data Server")
    (description
     "This package provides a basic set of R functions for querying the Cancer
Genomics Data Server (CGDS), hosted by the Computational Biology Center at
Memorial-Sloan-Kettering Cancer Center (MSKCC).")
    (license license:lgpl3)))

(define-public r-cqrreg
  (package
    (name "r-cqrreg")
    (version "1.2.1")
    (source (origin
              (method url-fetch)
              (uri (cran-uri "cqrReg" version))
              (sha256
               (base32
                "1788hnm1qd5mv5bcizz2h170jg6954sfggjnfqcwfwg167px0df2"))))
    (properties `((upstream-name . "cqrReg")))
    (build-system r-build-system)
    (propagated-inputs (list r-quantreg r-rcpp r-rcpparmadillo))
    (home-page "https://cran.r-project.org/package=cqrReg")
    (synopsis
     "Quantile, composite quantile regression and regularized versions")
    (description
     "Estimate @dfn{quantile regression} (QR) and @dfn{composite quantile
regression} (cqr) and with adaptive lasso penalty using @dfn{interior
point} (IP), @dfn{majorize and minimize} (MM), @dfn{coordinate descent} (CD),
and @dfn{alternating direction method of multipliers algorithms} (ADMM).")
    (license license:gpl2+)))

(define-public r-imifa
  (package
    (name "r-imifa")
    (version "2.2.0")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "IMIFA" version))
       (sha256
        (base32 "08h53w1axvmvnd4z1nf5bsps5sr6g8a77q6pvg39ss7jcfqm800v"))))
    (properties `((upstream-name . "IMIFA")))
    (build-system r-build-system)
    (propagated-inputs
     (list r-matrixstats
           r-mclust
           r-mvnfast
           r-rfast
           r-slam
           r-viridislite))
    (native-inputs (list r-knitr))
    (home-page "https://cran.r-project.org/package=IMIFA")
    (synopsis
     "Infinite mixtures of infinite factor analysers and related models")
    (description
     "This package provides flexible Bayesian estimation of @acronym{IMIFA,
infinite mixtures of infinite factor analysers} and related models, for
nonparametrically clustering high-dimensional data.  The IMIFA model conducts
Bayesian nonparametric model-based clustering with factor analytic covariance
structures without recourse to model selection criteria to choose the number of
clusters or cluster-specific latent factors, mostly via efficient Gibbs updates.
Model-specific diagnostic tools are also provided, as well as many options for
plotting results, conducting posterior inference on parameters of interest,
posterior predictive checking, and quantifying uncertainty.")
    (license license:gpl3+)))

(define-public r-import
  (package
    (name "r-import")
    (version "1.3.2")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "import" version))
       (sha256
        (base32
         "0ngakg8jqn76c05hrglp4hmmwvm5a9ldc9s1i83a9rc8lni6nb1j"))))
    (build-system r-build-system)
    (native-inputs
     (list r-knitr r-rmarkdown r-testthat))
    (home-page "https://github.com/smbache/import")
    (synopsis "Import mechanism for R")
    (description
     "This is an alternative mechanism for importing objects from packages.
The syntax allows for importing multiple objects from a package with a single
command in an expressive way.  The import package bridges some of the gap
between using @code{library} (or @code{require}) and direct (single-object)
imports.  Furthermore the imported objects are not placed in the current
environment.  It is also possible to import objects from stand-alone @code{.R}
files.")
    (license license:expat)))

(define-public r-shinyace
  (package
    (name "r-shinyace")
    (version "0.4.4")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "shinyAce" version))
       (sha256
        (base32
         "1bb2kjn3ykhz544njx48vanssh4n97kv9r0p4w6ag8ir04mwl8nw"))))
    (properties `((upstream-name . "shinyAce")))
    (build-system r-build-system)
    (propagated-inputs
     (list r-jsonlite r-shiny))
    (native-inputs (list r-testthat))
    (home-page "https://cran.r-project.org/web/packages/shinyAce/")
    (synopsis "Ace editor bindings for Shiny")
    (description
     "This package provides Ace editor bindings to enable a rich text editing
environment within Shiny.")
    (license license:expat)))

(define-public r-raceid
  (package
    (name "r-raceid")
    (version "0.3.9")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "RaceID" version))
       (sha256
        (base32 "00c7bwjamxnhljcdgyb285zwd6sd0x81siva437d2xj21ki6ils1"))))
    (properties `((upstream-name . "RaceID")))
    (build-system r-build-system)
    (propagated-inputs (list r-cluster
                             r-coop
                             r-fateid
                             r-fnn
                             r-fpc
                             r-ggplot2
                             r-harmony
                             r-ica
                             r-igraph
                             r-irlba
                             r-leiden
                             r-locfit
                             r-mass
                             r-matrix
                             r-matrixstats
                             r-pheatmap
                             r-princurve
                             r-quadprog
                             r-randomforest
                             r-rcolorbrewer
                             r-rcpp
                             r-rtsne
                             r-runner
                             r-umap
                             r-vegan))
    (native-inputs (list r-knitr))
    (home-page "https://cran.r-project.org/package=RaceID")
    (synopsis
     "Algorithm for inferring cell types from single-cell RNA-seq data")
    (description
     "This tool provides an algorithm to identify rare cell types in
single-cell data.  It also identifies abundant cell types.  The method is
based on transcript counts obtained with unique molecular identifies.")
    (license license:gpl3)))

(define-public r-rafalib
  (package
    (name "r-rafalib")
    (version "1.0.4")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "rafalib" version))
       (sha256
        (base32 "04s4xyngki6szlmg0njic97z9g80nfkh2v8g79cck9g2a5x1mbg0"))))
    (properties `((upstream-name . "rafalib")))
    (build-system r-build-system)
    (propagated-inputs (list r-biocmanager r-rcolorbrewer))
    (home-page "https://cran.r-project.org/package=rafalib")
    (synopsis "Convenience functions for routine data exploration")
    (description
     "This package provides a series of shortcuts for routine tasks to
facilitate data exploration.")
    (license license:artistic2.0)))

(define-public r-random
  (package
    (name "r-random")
    (version "0.2.6")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "random" version))
       (sha256
        (base32 "0sdhagwjlhldb8hn6h4nd1sflzhwkapzybdlb8hzisy3w2ygjn9b"))))
    (properties `((upstream-name . "random")))
    (build-system r-build-system)
    ;; Vignettes require Internet access.
    (arguments (list #:test-types '(list "tests")))
    (propagated-inputs (list r-curl))
    (home-page "https://www.random.org")
    (synopsis "True random numbers using random.org")
    (description
     "The true random number service provided by the @url{random.org} website
created by Mads Haahr samples atmospheric noise via radio tuned to an unused
broadcasting frequency together with a skew correction algorithm due to John
von Neumann.  More background is available in the included vignette based on
an essay by Mads Haahr.  In its current form, the package offers functions to
retrieve random integers, randomized sequences and random strings.")
    (license license:gpl2+)))

(define-public r-randomizr
  (package
    (name "r-randomizr")
    (version "1.0.0")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "randomizr" version))
       (sha256
        (base32
         "0r7yawh4dnxawinnlz09f57kgdwa08rpwxq3y35jam3x2q48qijn"))))
    (properties `((upstream-name . "randomizr")))
    (build-system r-build-system)
    (native-inputs
     (list r-knitr r-testthat))
    (home-page "https://declaredesign.org/r/randomizr/")
    (synopsis "Tools for common forms of random assignment and sampling")
    (description
     "This package provides tools for generating random assignments for common
experimental designs and random samples for common sampling designs.")
    (license license:expat)))

(define-public r-roi
  (package
    (name "r-roi")
    (version "1.0-1")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "ROI" version))
       (sha256
        (base32 "05hnj9fskfm2klz7zv97lb0r60akjq4a1cay8p62whpi0hri9zyl"))))
    (properties `((upstream-name . "ROI")))
    (build-system r-build-system)
    (propagated-inputs (list r-checkmate r-registry r-slam))
    (native-inputs (list r-r-rsp r-testthat))
    (home-page "https://roi.r-forge.r-project.org/")
    (synopsis "R optimization infrastructure")
    (description
     "The @acronym{ROI, R Optimization Infrastructure} is a framework for handling
optimization problems in R.")
    (license license:gpl3)))

(define-public r-roptim
  (package
    (name "r-roptim")
    (version "0.1.6")
    (source (origin
              (method url-fetch)
              (uri (cran-uri "roptim" version))
              (sha256
               (base32
                "11h6qdi0rsv0bpps6nxkzzapan284q0gldzkmgx3ww5kvnic5w3y"))))
    (properties `((upstream-name . "roptim")))
    (build-system r-build-system)
    (arguments
     (list
      #:phases
      '(modify-phases %standard-phases
         (add-after 'unpack 'set-HOME
           (lambda _ (setenv "HOME" "/tmp"))))))
    (propagated-inputs (list r-rcpp r-rcpparmadillo))
    (native-inputs (list r-r-rsp r-testthat))
    (home-page "https://github.com/ypan1988/roptim/")
    (synopsis "General purpose optimization in R using C++")
    (description
     "This package performs optimization in R using C++.  A unified wrapper
interface is provided to call C functions of the five optimization algorithms
(Nelder-Mead, BFGS, CG, L-BFGS-B and SANN) underlying @code{optim()}.")
    (license license:gpl2+)))

(define-public r-base64url
  (package
    (name "r-base64url")
    (version "1.4")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "base64url" version))
       (sha256
        (base32
         "0n1c2b68vza1dh7sk38v6biiwm72c4jpl79kpdg1bsb0hq9qy18x"))))
    (build-system r-build-system)
    (propagated-inputs
     (list r-backports))
    (native-inputs
     (list r-base64enc r-checkmate r-knitr r-openssl r-testthat))
    (home-page "https://github.com/mllg/base64url")
    (synopsis "Fast and URL-safe base64 encoder and decoder")
    (description
     "This package provides a URL-safe base64 encoder and decoder.  In
contrast to RFC3548, the 62nd character (@code{+}) is replaced with @code{-},
the 63rd character (@code{/}) is replaced with @code{_}.  Furthermore, the
encoder does not fill the string with trailing @code{=}.  The resulting
encoded strings comply to the regular expression pattern @code{[A-Za-z0-9_-]}
and thus are safe to use in URLs or for file names.  The package also comes
with a simple base32 encoder/decoder suited for case insensitive file
systems.")
    (license license:gpl3)))

(define-public r-baseline
  (package
    (name "r-baseline")
    (version "1.3-5")
    (source (origin
              (method url-fetch)
              (uri (cran-uri "baseline" version))
              (sha256
               (base32
                "0l0llb3pi89ixkpvfg5vbvwwv3gzldf0g98rrd3vkm7q26rqmmd2"))))
    (properties `((upstream-name . "baseline")))
    (build-system r-build-system)
    (propagated-inputs
     (list r-gwidgets2tcltk ;for GUI
           r-limsolve
           r-sparsem))
    (home-page "https://github.com/khliland/baseline/")
    (synopsis "Baseline correction of spectra")
    (description
     "This package is a collection of baseline correction algorithms.  Beside
those it provides a framework and a Tcl/Tk enabled GUI for optimizing baseline
algorithm parameters.  Typical use is the removal of the background effects from
spectra, which are originating from various types of spectroscopy and spectrometry.
Also, there is a possibility of optimizing this with regard to regression or
classification results.  Correction methods include polynomial fitting, weighted
local smoothers and many more.")
    (license license:gpl2)))

(define-public r-radiant-data
  (package
    (name "r-radiant-data")
    (version "1.6.7")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "radiant.data" version))
       (sha256
        (base32
         "0p55nppclr5dzlslwrhzrg8cc4i0k3ck3076sh2fiay0qi2fh9cm"))
       (modules '((guix build utils)))
       (snippet
        '(delete-file "inst/assets/html2canvas/html2canvas.min.js"))))
    (properties `((upstream-name . "radiant.data")))
    (build-system r-build-system)
    (arguments
     (list
      #:modules
      '((guix build r-build-system)
        (guix build minify-build-system)
        (guix build utils))
      #:imported-modules
      `(,@%r-build-system-modules
        (guix build minify-build-system))
      #:phases
      #~(modify-phases (@ (guix build r-build-system) %standard-phases)
          (add-after 'unpack 'process-javascript
            (lambda* (#:key inputs #:allow-other-keys)
              (with-directory-excursion "inst/assets/html2canvas/"
                (minify (assoc-ref inputs "html2canvas.js")
                        #:target "html2canvas.min.js")))))))
    (propagated-inputs
     (list r-base64enc
           r-broom
           r-bslib
           r-car
           r-curl
           r-dplyr
           r-dt
           r-ggplot2
           r-glue
           r-import
           r-jsonlite
           r-knitr
           r-lubridate
           r-magrittr
           r-markdown
           r-mass
           r-patchwork
           r-plotly
           r-png
           r-psych
           r-randomizr
           r-readr
           r-readxl
           r-rlang
           r-rmarkdown
           r-rstudioapi
           r-scales
           r-shiny
           r-shinyace
           r-shinyfiles
           r-stringi
           r-tibble
           r-tidyr
           r-writexl))
    (native-inputs
     (list esbuild
           (origin
             (method url-fetch)
             (uri "https://web.archive.org/web/20230428182027id_/\
https://html2canvas.hertzen.com/dist/html2canvas.js")
             (sha256
              (base32
               "0svkfnzzsydbsrwi7ky91rjqj97x5rfic69hbr9pwhm0zxlb9i81")))
           r-testthat))
    (home-page "https://github.com/radiant-rstats/radiant.data")
    (synopsis "Data menu for Radiant: business analytics using R and Shiny")
    (description
     "The Radiant Data menu includes interfaces for loading, saving, viewing,
visualizing, summarizing, transforming, and combining data.  It also contains
functionality to generate reproducible reports of the analyses conducted in
the application.")
    (license license:agpl3)))

(define-public r-algdesign
  (package
    (name "r-algdesign")
    (version "1.2.1.2")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "AlgDesign" version))
       (sha256
        (base32 "09bn1d6naj05hbzkgnkv31s02w5qky74i63k391b4pkc5ahcfbb9"))))
    (properties `((upstream-name . "AlgDesign")))
    (build-system r-build-system)
    (home-page "https://github.com/jvbraun/AlgDesign")
    (synopsis "Algorithmic experimental design")
    (description
     "This package provides tools to calculate exact and approximate theory
experimental designs for D, A, and I criteria.  Very large designs may be
created.  Experimental designs may be blocked or blocked designs created from
a candidate list, using several criteria.  The blocking can be done when whole
and within plot factors interact.")
    (license license:gpl2+)))

(define-public r-alluvial
  (package
    (name "r-alluvial")
    (version "0.1-2")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "alluvial" version))
       (sha256
        (base32 "039frwrsxq1lb97s7vf2vbyyadimkigs628ymym06fxka53drdkp"))))
    (properties `((upstream-name . "alluvial")))
    (build-system r-build-system)
    (native-inputs (list r-knitr r-testthat))
    (home-page "https://github.com/mbojan/alluvial")
    (synopsis "Create parallel sets plots (Alluvial Diagrams)")
    (description
     "This package creates alluvial diagrams (also known as parallel sets
plots) for multivariate and time series-like data.")
    (license license:expat)))

(define-public r-signal
  (package
    (name "r-signal")
    (version "1.8-1")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "signal" version))
       (sha256
        (base32
         "1c7fw5akdm8f44zgdafsgz2fpn6kfwifaw29yakl7zykq89vq8m3"))))
    (build-system r-build-system)
    (propagated-inputs (list r-mass))
    (native-inputs (list gfortran r-pracma))
    (home-page "https://cran.r-project.org/web/packages/signal/")
    (synopsis "Signal processing")
    (description
     "This package provides a set of signal processing functions originally
written for Matlab and GNU Octave.  It includes filter generation utilities,
filtering functions, resampling routines, and visualization of filter models.
It also includes interpolation functions.")
    (license license:gpl2)))

(define-public r-simdesign
  (package
    (name "r-simdesign")
    (version "2.19.2")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "SimDesign" version))
       (sha256
        (base32 "1pcmkkvlg4qabl06s0k2bmpi2andqf4wfpr3vnb9fmcy9dfdf7dw"))))
    (properties
     '((upstream-name . "SimDesign")
       ;; Not packaged, but also not required.
       (updater-ignored-native-inputs . ("r-dompi"))))
    (build-system r-build-system)
    (propagated-inputs (list r-beepr
                             r-dplyr
                             r-future
                             r-future-apply
                             r-parallelly
                             r-pbapply
                             r-progressr
                             r-r-utils
                             r-sessioninfo
                             r-testthat))
    (native-inputs (list r-httr r-knitr r-mockery))
    (home-page "http://philchalmers.github.io/SimDesign/")
    (synopsis "Structure for organizing Monte Carlo simulation designs")
    (description
     "This package provides tools to safely and efficiently organize and
execute Monte Carlo simulation experiments in R.  The package controls the
structure and back-end of Monte Carlo simulation experiments by utilizing a
generate-analyse-summarise workflow.  The workflow safeguards against common
simulation coding issues, such as automatically re-simulating non-convergent
results, prevents inadvertently overwriting simulation files, catches error
and warning messages during execution, implicitly supports parallel processing
with high-quality random number generation, and provides tools for managing
high-performance computing (HPC) array jobs submitted to schedulers such as
SLURM. For a pedagogical introduction to the package see Sigal and Chalmers
(2016) <doi:10.1080/10691898.2016.1246953>.  For a more in-depth overview of
the package and its design philosophy see Chalmers and Adkins (2020)
<doi:10.20982/tqmp.16.4.p248>.")
    (license license:gpl2+)))

(define-public r-simplermarkdown
  (package
    (name "r-simplermarkdown")
    (version "0.0.6")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "simplermarkdown" version))
       (sha256
        (base32 "0lffwsrhsdqcqhklh24v0y0x6w4vq9jch93m330kfdv2amab1l06"))))
    (properties `((upstream-name . "simplermarkdown")))
    (build-system r-build-system)
    (propagated-inputs
     ;; We cannot patch references to pandoc because the patched files are
     ;; compiled to an opaque rdb/rdx pair.  "guix gc" would not be able to
     ;; find the patched references in those files.
     (list pandoc
           r-rjson))
    ;; For tests
    (native-inputs (list r-mass))
    (home-page "https://github.com/djvanderlaan/simplermarkdown")
    (synopsis "Simple engine for generating reports using R")
    (description
     "This package runs R-code present in a pandoc markdown file and includes
the resulting output in the resulting markdown file.  This file can then be
converted into any of the output formats supported by pandoc.  The package can
also be used as an engine for writing package vignettes.")
    (license license:gpl3+)))

(define-public r-sitar
  (package
    (name "r-sitar")
    (version "1.4.0")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "sitar" version))
       (sha256
        (base32 "14qc5qy21qyj4gml0gwfn8izbsmzwy30ddc7mazhszi487jrcrp0"))))
    (properties `((upstream-name . "sitar")))
    (build-system r-build-system)
    (propagated-inputs
     (list r-dplyr
           r-forcats
           r-ggplot2
           r-glue
           r-magrittr
           r-nlme
           r-purrr
           r-rlang
           r-rsample
           r-tibble
           r-tidyr))
    (native-inputs (list r-knitr))
    (home-page "https://github.com/statist7/sitar")
    (synopsis "Super imposition by translation and rotation growth curve analysis")
    (description
     "This package provides functions for fitting and plotting @acronym{SITAR, Super
Imposition by Translation And Rotation} growth curve models.  SITAR is a shape-
invariant model with a regression B-spline mean curve and subject-specific random
effects on both the measurement and age scales.")
    (license license:gpl2+)))

(define-public r-gsubfn
  (package
    (name "r-gsubfn")
    (version "0.7")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "gsubfn" version))
       (sha256
        (base32
         "00j6b8b6xsx6v370h220x233rpk6asca78165y3d48jpwvwisdc9"))))
    (build-system r-build-system)
    (propagated-inputs (list r-proto))
    (home-page "https://code.google.com/archive/p/gsubfn/")
    (synopsis "Utilities for strings and function arguments")
    (description
     "This package provides @code{gsubfn} which is like @code{gsub} but can
take a replacement function or certain other objects instead of the
replacement string.  Matches and back references are input to the replacement
function and replaced by the function output.  @code{gsubfn} can be used to
split strings based on content rather than delimiters and for quasi-perl-style
string interpolation.  The package also has facilities for translating
formulas to functions and allowing such formulas in function calls instead of
functions.")
    (license license:gpl2+)))

(define-public r-sqldf
  (package
    (name "r-sqldf")
    (version "0.4-11")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "sqldf" version))
       (sha256
        (base32
         "0q12vsb53p2wchgp8wfz5bk08wfnm0jxjrakclj4jyy6x3a7ksff"))))
    (build-system r-build-system)
    (propagated-inputs
     (list r-chron r-dbi r-gsubfn r-proto r-rsqlite))
    (native-inputs (list r-svunit))
    (home-page "https://github.com/ggrothendieck/sqldf")
    (synopsis "Manipulate R data frames using SQL")
    (description
     "The @code{sqldf} function is typically passed a single argument which is
an SQL select statement where the table names are ordinary R data frame names.
@code{sqldf} transparently sets up a database, imports the data frames into
that database, performs the SQL statement and returns the result using a
heuristic to determine which class to assign to each column of the returned
data frame.  The @code{sqldf} or @code{read.csv.sql} functions can also be
used to read filtered files into R even if the original files are larger than
R itself can handle.")
    (license license:gpl2)))

(define-public r-abind
  (package
    (name "r-abind")
    (version "1.4-8")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "abind" version))
       (sha256
        (base32
         "1q934vfyvszmy6nv13dchv2mbsj9i5vffy88b9wy3siwa8dhaji6"))))
    (build-system r-build-system)
    (home-page "https://cran.r-project.org/web/packages/abind/")
    (synopsis "Combine multidimensional arrays")
    (description
     "This package provides tools to combine multidimensional arrays into a
single array.  This is a generalization of @code{cbind} and @code{rbind}.  It
works with vectors, matrices, and higher-dimensional arrays.  It also provides
the functions @code{adrop}, @code{asub}, and @code{afill} for manipulating,
extracting and replacing data in arrays.")
    (license license:lgpl2.0+)))

(define-public r-prroc
  (package
    (name "r-prroc")
    (version "1.4")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "PRROC" version))
       (sha256
        (base32
         "1dlknj6q67iq4xmxj7lz8mz1hsy9qiiy4px0h7raidgckdx4mfwx"))))
    (properties `((upstream-name . "PRROC")))
    (build-system r-build-system)
    (native-inputs (list r-ggplot2 r-testthat))
    (home-page "https://cran.r-project.org/web/packages/PRROC/")
    (synopsis "Precision-Recall and ROC curves for weighted and unweighted data")
    (description
     "This package computes the areas under the @dfn{precision-recall} (PR)
and ROC curve for weighted (e.g. soft-labeled) and unweighted data.  In
contrast to other implementations, the interpolation between points of the PR
curve is done by a non-linear piecewise function.  In addition to the areas
under the curves, the curves themselves can also be computed and plotted by a
specific S3-method.")
    (license license:gpl3)))

(define-public r-vim
  (package
    (name "r-vim")
    (version "6.2.2")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "VIM" version))
       (sha256
        (base32
         "1r0myxcx8y1a3fkf9ssk882f09snn2j6zilsygpld32hahn4k9xg"))))
    (properties `((upstream-name . "VIM")))
    (build-system r-build-system)
    (propagated-inputs
     (list r-car
           r-colorspace
           r-data-table
           r-e1071
           r-laeken
           r-magrittr
           r-mass
           r-nnet
           r-ranger
           r-rcpp
           r-robustbase
           r-sp
           r-vcd))
    (native-inputs
     (list r-knitr))
    (home-page "https://github.com/alexkowa/VIM")
    (synopsis "Visualization and imputation of missing values")
    (description
     "This package provides tools for the visualization of missing and/or
imputed values are introduced, which can be used for exploring the data and
the structure of the missing and/or imputed values.  Depending on this
structure of the missing values, the corresponding methods may help to
identify the mechanism generating the missing values and explore the
data including missing values.  In addition, the quality of imputation can be
visually explored using various univariate, bivariate, multiple and
multivariate plot methods.")
    (license license:gpl2+)))

(define-public r-fnn
  (package
    (name "r-fnn")
    (version "1.1.4.1")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "FNN" version))
       (sha256
        (base32
         "0m5q1jkyxynjgzakzn48aqxr5cc92sgl7z9j1zlqmb1yzn3p9nbk"))))
    (properties `((upstream-name . "FNN")))
    (build-system r-build-system)
    (home-page "https://cran.r-project.org/web/packages/FNN")
    (synopsis "Fast nearest neighbor search algorithms and applications")
    (description
     "This package provides cover-tree and kd-tree fast k-nearest neighbor
search algorithms.  Related applications including KNN classification,
regression and information measures are implemented.")
    ;; The DESCRIPTION file erroneously states that GPL version 2.1 or
    ;; later can be used.
    (license license:gpl2+)))

(define-public r-smoother
  (package
    (name "r-smoother")
    (version "1.3")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "smoother" version))
       (sha256
        (base32
         "0xw28qv8f5i05ajx32njnql6hql5njqyc47wcq6c75cxiv44ppz8"))))
    (build-system r-build-system)
    (propagated-inputs
     (list r-ttr))
    (home-page "https://cran.r-project.org/web/packages/smoother")
    (synopsis "Functions relating to the smoothing of numerical data")
    (description
     "This package provides a collection of methods for smoothing numerical
data, commencing with a port of the Matlab gaussian window smoothing function.
In addition, several functions typically used in smoothing of financial data
are included.")
    (license license:gpl2)))

(define-public r-riverplot
  (package
    (name "r-riverplot")
    (version "0.10")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "riverplot" version))
       (sha256
        (base32
         "04ap1dsa7fx03l73jhv1ql3adaaaz2100qawdplxa9xmrllgcgbj"))))
    (build-system r-build-system)
    (propagated-inputs
     (list r-rcolorbrewer))
    (native-inputs
     (list r-knitr))
    (home-page "https://logfc.wordpress.com")
    (synopsis "Sankey or ribbon plots")
    (description
     "Sankey plots are a type of diagram that is convenient to illustrate how
flow of information, resources etc. separates and joins, much like observing
how rivers split and merge.  For example, they can be used to compare
different clusterings.  This package provides an implementation of Sankey
plots for R.")
    (license license:gpl2+)))

(define-public r-dyn
  (package
    (name "r-dyn")
    (version "0.2-9.6")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "dyn" version))
       (sha256
        (base32
         "16fqv9k7yxdgybwzafjkyqm16qpgqz13lcjpi6a1nc8xbzlzh0gb"))))
    (build-system r-build-system)
    (propagated-inputs
     (list r-zoo))
    (native-inputs (list r-sandwich))
    (home-page "https://cran.r-project.org/web/packages/dyn")
    (synopsis "Time series regression")
    (description
     "This package provides the dyn class interfaces @code{ts}, @code{irts},
@code{zoo} and @code{zooreg} time series classes to @code{lm}, @code{glm},
@code{loess}, @code{quantreg::rq}, @code{MASS::rlm},
@code{MCMCpack::MCMCregress()}, @code{quantreg::rq()},
@code{randomForest::randomForest()} and other regression functions, allowing
those functions to be used with time series including specifications that may
contain lags, diffs and missing values.")
    ;; Any GPL version.
    (license license:gpl2+)))

(define-public r-dyngen
  (package
    (name "r-dyngen")
    (version "1.0.5")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "dyngen" version))
       (sha256
        (base32
         "095jqn1rd83qm3ayca9hmv6bhlaa2c338020l46vniq8n38kbnra"))))
    (properties `((upstream-name . "dyngen")))
    (build-system r-build-system)
    (arguments
     (list
      #:phases
      '(modify-phases %standard-phases
         ;; For vignette builder.
         (add-after 'unpack 'set-HOME
           (lambda _ (setenv "HOME" "/tmp"))))))
    (propagated-inputs
     (list r-assertthat
           r-dplyr
           r-dynutils
           r-ggplot2
           r-ggraph
           r-ggrepel
           r-gillespiessa2
           r-igraph
           r-lmds
           r-matrix
           r-patchwork
           r-pbapply
           r-purrr
           r-rlang
           r-tibble
           r-tidygraph
           r-tidyr
           r-viridis))
    (native-inputs (list r-r-rsp r-testthat))
    (home-page "https://github.com/dynverse/dyngen")
    (synopsis "Multi-Modal simulator for single-cell omics analyses")
    (description
     "This package provides a multi-modal simulation engine for studying
dynamic cellular processes at single-cell resolution.")
    (license license:expat)))

(define-public r-dynutils
  (package
    (name "r-dynutils")
    (version "1.0.11")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "dynutils" version))
       (sha256
        (base32 "06an2bm1d131v28m240vii2wisbz3zs32wbamm2w7r8rl3yrxkh9"))))
    (properties `((upstream-name . "dynutils")))
    (build-system r-build-system)
    (propagated-inputs
     (list r-assertthat
           r-crayon
           r-desc
           r-dplyr
           r-magrittr
           r-matrix
           r-proxyc
           r-purrr
           r-rcpp
           r-remotes
           r-stringr
           r-tibble))
    (native-inputs (list r-knitr r-testthat))
    (home-page "https://github.com/dynverse/dynutils")
    (synopsis "Common functionality for the dynverse packages")
    (description
     "This package provides common functionality for the
@url{https://dynverse.org,dynverse} packages.  dynverse is created to support
the development, execution, and benchmarking of trajectory inference
methods.")
    (license license:expat)))

(define-public r-catdap
  (package
    (name "r-catdap")
    (version "1.3.7")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "catdap" version))
       (sha256
        (base32
         "0z84bx808hy70bkzdda9l42ljh9i9pz07isxq756axi7nr0ky6p9"))))
    (build-system r-build-system)
    (propagated-inputs
     (list r-rcolorbrewer))
    (native-inputs
     (list gfortran))
    (home-page "https://cran.r-project.org/web/packages/catdap/")
    (synopsis "Tools for categorical data analysis")
    (description
     "This package provides functions for analyzing multivariate data.
Dependencies of the distribution of the specified variable (response
variable) to other variables (explanatory variables) are derived and
evaluated by the @dfn{Akaike Information Criterion} (AIC).")
    (license license:gpl2+)))

(define-public r-catdata
  (package
    (name "r-catdata")
    (version "1.2.4")
    (source (origin
              (method url-fetch)
              (uri (cran-uri "catdata" version))
              (sha256
               (base32
                "1gvibnjfrjdsxx4jks29hhk3dfsm23nxnbwd5p8w67nxr4n6qn0w"))))
    (properties `((upstream-name . "catdata")))
    (build-system r-build-system)
    (propagated-inputs (list r-mass))
    (native-inputs (list r-knitr))
    (home-page "https://cran.r-project.org/package=catdata")
    (synopsis
     "Datasets and examples used in the book @emph{Regression for Categorical Data}")
    (description
     "This R package contains examples from the book @emph{Regression
for Categorical Data}, Tutz 2012, Cambridge University Press.  The
names of the examples refer to the chapter and the data set that is
used.")
    (license license:gpl2)))

(define-public r-arules
  (package
    (name "r-arules")
    (version "1.7-11")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "arules" version))
       (sha256
        (base32
         "0p4rxd4k7j1nhz05zw2w0rqiryvrw75gcga2nrmmmp7ghd42g527"))))
    (build-system r-build-system)
    (propagated-inputs
     (list r-generics r-matrix))
    (native-inputs (list r-testthat))
    (home-page "https://github.com/mhahsler/arules")
    (synopsis "Mining association rules and frequent itemsets")
    (description
     "This package provides an infrastructure for representing, manipulating
and analyzing transaction data and patterns (frequent itemsets and association rules).
It also provides C implementations of the association mining algorithms Apriori
and Eclat.")
    (license license:gpl3)))

(define-public r-parsedate
  (package
    (name "r-parsedate")
    (version "1.3.2")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "parsedate" version))
       (sha256
        (base32
         "0w0phy4jrhh14la507p9051skmmymbdza8kz8jpvhvkg81sdrd79"))))
    (properties
     '((updater-extra-native-inputs . ("tzdata-for-tests"))))
    (build-system r-build-system)
    (arguments
     (list
      #:phases
      '(modify-phases %standard-phases
         (add-before 'install 'set-timezone
           (lambda* (#:key inputs #:allow-other-keys)
             (setenv "TZ" "UTC")
             (setenv "TZDIR"
                     (search-input-directory inputs
                                             "share/zoneinfo")))))))
    (native-inputs (list r-testthat r-withr tzdata-for-tests))
    (home-page "https://github.com/gaborcsardi/parsedate")
    (synopsis
     "Recognize and parse dates in various formats")
    (description
     "This package provides three functions for dealing with dates:
@code{parse_iso_8601} recognizes and parses all valid ISO 8601 date and
time formats, @code{parse_date} parses dates in unspecified formats,
and @code{format_iso_8601} formats a date in ISO 8601 format.")
    (license license:gpl2)))

(define-public r-adbcdrivermanager
  (package
    (name "r-adbcdrivermanager")
    (version "0.18.0")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "adbcdrivermanager" version))
       (sha256
        (base32 "16zfwk1cl76ah80q62xbrri96d4dhmi9z6674478dsnnfpqvxqh2"))))
    (properties `((upstream-name . "adbcdrivermanager")))
    (build-system r-build-system)
    (propagated-inputs (list r-nanoarrow))
    (native-inputs (list r-testthat))
    (home-page "https://arrow.apache.org/adbc/current/r/adbcdrivermanager/")
    (synopsis "Arrow Database Connectivity (ADBC) driver manager")
    (description
     "This package provides a developer-facing interface to Arrow Database
Connectivity (ADBC) for the purposes of driver development, driver testing,
and building high-level database interfaces for users.  ADBC is an API
standard for database access libraries that uses Arrow for result sets and
query parameters.")
    (license license:asl2.0)))

(define-public r-abc-data
  (package
    (name "r-abc-data")
    (version "1.1")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "abc.data" version))
       (sha256
        (base32
         "0zdhrnhvgnk3lp18cxgzsxa38xr7pl55g48pk373q1d6h77qbmj8"))))
    (properties `((upstream-name . "abc.data")))
    (build-system r-build-system)
    (home-page "https://cran.r-project.org/web/packages/abc.data/")
    (synopsis "Data for Approximate Bayesian Computation (ABC) package")
    (description
     "This package contains data which are used by functions of the abc
package which implements several @dfn{Approximate Bayesian Computation} (ABC)
algorithms for performing parameter estimation, model selection, and
goodness-of-fit.")
    (license license:gpl3+)))

(define-public r-abc
  (package
    (name "r-abc")
    (version "2.2.2")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "abc" version))
       (sha256
        (base32
         "15a15y2pvrg2d7bjsavrq1wgz2fx21wa2lrzxiz6w3mp3ks1k55w"))))
    (build-system r-build-system)
    (propagated-inputs
     (list r-abc-data r-locfit r-mass r-nnet r-quantreg))
    (home-page "https://cran.r-project.org/web/packages/abc/")
    (synopsis "Tools for Approximate Bayesian Computation (ABC)")
    (description
     "This package implements several @dfn{Approximate Bayesian
Computation} (ABC) algorithms for performing parameter estimation, model
selection, and goodness-of-fit.  Cross-validation tools are also available for
measuring the accuracy of ABC estimates, and to calculate the
misclassification probabilities of different models.")
    (license license:gpl3+)))

(define-public r-zip
  (package
    (name "r-zip")
    (version "2.3.3")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "zip" version))
       (sha256
        (base32
         "0lls4hllimjnl9bhr31y9x3fj8vdszxbaj6p781kgfdpz0j0nifh"))))
    (build-system r-build-system)
    (native-inputs (list r-testthat r-withr))
    (home-page "https://github.com/gaborcsardi/zip")
    (synopsis "Cross-platform Zip compression")
    (description
     "This package provides a cross-platform Zip compression library for R.
It is a replacement for the @code{zip} function, that does not require any
additional external tools on any platform.")
    (license license:cc0)))

(define-public r-openai
  (package
    (name "r-openai")
    (version "0.4.1")
    (source (origin
              (method url-fetch)
              (uri (cran-uri "openai" version))
              (sha256
               (base32
                "1fi1nc9c7kfnig6b5ifpb1v9r3gxszk984rwyq7i1lb6s5jv0b9z"))))
    (properties
     '((upstream-name . "openai")
       (updater-extra-native-inputs . ("r-purrr"))))
    (build-system r-build-system)
    (propagated-inputs (list r-assertthat
                             r-glue
                             r-httr
                             r-jsonlite
                             r-lifecycle
                             r-magrittr))
    (native-inputs (list r-purrr r-testthat))
    (home-page "https://github.com/irudnyts/openai")
    (synopsis "R Wrapper for OpenAI API")
    (description
     "This package provides an R wrapper of OpenAI API endpoints (see
@url{https://platform.openai.com/docs/introduction} for details).  This
package covers Models, Completions, Chat, Edits, Images, Embeddings, Audio,
Files, Fine-tunes, Moderations, and legacy Engines endpoints.")
    (license license:expat)))

(define-public r-operator-tools
  (package
    (name "r-operator-tools")
    (version "1.6.3")
    (source (origin
              (method url-fetch)
              (uri (cran-uri "operator.tools" version))
              (sha256
               (base32
                "1v4dg7xhz24dnp0zxn815x1405ig64ibii6y40la1gvmzcc41dz5"))))
    (properties `((upstream-name . "operator.tools")))
    (build-system r-build-system)
    (native-inputs (list r-testthat))
    (home-page "https://github.com/decisionpatterns/operator.tools")
    (synopsis "Utilities for working with R's operators")
    (description
     "This package provides a collection of utilities that allow programming
with R's operators.  Routines allow classifying operators, translating to and
from an operator and its underlying function, and inverting some
operators (e.g. comparison operators), etc.  All methods can be extended to
custom infix operators.")
    (license license:gpl2)))

(define-public r-openxlsx
  (package
    (name "r-openxlsx")
    (version "4.2.8")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "openxlsx" version))
       (sha256
        (base32
         "1n74jxjvqzyvxg39qvjwsq2csl843ircdxw2ypanqzv7ifmn224a"))))
    (build-system r-build-system)
    (propagated-inputs
     (list r-rcpp r-stringi r-zip))
    (native-inputs
     (list r-knitr r-testthat r-writexl))
    (home-page "https://github.com/awalker89/openxlsx")
    (synopsis "Read, write and edit XLSX files")
    (description
     "This package simplifies the creation of Excel @code{.xlsx} files by
providing a high level interface to writing, styling and editing worksheets.
Through the use of Rcpp, read/write times are comparable to the @code{xlsx}
and @code{XLConnect} packages with the added benefit of removing the
dependency on Java.")
    (license license:gpl3)))

(define-public r-rio
  (package
    (name "r-rio")
    (version "1.2.3")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "rio" version))
       (sha256
        (base32
         "1annh9zsfskizr2idylgvqm41cfzldn56bh9vkzxqqvznka7k123"))))
    (build-system r-build-system)
    (arguments
     (list
      #:phases
      '(modify-phases %standard-phases
         (add-before 'check 'find-zip
           (lambda _
             (setenv "R_ZIPCMD" (which "zip")))))))
    (propagated-inputs
     (list r-curl
           r-data-table
           r-foreign
           r-haven
           r-lifecycle
           r-r-utils
           r-readr
           r-readxl
           r-tibble
           r-writexl))
    (native-inputs
     (list r-knitr r-stringi r-testthat r-xml2 zip))
    (home-page "https://github.com/leeper/rio")
    (synopsis "Swiss-army knife for data I/O")
    (description
     "This package provides streamlined data import and export infrastructure
by making assumptions that the user is probably willing to make: @code{import}
and @code{export} determine the data structure from the file extension,
reasonable defaults are used for data import and export (e.g.,
@code{stringsAsFactors=FALSE}), web-based import is natively
supported (including from SSL/HTTPS), compressed files can be read directly
without explicit decompression, and fast import packages are used where
appropriate.  An additional convenience function, @code{convert}, provides a
simple method for converting between file types.")
    (license license:gpl2)))

(define-public r-maptools
  (package
    (name "r-maptools")
    (version "1.1-8")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "maptools" version))
       (sha256
        (base32
         "1xz0cqg629vz7mawwxx650mgmvh3wzn25rnxy4sij5jrypipk1ay"))))
    (build-system r-build-system)
    (arguments
     (list
      #:phases
      '(modify-phases %standard-phases
         (add-after 'unpack 'patch-Calloc
           (lambda _
             (substitute* "src/pip.c"
               (("# include <R.h>") "# include <R.h>\n# include <R_ext/RS.h>")
               (("Calloc") "R_Calloc")
               (("Free") "R_Free")))))))
    (propagated-inputs
     (list r-foreign r-lattice r-sp))
    (home-page "https://r-forge.r-project.org/projects/maptools/")
    (synopsis "Tools for reading and handling spatial objects")
    (description
     "This package provides a set of tools for manipulating and reading
geographic data, in particular ESRI Shapefiles.  It includes binary access to
GSHHG shoreline files.  The package also provides interface wrappers for
exchanging spatial objects with other R packages.")
    ;; The C source files from shapelib are released under the Expat license.
    ;; The R code is released under GPL version 2 or later.
    (license (list license:gpl2+
                   license:expat))))

(define-public r-maptree
  (package
    (name "r-maptree")
    (version "1.4-8")
    (source (origin
              (method url-fetch)
              (uri (cran-uri "maptree" version))
              (sha256
               (base32
                "1x35nk4fi2b62krcvcv187n5sbqrgvw4pbm7r19ps3jlanpi5ksm"))))
    (properties `((upstream-name . "maptree")))
    (build-system r-build-system)
    (propagated-inputs (list r-cluster r-rpart))
    (home-page "https://cran.r-project.org/package=maptree")
    (synopsis "Mapping, pruning, and graphing tree models")
    (description
     "This package provides a set of functions with example data for graphing,
pruning, and mapping models.  These models are from hierarchical clustering,
and classification and regression trees.")
    ;; Unlimited distribution; see
    ;; https://cran.r-project.org/web/packages/maptree/index.html
    (license (license:non-copyleft "file://DESCRIPTION"))))

(define-public r-later
  (package
    (name "r-later")
    (version "1.4.2")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "later" version))
       (sha256
        (base32
         "1lrllkh60hn8857hdyscmi0qj9jrsyjaz4w4ls0ykqbx4awj3yay"))))
    (properties
     ;; Not packaged and not needed.
     '((updater-extra-native-inputs . ("r-nanonext"))))
    (build-system r-build-system)
    (propagated-inputs
     (list r-rcpp r-rlang))
    (native-inputs
     (list r-knitr r-r6 r-testthat))
    (home-page "https://github.com/r-lib/later")
    (synopsis "Utilities for delaying function execution")
    (description
     "This package provides tools to execute arbitrary R or C functions some
time after the current time, after the R execution stack has emptied.")
    (license license:gpl2+)))

(define-public r-promises
  (package
    (name "r-promises")
    (version "1.3.3")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "promises" version))
       (sha256
        (base32
         "07k4qd01kkjl983lvhnh3mcqa0ahdbpzm0ds0qfjpxphidl5g8j6"))))
    (build-system r-build-system)
    (propagated-inputs
     (list r-fastmap
           r-later
           r-magrittr
           r-r6
           r-rcpp
           r-rlang))
    (native-inputs
     (list r-future r-knitr r-spelling r-testthat))
    (home-page "https://rstudio.github.io/promises")
    (synopsis "Abstractions for promise-based asynchronous programming")
    (description
     "This package provides fundamental abstractions for doing asynchronous
programming in R using promises.  Asynchronous programming is useful for
allowing a single R process to orchestrate multiple tasks in the background
while also attending to something else.  Semantics are similar to JavaScript
promises, but with a syntax that is idiomatic R.")
    (license license:expat)))

(define-public r-dosnow
  (package
    (name "r-dosnow")
    (version "1.0.20")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "doSNOW" version))
       (sha256
        (base32
         "1f5v0k2w0b2478p6iqa3hn2lwd1x3rzc348n57nd38ka2vnsnz4i"))))
    (properties `((upstream-name . "doSNOW")))
    (build-system r-build-system)
    (propagated-inputs
     (list r-foreach r-iterators r-snow))
    (native-inputs (list r-runit))
    (home-page "https://cran.r-project.org/web/packages/doSNOW")
    (synopsis "Foreach parallel adaptor for the snow package")
    (description
     "This package provides a parallel backend for the @code{%dopar%} function
using the @code{snow} package.")
    (license license:gpl2)))

(define-public r-flexparamcurve
  (package
    (name "r-flexparamcurve")
    (version "1.5-6")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "FlexParamCurve" version))
       (sha256
        (base32 "0p0c949cdb05r6xnjc7k1i47z809g4mda1l94q7f4dikpnl1h2zd"))))
    (properties `((upstream-name . "FlexParamCurve")))
    (build-system r-build-system)
    (propagated-inputs (list r-nlme))
    (home-page "https://pennstate.academia.edu:443/SteveOswald")
    (synopsis "Tools to fit flexible parametric curves")
    (description
     "This package provides model selection tools and @code{selfStart}
functions to fit parametric curves in the nls, @code{nlsList} and nlme
frameworks.")
    (license license:gpl2)))

(define-public r-fsa
  (package
    (name "r-fsa")
    (version "0.10.0")
    (source (origin
              (method url-fetch)
              (uri (cran-uri "FSA" version))
              (sha256
               (base32
                "0hdmg4wjrrmng2bnr7h1x39iand34navl34vvngbcfcyjy5li407"))))
    (properties
     '((upstream-name . "FSA")))
    (build-system r-build-system)
    (propagated-inputs (list r-car
                             r-dunn-test
                             r-flexparamcurve
                             r-lmtest
                             r-plotrix
                             r-purrr
                             r-withr))
    (native-inputs (list r-desctools
                         r-fishmethods
                         r-fsadata
                         r-nlme
                         r-psych
                         r-testthat
                         r-tibble))
    (home-page "https://fishr-core-team.github.io/FSA/")
    (synopsis "Simple fisheries stock assessment methods")
    (description
     "This package provides a variety of simple fish stock assessment
methods.")
    (license license:gpl2+)))

(define-public r-fsadata
  (package
    (name "r-fsadata")
    (version "0.4.1")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "FSAdata" version))
       (sha256
        (base32 "0zh0gkylziysqjc9gn3kjz7070x2rvmi1c64kxl6q2479929hysi"))))
    (properties `((upstream-name . "FSAdata")))
    (build-system r-build-system)
    (home-page "https://fishr-core-team.github.io/FSAdata/")
    (synopsis "Data to support the fish stock assessment package")
    (description
     "This package provides the datasets to support the Fish Stock
Assessment (FSA) package.")
    (license license:gpl2+)))

(define-public r-fstcore
  (package
    (name "r-fstcore")
    (version "0.10.0")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "fstcore" version))
       (sha256
        (base32 "1k6rm3vq26v8by1wwdrw7m0d2dlxrdjhc43x79bdmk2x55nrg7hy"))))
    (properties `((upstream-name . "fstcore")))
    (build-system r-build-system)
    (propagated-inputs (list r-rcpp))
    (inputs (list zlib))
    (native-inputs (list pkg-config r-lintr r-testthat))
    (home-page "https://www.fstpackage.org/fstcore/")
    (synopsis "R bindings to the fstlib library")
    (description
     "The fstlib library provides multithreaded serialization of compressed
data frames using the fst format.  The fst format allows for random access of
stored data and compression with the LZ4 and ZSTD compressors.")
    (license license:mpl2.0)))

(define-public r-fst
  (package
    (name "r-fst")
    (version "0.9.8")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "fst" version))
       (sha256
        (base32
         "0r96inwrr960m7wmc80603bw2vvvwab225bh9dq3lalwhy4yiis4"))))
    (properties `((upstream-name . "fst")))
    (build-system r-build-system)
    (propagated-inputs (list r-fstcore r-rcpp))
    (native-inputs (list r-data-table r-testthat))
    (home-page "https://www.fstpackage.org")
    (synopsis "Fast serialization of data frames")
    (description
     "The fst package for R provides a fast, easy and flexible way to
serialize data frames.  With access speeds of multiple GB/s, fst is
specifically designed to unlock the potential of high speed solid state disks.
Data frames stored in the fst format have full random access, both in column
and rows.  The fst format allows for random access of stored data and
compression with the LZ4 and ZSTD compressors.")
    (license license:agpl3)))

(define-public r-snftool
  (package
    (name "r-snftool")
    (version "2.3.1")
    (source (origin
              (method url-fetch)
              (uri (cran-uri "SNFtool" version))
              (sha256
               (base32
                "05hz230aq5wbzhknxzr4iqv3nqjhbpf66n6bp1rc5h2jgz2yfbwq"))))
    (properties `((upstream-name . "SNFtool")))
    (build-system r-build-system)
    (propagated-inputs (list r-alluvial r-exposition))
    (home-page "https://cran.r-project.org/package=SNFtool")
    (synopsis "Similarity network fusion")
    (description
     "Similarity Network Fusion takes multiple views of a network and fuses
them together to construct an overall status matrix.  The input to our
algorithm can be feature vectors, pairwise distances, or pairwise
similarities.  The learned status matrix can then be used for retrieval,
clustering, and classification.")
    ;; Any version of the GPL
    (license license:gpl3+)))

(define-public r-snowfall
  (package
   (name "r-snowfall")
   (version "1.84-6.3")
   (source (origin
            (method url-fetch)
            (uri (cran-uri "snowfall" version))
            (sha256
             (base32 "0hxip3rzv7slxvif1000avbcid2mjxj1y9mimyvk87h404mr6h96"))))
   (build-system r-build-system)
   (propagated-inputs
    (list r-snow))
   (home-page "https://cran.r-project.org/web/packages/snowfall/")
   (synopsis "Easier cluster computing")
   (description "This package is a usability wrapper around snow for easier
development of parallel R programs.  This package offers e.g. extended error
checks, and additional functions.  All functions work in sequential mode, too,
if no cluster is present or wished.  The package is also designed as connector
to the cluster management tool @code{sfCluster}, but can also used without
it.")
   (license license:gpl2+)))

(define-public r-rgenoud
  (package
    (name "r-rgenoud")
    (version "5.9-0.11")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "rgenoud" version))
       (sha256
        (base32 "12pf7kvyvly0aqrk84k07cx7gnqmnrpfzs41ys960gx70lzf77f6"))))
    (properties `((upstream-name . "rgenoud")))
    (build-system r-build-system)
    (native-inputs (list r-testthat))
    (home-page "https://github.com/JasjeetSekhon/rgenoud")
    (synopsis "R version of genetic optimization using derivatives")
    (description
     "This package provides a genetic algorithm plus derivative optimizer.")
    (license license:gpl3)))

(define-public r-rgexf
  (package
    (name "r-rgexf")
    (version "0.16.3")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "rgexf" version))
       (sha256
        (base32
         "1c1rqgr7qsj61gp2frm197k396xfdspvmmwr56izwb09225cbp6d"))
       ;; Delete minified JavaScript files
       (snippet
        '(for-each delete-file
                   '("inst/gexf-js/js/jquery-2.0.2.min.js"
                     "inst/gexf-js/js/jquery-ui-1.10.3.custom.min.js"
                     "inst/gexf-js/js/jquery.mousewheel.min.js")))))
    (properties `((upstream-name . "rgexf")))
    (build-system r-build-system)
    (arguments
     `(#:modules ((guix build utils)
                  (guix build r-build-system)
                  (srfi srfi-1)
                  (ice-9 popen))
       #:phases
       (modify-phases %standard-phases
         (add-after 'unpack 'process-javascript
           (lambda* (#:key inputs #:allow-other-keys)
             (invoke "unzip" "-d" "/tmp" (assoc-ref inputs "js-jquery-ui"))
             (with-directory-excursion "inst/gexf-js/js/"
               (call-with-values
                   (lambda ()
                     (unzip2
                      `((,(assoc-ref inputs "js-jquery")
                         "jquery-2.0.2.min.js")
                        ("/tmp/jquery-ui-1.10.3/ui/jquery-ui.js"
                         "jquery-ui-1.10.3.custom.min.js")
                        (,(assoc-ref inputs "js-jquery-mousewheel")
                         "jquery.mousewheel.min.js"))))
                 (lambda (sources targets)
                   (for-each (lambda (source target)
                               (format #true "Processing ~a --> ~a~%"
                                       source target)
                               (invoke "esbuild" source "--minify"
                                       (string-append "--outfile=" target)))
                             sources targets)))))))))
    (propagated-inputs
     (list r-igraph r-servr r-xml))
    (native-inputs
     `(("r-knitr" ,r-knitr)
       ("esbuild" ,esbuild)
       ("unzip" ,unzip)
       ("js-jquery"
        ,(origin
           (method url-fetch)
           (uri "https://code.jquery.com/jquery-2.0.2.js")
           (sha256
            (base32
             "0v818bxpw48gdk8i95qqqij80r9jcgisi2r4ac6xnxca20h0gvfj"))))
       ("js-jquery-ui"
        ,(origin
           (method url-fetch)
           (uri "https://jqueryui.com/resources/download/jquery-ui-1.10.3.zip")
           (sha256
            (base32
             "00xpfy0l69nj2yan4s8k65ldsrlfsjkmyw2dwcg93dc8mv454vxx"))))
       ("js-jquery-mousewheel"
        ,(origin
           (method url-fetch)
           (uri "https://raw.githubusercontent.com/jquery/jquery-mousewheel/\
3.0.6/jquery.mousewheel.js")
           (sha256
            (base32
             "19lk5xy2s47bx8hsa7j6bg012f8yw6d770g230bcnm559kf4nc6v"))))))
    (home-page "https://gvegayon.github.io/rgexf")
    (synopsis "Build, import and export GEXF graph files")
    (description
     "Create, read and write GEXF (Graph Exchange XML Format) graph
files (used in Gephi and others).  It allows the user to easily build/read
graph files including attributes, GEXF visual attributes (such as color, size,
and position), network dynamics (for both edges and nodes) and edge weighting.
Users can build/handle graphs element-by-element or massively through
data-frames, visualize the graph on a web browser through gexf-js (a
JavaScript library) and interact with the igraph package.")
    (license license:expat)))

(define-public r-data-tree
  (package
    (name "r-data-tree")
    (version "1.1.0")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "data.tree" version))
       (sha256
        (base32
         "0qxd1g159phc6f18iddjljdg96sh09w63xqawjwbwyhg4blm9ddh"))))
    (properties `((upstream-name . "data.tree")))
    (build-system r-build-system)
    (arguments
     (list
      #:phases
      '(modify-phases %standard-phases
         (add-after 'unpack 'disable-bad-tests
           (lambda _
             ;; This test requires DiagrammeR, which we cannot add to Guix
             ;; because of massive amounts of minified JavaScript.
             (substitute* "tests/testthat/test-draw.R"
               ((".*grViz names with quotes.*" m)
                (string-append m "skip('skip');\n"))))))))
    (propagated-inputs
     (list r-r6 r-stringi))
    (native-inputs
     (list r-knitr r-rmarkdown r-testthat))
    (home-page "https://github.com/gluc/data.tree")
    (synopsis "General purpose hierarchical data structure")
    (description
     "Create tree structures from hierarchical data, and traverse the tree in
various orders.  Aggregate, cumulate, print, plot, convert to and from
data.frame and more.  This is useful for decision trees, machine learning,
finance, conversion from and to JSON, and many other applications.")
    (license license:gpl2+)))

(define-public r-dtplyr
  (package
    (name "r-dtplyr")
    (version "1.3.1")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "dtplyr" version))
       (sha256
        (base32
         "1rfnr1f3dzzivzmw9jjaclckkany6c625bqr8lkx32qbcjd6iad5"))))
    (properties `((upstream-name . "dtplyr")))
    (build-system r-build-system)
    (propagated-inputs
     (list r-cli
           r-data-table
           r-dplyr
           r-glue
           r-lifecycle
           r-rlang
           r-tibble
           r-tidyselect
           r-vctrs))
    (native-inputs
     (list r-knitr r-testthat r-tidyr))
    (home-page "https://github.com/tidyverse/dtplyr")
    (synopsis "Data Table back-end for dplyr")
    (description
     "This package provides a @code{data.table} backend for @code{dplyr}.  The
goal of @code{dtplyr} is to allow you to write @code{dplyr} code that is
automatically translated to the equivalent, but usually much faster,
@code{data.table} code.")
    (license license:expat)))

(define-public r-collapsibletree
  (package
    (name "r-collapsibletree")
    (version "0.1.8")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "collapsibleTree" version))
       (sha256
        (base32
         "1i5nmw5w7m8xdgxzim8z8n4w321f42isxbvvajl8ii59pg7drilq"))
       (snippet
        '(begin
           ;; Delete minified JavaScript file
           (delete-file "inst/htmlwidgets/lib/d3-4.10.2/d3.min.js")
           #true))))
    (properties
     `((upstream-name . "collapsibleTree")))
    (build-system r-build-system)
    (arguments
     `(#:phases
       (modify-phases %standard-phases
         (add-after 'unpack 'process-javascript
           (lambda* (#:key inputs #:allow-other-keys)
             (with-directory-excursion "inst/htmlwidgets/lib/d3-4.10.2/"
               (let ((source (assoc-ref inputs "d3.v4.js"))
                     (target "d3.min.js"))
                 (format #t "Processing ~a --> ~a~%"
                         source target)
                 (invoke "esbuild" source "--minify"
                         (string-append "--outfile=" target)))))))))
    (propagated-inputs
     (list r-data-tree r-htmlwidgets))
    (native-inputs
     `(("esbuild" ,esbuild)
       ("d3.v4.js"
        ,(origin
           (method url-fetch)
           (uri "https://d3js.org/d3.v4.js")
           (sha256
            (base32
             "0y7byf6kcinfz9ac59jxc4v6kppdazmnyqfav0dm4h550fzfqqlg"))))
       ("r-colorspace" ,r-colorspace)
       ("r-testthat" ,r-testthat)
       ("r-tibble" ,r-tibble)))
    (home-page "https://github.com/AdeelK93/collapsibleTree")
    (synopsis "Interactive collapsible tree diagrams using D3.js")
    (description
     "This is a package for interactive Reingold-Tilford tree diagrams created
using D3.js, where every node can be expanded and collapsed by clicking on it.
Tooltips and color gradients can be mapped to nodes using a numeric column in
the source data frame.")
    (license license:gpl3+)))

(define-public r-rapiclient
  (package
    (name "r-rapiclient")
    (version "0.1.8")
    (source (origin
              (method url-fetch)
              (uri (cran-uri "rapiclient" version))
              (sha256
               (base32
                "1alzkcvzaj3vr2qd8v4yw1pfg3vfvn3lvjcivsdxkwljvrv67v8w"))))
    (properties `((upstream-name . "rapiclient")))
    (build-system r-build-system)
    (propagated-inputs
     (list r-httr r-jsonlite r-yaml))
    (native-inputs (list r-testthat))
    (home-page "https://github.com/bergant/rapiclient")
    (synopsis "Dynamic OpenAPI/Swagger client")
    (description
     "This package lets you access services specified in OpenAPI (formerly
Swagger) format.  It is not a code generator.  The client is generated
dynamically as a list of R functions.")
    (license license:expat)))

(define-public r-rappdirs
  (package
    (name "r-rappdirs")
    (version "0.3.3")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "rappdirs" version))
       (sha256
        (base32
         "1161i3jgjvzjv4p8qbz9r976fnggkcrw3mlj4yd1h2svnijrz5a9"))))
    (build-system r-build-system)
    (native-inputs (list r-testthat))
    (home-page "https://cran.r-project.org/web/packages/rappdirs/")
    (synopsis "Determine where to save data, caches, and logs")
    (description
     "This package provides an easy way to determine which directories on the
user's computer should be used to save data, caches and logs.  It is a port of
Python's @url{https://github.com/ActiveState/appdirs,Appdirs} to R.")
    (license license:expat)))

(define-public r-rastervis
  (package
    (name "r-rastervis")
    (version "0.51.6")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "rasterVis" version))
       (sha256
        (base32
         "12cl201gwah0bn14ji4nbygayd77w5fck9zkcikhrda5s0chvgb1"))))
    (properties `((upstream-name . "rasterVis")))
    (build-system r-build-system)
    (propagated-inputs
     (list r-hexbin
           r-lattice
           r-latticeextra
           r-raster
           r-rcolorbrewer
           r-sp
           r-terra
           r-viridislite
           r-zoo))
    (home-page "https://oscarperpinan.github.io/rastervis/")
    (synopsis "Visualization methods for raster data")
    (description
     "This package provides methods for enhanced visualization and interaction
with raster data.  It implements visualization methods for quantitative data
and categorical data, both for univariate and multivariate rasters.  It also
provides methods to display spatiotemporal rasters, and vector fields.")
    (license license:gpl3)))

(define-public r-rentrez
  (package
    (name "r-rentrez")
    (version "1.2.3")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "rentrez" version))
       (sha256
        (base32
         "0x1g2f6hvkqqlb39z8m5qxhcvsizddic5i7rpqw0wy77xfbna9gv"))))
    (properties `((upstream-name . "rentrez")))
    (build-system r-build-system)
    (propagated-inputs
     (list r-httr r-jsonlite r-xml))
    (native-inputs
     (list r-knitr r-testthat))
    (home-page "https://docs.ropensci.org/rentrez/")
    (synopsis "Entrez in R")
    (description
     "This package provides an R interface to the NCBI's EUtils API,
allowing users to search databases like GenBank PubMed, process the results of
those searches and pull data into their R sessions.")
    (license license:expat)))

(define-public r-renv
  (package
    (name "r-renv")
    (version "1.1.4")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "renv" version))
       (sha256
        (base32
         "1lwhcdjqqnv78cw88g3qvdmz89w5i0ll4z2rricikvbfsnmgw778"))))
    (properties `((upstream-name . "renv")))
    (build-system r-build-system)
    ;; Tests attempt to install packages.
    (arguments (list #:tests? #false))
    ;; Since we are not running the tests, we don't need any of the many, many
    ;; test inputs.
    (native-inputs (list r-knitr))
    (home-page "https://rstudio.github.io/renv")
    (synopsis "Project environments")
    (description
     "This package provides a dependency management toolkit for R.  Using
renv, you can create and manage project-local R libraries, save the state of
these libraries to a lockfile, and later restore your library as required.
Together, these tools can help make your projects more isolated, portable, and
reproducible.")
    (license license:expat)))

;; TODO: esbuild
(define-public r-learnr
  (package
    (name "r-learnr")
    (version "0.11.5")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "learnr" version))
       (sha256
        (base32
         "01xig6ijsjnkwdjh03zdp86mqm5pjlqp9br34pn644rf98qg8k2y"))))
    (build-system r-build-system)
    ;; Tests need shinytest2.
    (arguments (list #:tests? #false))
    (native-inputs (list esbuild r-knitr r-testthat))
    (propagated-inputs
     (list r-checkmate
           r-digest
           r-ellipsis
           r-evaluate
           r-htmltools
           r-htmlwidgets
           r-jsonlite
           r-knitr
           r-lifecycle
           r-markdown
           r-promises
           r-rappdirs
           r-renv
           r-rlang
           r-rmarkdown
           r-rprojroot
           r-shiny
           r-withr))
    (home-page "https://rstudio.github.io/learnr/")
    (synopsis "Interactive tutorials for R")
    (description
     "This package provides tools to create interactive tutorials using R
Markdown.  Use a combination of narrative, figures, videos, exercises, and
quizzes to create self-paced tutorials for learning about R and R packages.")
    (license license:asl2.0)))

(define-public r-analytics
  (package
    (name "r-analytics")
    (version "3.0")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "analytics" version))
       (sha256
        (base32
         "0js3c8lwj3knccb55nq03cbjlf4w390p9aid2mi5x80l3ayd9in1"))))
    (build-system r-build-system)
    (propagated-inputs
     (list r-car
           r-cluster
           r-fractal
           r-lmtest
           r-mass
           r-np
           r-powerplus
           r-robust
           r-trend
           r-tsa
           r-urca
           r-vim))
    (home-page "https://cran.r-project.org/web/packages/analytics/")
    (synopsis "Collection of data analysis tools")
    (description
     "This package is a collection of data analysis tools.  It includes tools
for regression outlier detection in a fitted linear model, stationary
bootstrap using a truncated geometric distribution, a comprehensive test for
weak stationarity, column means by group, weighted biplots, and a heuristic to
obtain a better initial configuration in non-metric MDS.")
    (license license:gpl2)))

(define-public r-here
  (package
    (name "r-here")
    (version "1.0.1")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "here" version))
       (sha256
        (base32 "0srlr8h8qmr0wrmp7gs4g2ry5dni2hx8n947bik3s3a26f091v88"))))
    (properties `((upstream-name . "here")))
    (build-system r-build-system)
    (propagated-inputs (list r-rprojroot))
    (native-inputs (list r-knitr r-testthat))
    (home-page "https://here.r-lib.org/")
    (synopsis "Simpler way to find files")
    (description
     "This package lets you construct paths to your project's files.  Use the
@code{here} function as a drop-in replacement for @code{file.path}, it will
always locate the files relative to your project root.")
    (license license:expat)))

(define-public r-reticulate
  (package
    (name "r-reticulate")
    (version "1.42.0")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "reticulate" version))
       (sha256
        (base32
         "0d3xd8gk7zkcbfypmd5d1kcavcada0asvgccb27a1pghgqxw18kr"))))
    (build-system r-build-system)
    (arguments
     (list
      #:phases
      '(modify-phases %standard-phases
         (add-after 'unpack 'build-reproducibly
           (lambda _
             (setenv "PYTHONHASHSEED" "0")
             (setenv "PYTHONDONTWRITEBYTECODE" "1"))))))
    (inputs (list python))
    (propagated-inputs
     (list r-here
           r-jsonlite
           r-matrix
           r-png
           r-rappdirs
           r-rcpp
           r-rcpptoml
           r-rlang
           r-withr))
    (native-inputs
     (list r-callr
           r-glue
           r-knitr
           r-ps
           r-rmarkdown
           r-testthat))
    (home-page "https://github.com/rstudio/reticulate")
    (synopsis "R interface to Python")
    (description
     "This package provides an interface from R to Python modules, classes,
and functions.  When calling into Python, R data types are automatically
converted to their equivalent Python types.  When values are returned from
Python to R they are converted back to R types.")
    (license license:asl2.0)))

(define-public r-bibtex
  (package
    (name "r-bibtex")
    (version "0.5.1")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "bibtex" version))
       (sha256
        (base32
         "1l9y945qmpla68rx6dnaxc83vmvkw26cw4zzfgfsvi36wsja1hgk"))))
    (build-system r-build-system)
    (propagated-inputs (list r-backports))
    (native-inputs (list r-testthat))
    (home-page "https://github.com/romainfrancois/bibtex")
    (synopsis "Bibtex parser")
    (description "This package provides a utility for R to parse a bibtex
file.")
    (license license:gpl2+)))

(define-public r-billboarder
  (package
    (name "r-billboarder")
    (version "0.5.0")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "billboarder" version))
       (sha256
        (base32 "07piczkr5chsxrpkmqx533nxjaw0sgrqzd7xs2779jk8184vr36a"))
       (snippet
        '(delete-file "inst/htmlwidgets/lib/billboard/billboard.pkgd.min.js"))))
    (properties `((upstream-name . "billboarder")))
    (build-system r-build-system)
    (arguments
     (list
      #:modules '((guix build r-build-system)
                  (guix build minify-build-system)
                  (guix build utils)
                  (ice-9 match))
      #:imported-modules `(,@%r-build-system-modules
                           (guix build minify-build-system))
      #:phases
      '(modify-phases (@ (guix build r-build-system) %standard-phases)
         (add-after 'unpack 'process-javascript
           (lambda* (#:key inputs #:allow-other-keys)
             (with-directory-excursion "inst/htmlwidgets/lib/billboard/"
               (let ((source (assoc-ref inputs "js-billboard"))
                     (target "billboard.pkgd.min.js"))
                 (minify source #:target target))))))))
    (propagated-inputs
     (list r-ggplot2
           r-htmltools
           r-htmlwidgets
           r-jsonlite
           r-magrittr
           r-rlang
           r-scales
           r-shiny))
    (native-inputs
     `(("r-knitr" ,r-knitr)
       ("r-testthat" ,r-testthat)
       ("esbuild" ,esbuild)
       ;; It is not ideal to use this concatenated (but not minified)
       ;; JavaScript file, as the original source is written in TypeScript.
       ;; However, this can still be considered source code as it is readable
       ;; and can be modified.
       ("js-billboard"
        ,(origin
           (method url-fetch)
           (uri "https://unpkg.com/billboard.js@3.13.0/dist/billboard.js")
           (sha256
            (base32
             "0s1lcmsgcb6yjzz1k03rz2ga3hz9i3i442q30bv4p6z8dagd1akx"))))))
    (home-page "https://github.com/dreamRs/billboarder")
    (synopsis "Create interactive charts with the JavaScript Billboard library")
    (description
     "This package provides an @code{htmlwidgets} interface to billboard.js,
a re-usable easy interface JavaScript chart library, based on D3 v4+.  Chart
types include line charts, scatterplots, bar/lollipop charts,
histogram/density plots, pie/donut charts and gauge charts.  All charts are
interactive, and a proxy method is implemented to smoothly update a chart
without rendering it again in shiny apps.")
    (license license:expat)))

(define-public r-ggseqlogo
  (package
    (name "r-ggseqlogo")
    (version "0.2")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "ggseqlogo" version))
       (sha256
        (base32
         "1drncw73950dzjx3lyyfqrxm3rdbrp44n27sl4b17m9d0crdbgqw"))))
    (build-system r-build-system)
    (propagated-inputs (list r-ggplot2))
    (native-inputs (list r-knitr))
    (home-page "https://github.com/omarwagih/ggseqlogo")
    (synopsis "ggplot2 extension for drawing genetic sequence logos")
    (description
     "The range of functions provided by this package makes it possible to
draw highly versatile genomic sequence logos.  Features include, but are not
limited to, modifying colour schemes and fonts used to draw the logo,
generating multiple logo plots, and aiding the visualisation with annotations.
Sequence logos can easily be combined with other ggplot2 plots.")
    ;; Unspecified version of the LGPL.
    (license license:lgpl3+)))

(define-public r-ggsci
  (package
    (name "r-ggsci")
    (version "3.2.0")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "ggsci" version))
       (sha256
        (base32
         "0jiwkk2ij1qnsaqr6354wihj057ia1arrfpjpll00x63056fvn21"))))
    (build-system r-build-system)
    (propagated-inputs
     (list r-ggplot2 r-scales))
    (native-inputs (list r-knitr))
    (home-page "https://nanx.me/ggsci/")
    (synopsis "Scientific journal and sci-fi themed color palettes for ggplot2")
    (description
     "This package provides a collection of ggplot2 color palettes inspired by
plots in scientific journals, data visualization libraries, science fiction
movies, and TV shows.")
    (license license:gpl3)))

(define-public r-ggsignif
  (package
    (name "r-ggsignif")
    (version "0.6.4")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "ggsignif" version))
       (sha256
        (base32
         "02mjailzyqkdnzky60dgampw2sq6mnn7s66fk0lhy32s8apm280i"))))
    (build-system r-build-system)
    (native-inputs
     (list r-knitr r-testthat))
    (propagated-inputs
     (list r-ggplot2))
    (home-page "https://github.com/const-ae/ggsignif")
    (synopsis "Significance brackets for ggplot2")
    (description
     "Enrich your ggplots with group-wise comparisons.  This package provides
an easy way to indicate if two groups are significantly different.  Commonly
this is shown by a bracket on top connecting the groups of interest which
itself is annotated with the level of significance.  The package provides a
single layer that takes the groups for comparison and the test as arguments
and adds the annotation to the plot.")
    (license license:gpl3)))

(define-public r-rstatix
  (package
    (name "r-rstatix")
    (version "0.7.2")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "rstatix" version))
       (sha256
        (base32
         "1891a976k2qjrh1vkzfg8icxblxa978wbazg7mqq8pcw3nmzbip0"))))
    (properties
     '((upstream-name . "rstatix")
       (updater-extra-native-inputs . ("r-emmeans"))))
    (build-system r-build-system)
    (propagated-inputs
     (list r-broom
           r-car
           r-corrplot
           r-dplyr
           r-generics
           r-magrittr
           r-purrr
           r-rlang
           r-tibble
           r-tidyr
           r-tidyselect))
    (native-inputs (list r-emmeans r-testthat))
    (home-page "https://rpkgs.datanovia.com/rstatix/")
    (synopsis "Pipe-friendly framework for basic statistical tests")
    (description
     "This package provides a simple and intuitive pipe-friendly framework,
coherent with the @code{tidyverse} design philosophy, for performing basic
statistical tests, including t-test, Wilcoxon test, ANOVA, Kruskal-Wallis and
correlation analyses.  The output of each test is automatically transformed
into a tidy data frame to facilitate visualization.  Additional functions are
available for reshaping, reordering, manipulating and visualizing correlation
matrix.")
    (license license:gpl2)))

(define-public r-ggpubr
  (package
    (name "r-ggpubr")
    (version "0.6.0")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "ggpubr" version))
       (sha256
        (base32
         "0x7p3lbh0xv5qk0shsrj1fjx382zak7mj8l3z1zd348r2pccavif"))))
    (build-system r-build-system)
    (propagated-inputs
     (list r-cowplot
           r-dplyr
           r-ggplot2
           r-ggrepel
           r-ggsci
           r-ggsignif
           r-glue
           r-gridextra
           r-magrittr
           r-polynom
           r-purrr
           r-rlang
           r-rstatix
           r-scales
           r-tibble
           r-tidyr))
    (native-inputs (list r-testthat))
    (home-page "http://www.sthda.com/english/rpkgs/ggpubr")
    (synopsis "ggplot2-based publication-ready plots")
    (description
     "The ggplot2 package is an excellent and flexible package for elegant
data visualization in R.  However the default generated plots require some
formatting before we can send them for publication.  The ggpubr package
provides some easy-to-use functions for creating and customizing ggplot2-based
publication-ready plots.")
    (license license:gpl2)))

(define-public r-ellipse
  (package
    (name "r-ellipse")
    (version "0.5.0")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "ellipse" version))
       (sha256
        (base32
         "1wy25kw3055zxzidzzkif6c8bmch73qkv2ri4i1w0b6ffcwmbs6d"))))
    (build-system r-build-system)
    (home-page "https://cran.r-project.org/web/packages/ellipse/")
    (synopsis "Functions for drawing ellipses and ellipse-like confidence regions")
    (description
     "This package contains various routines for drawing ellipses and
ellipse-like confidence regions, implementing the plots described in Murdoch
and Chow (1996), A graphical display of large correlation matrices, The
American Statistician 50, 178-180.  There are also routines implementing the
profile plots described in Bates and Watts (1988), Nonlinear Regression
Analysis and its Applications.")
    (license license:gpl2+)))

(define-public r-flashclust
  (package
    (name "r-flashclust")
    (version "1.01-2")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "flashClust" version))
       (sha256
        (base32
         "0l4lpz451ll7f7lfxmb7ds24ppzhfg1c3ypvydglcc35p2dq99s8"))))
    (properties `((upstream-name . "flashClust")))
    (build-system r-build-system)
    (native-inputs (list gfortran))
    (home-page "https://cran.r-project.org/web/packages/flashClust/")
    (synopsis "Implementation of optimal hierarchical clustering")
    (description
     "This package provides a fast implementation of hierarchical
clustering.")
    (license license:gpl2+)))

(define-public r-factominer
  (package
    (name "r-factominer")
    (version "2.11")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "FactoMineR" version))
       (sha256
        (base32
         "0qzhfjcz0kahqf214g4xs7gfpqx05xbfiwa5r2ldgn2drd16phij"))))
    (properties `((upstream-name . "FactoMineR")))
    (build-system r-build-system)
    (propagated-inputs
     (list r-car
           r-cluster
           r-dt
           r-ellipse
           r-emmeans
           r-flashclust
           r-ggplot2
           r-ggrepel
           r-lattice
           r-leaps
           r-mass
           r-multcompview
           r-scatterplot3d))
    (native-inputs
     (list r-knitr))
    (home-page "http://factominer.free.fr")
    (synopsis "Multivariate exploratory data analysis and data mining")
    (description
     "This package provides exploratory data analysis methods to summarize,
visualize and describe datasets.  The main principal component methods are
available, those with the largest potential in terms of applications:
principal component analysis (PCA) when variables are quantitative,
correspondence analysis (CA) and multiple correspondence analysis (MCA) when
variables are categorical, Multiple Factor Analysis when variables are
structured in groups, etc. and hierarchical cluster analysis.")
    (license license:gpl2+)))

(define-public r-factoextra
  (package
    (name "r-factoextra")
    (version "1.0.7")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "factoextra" version))
       (sha256
        (base32
         "1allvdjhd3pq8xz30b1cymwcik5iaahghrjrlnn54cwkfhfg0kv2"))))
    (build-system r-build-system)
    (propagated-inputs
     (list r-abind
           r-cluster
           r-dendextend
           r-factominer
           r-ggplot2
           r-ggpubr
           r-ggrepel
           r-reshape2
           r-tidyr))
    (home-page "http://www.sthda.com/english/rpkgs/factoextra")
    (synopsis "Extract and visualize the results of multivariate data analyses")
    (description
     "This package provides some easy-to-use functions to extract and
visualize the output of multivariate data analyses, including
@code{PCA} (Principal Component Analysis), @code{CA} (Correspondence
Analysis), @code{MCA} (Multiple Correspondence Analysis), @code{FAMD} (Factor
Analysis of Mixed Data), @code{MFA} (Multiple Factor Analysis) and
@code{HMFA} (Hierarchical Multiple Factor Analysis) functions from different R
packages.  It contains also functions for simplifying some clustering analysis
steps and provides ggplot2-based elegant data visualization.")
    (license license:gpl2)))

(define-public r-fancova
  (package
    (name "r-fancova")
    (version "0.6-1")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "fANCOVA" version))
       (sha256
        (base32 "04mw0blgpwdk6wdg8llrig43psgc0vb42cbimvzbnym8v503dsn3"))))
    (properties `((upstream-name . "fANCOVA")))
    (build-system r-build-system)
    (home-page "https://cran.r-project.org/package=fANCOVA")
    (synopsis "Nonparametric analysis of covariance")
    (description
     "This package provides a collection of R functions to perform
nonparametric analysis of covariance for regression curves or surfaces.
Testing the equality or parallelism of nonparametric curves or surfaces is
equivalent to analysis of variance (ANOVA) or analysis of covariance (ANCOVA)
for one-sample functional data.  Three different testing methods are available
in the package, including one based on L-2 distance, one based on an ANOVA
statistic, and one based on variance estimators.")
    (license license:gpl3)))

(define-public r-fansi
  (package
    (name "r-fansi")
    (version "1.0.6")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "fansi" version))
       (sha256
        (base32
         "0qqq8gz6sfr5yib4qmvk458qa0ypaz0n7f2ygjnpy2p5vy8cd7ga"))))
    (build-system r-build-system)
    (native-inputs
     (list r-knitr)) ; for vignettes
    (home-page "https://github.com/brodieG/fansi")
    (synopsis "ANSI control sequence aware string functions")
    (description
     "This package provides counterparts to R string manipulation functions
that account for the effects of ANSI text formatting control sequences.")
    (license license:gpl2+)))

(define-public r-nbclust
  (package
    (name "r-nbclust")
    (version "3.0.1")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "NbClust" version))
       (sha256
        (base32
         "0k5hr4zgx4gp1n62xchgz2zvyl35ba2cnczhhvj8rfbg2n4hx6qs"))))
    (properties `((upstream-name . "NbClust")))
    (build-system r-build-system)
    (home-page "https://sites.google.com/site/malikacharrad/research/nbclust-package")
    (synopsis "Determine the best number of clusters in a data set")
    (description
     "NbClust provides 30 indexes for determining the optimal number of
clusters in a data set and offers the best clustering scheme from different
results to the user.")
    (license license:gpl2)))

(define-public r-hdf5r
  (package
    (name "r-hdf5r")
    (version "1.3.12")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "hdf5r" version))
       (sha256
        (base32
         "0r7z2gf6406f88s9ipsp2x1kf3ia3ksbprri7sn1dx9pd2v3drz2"))))
    (build-system r-build-system)
    (inputs
     (list hdf5 zlib))
    (propagated-inputs
     (list r-bit64 r-r6))
    (native-inputs
     (list pkg-config r-knitr r-testthat))
    (home-page "https://hhoeflin.github.io/hdf5r")
    (synopsis "Interface to the HDF5 binary data format")
    (description
     "HDF5 is a data model, library and file format for storing and managing
large amounts of data.  This package provides a nearly feature complete,
object oriented wrapper for the HDF5 API using R6 classes.  Additionally,
functionality is added so that HDF5 objects behave very similar to their
corresponding R counterparts.")
    (license license:asl2.0)))

(define-public r-itertools
  (package
    (name "r-itertools")
    (version "0.1-3")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "itertools" version))
       (sha256
        (base32
         "1ls5biiva10pb1dj3ph4griykb9vam02hkrdmlr5a5wf660hg6xn"))))
    (build-system r-build-system)
    (propagated-inputs
     (list r-iterators))
    (home-page "https://cran.r-project.org/web/packages/itertools/")
    (synopsis "Iterator tools")
    (description
     "This package provides various tools for creating iterators, many
patterned after functions in the Python @code{itertools} module, and others
patterned after functions in the snow package.")
    (license license:gpl2)))

(define-public r-itsadug
  (package
    (name "r-itsadug")
    (version "2.4.1")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "itsadug" version))
       (sha256
        (base32 "1sdqs279qxr3993hw08xg7b54yq03jw1597cqn6cf24sh9vpw9m1"))))
    (properties `((upstream-name . "itsadug")))
    (build-system r-build-system)
    (propagated-inputs (list r-mgcv r-plotfunctions))
    (native-inputs (list r-knitr))
    (home-page "https://cran.r-project.org/package=itsadug")
    (synopsis "Interpreting time series and autocorrelated data using GAMMs")
    (description
     "@dfn{Generalized Additive Mixed Modeling} (GAMM; Lin & Zhang, 1999) as
implemented in the R package @code{mgcv} is a nonlinear regression analysis
which is particularly useful for time course data such as EEG, pupil dilation,
gaze data (eye tracking), and articulography recordings, but also for
behavioral data such as reaction times and response data.  As time course
measures are sensitive to autocorrelation problems, GAMMs implements methods
to reduce the autocorrelation problems.  This package includes functions for
the evaluation of GAMM models (e.g., model comparisons, determining regions of
significance, inspection of autocorrelational structure in residuals) and
interpreting of GAMMs (e.g., visualization of complex interactions, and
contrasts).")
    (license license:gpl2+)))

(define-public r-polynom
  (package
    (name "r-polynom")
    (version "1.4-1")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "polynom" version))
       (sha256
        (base32
         "0y4j07syjwpnq5w6a1d90z6h1hjzijmm42pq0f8jk2vcn5xxn7mw"))))
    (build-system r-build-system)
    (native-inputs (list r-knitr))
    (home-page "https://cran.r-project.org/web/packages/polynom/")
    (synopsis "Functions for univariate polynomial manipulations")
    (description
     "This package provides a collection of functions to implement a class for
univariate polynomial manipulations.")
    (license license:gpl2)))

(define-public r-pupillometryr
  (package
    (name "r-pupillometryr")
    (version "0.0.5")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "PupillometryR" version))
       (sha256
        (base32 "0jqpx5g0fjdxxp7wlgv4jm5vrhchm6r21qd7i825fi5552c46awv"))))
    (properties `((upstream-name . "PupillometryR")))
    (build-system r-build-system)
    (propagated-inputs
     (list r-dplyr
           r-fda
           r-ggplot2
           r-itsadug
           r-mgcv
           r-rlang
           r-signal
           r-stringr
           r-tidyr
           r-zoo))
    (native-inputs (list r-knitr))
    (home-page "https://cran.r-project.org/package=PupillometryR")
    (synopsis "Unified pipeline for pupillometry data")
    (description
     "This package provides a unified pipeline to clean, prepare, plot, and
run basic analyses on pupillometry experiments.")
    (license license:expat)))

(define-public r-gbrd
  (package
    (name "r-gbrd")
    (version "0.4.12")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "gbRd" version))
       (sha256
        (base32
         "0f13hg6nckl4aflwd49g4x2adxjfgah2yga70z1m8jszhhm1vka8"))))
    (properties `((upstream-name . "gbRd")))
    (build-system r-build-system)
    (home-page "https://cran.r-project.org/web/packages/gbRd/")
    (synopsis "Utilities for processing Rd objects and files")
    (description
     "This package provides utilities for processing Rd objects and files.
Extract argument descriptions and other parts of the help pages of
functions.")
    (license license:gpl2+)))

(define-public r-rjags
  (package
    (name "r-rjags")
    (version "4-17")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "rjags" version))
       (sha256
        (base32
         "0d23zzdgm0ihb8lv01wraq3b98gl9fm5jbxhp0jqpk8sgv5ff4g9"))))
    (properties
     '((updater-extra-inputs . ("jags"))))
    (build-system r-build-system)
    (propagated-inputs
     (list r-coda))
    (inputs
     (list jags))
    (native-inputs
     (list pkg-config))
    (home-page "https://mcmc-jags.sourceforge.net")
    (synopsis "Bayesian graphical models using MCMC")
    (description
     "This package provides an R interface to the JAGS MCMC library.  JAGS is
Just Another Gibbs Sampler.  It is a program for analysis of Bayesian
hierarchical models using Markov Chain Monte Carlo (MCMC) simulation.")
    (license license:gpl2)))

(define-public r-rbibutils
  (package
    (name "r-rbibutils")
    (version "2.3")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "rbibutils" version))
       (sha256
        (base32
         "0zvpa39d6a9ibaqnz6na0nm7ybmhmshr5s4vdndsmgcv45iasd8c"))))
    (properties `((upstream-name . "rbibutils")))
    (build-system r-build-system)
    (native-inputs (list r-testthat))
    (home-page "https://geobosh.github.io/rbibutils/")
    (synopsis "Convert between bibliography formats")
    (description
     "This package converts between a number of bibliography formats,
including BibTeX, BibLaTeX and Bibentry.  It includes a port of the bibutils
utilities and supports all bibliography formats and character encodings
implemented in bibutils.")
    (license license:gpl2)))

(define-public r-rbiom
  (package
    (name "r-rbiom")
    (version "2.2.0")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "rbiom" version))
       (sha256
        (base32 "1p7lh6ni8m9khwnp3iyzgdznyl09ckfyl84q4410p0lc5iqg21bh"))))
    (properties
     '((upstream-name . "rbiom")
       (updater-extra-native-inputs . ("r-testthat"))))
    (build-system r-build-system)
    (propagated-inputs (list r-ape
                             r-dplyr
                             r-emmeans
                             r-fillpattern
                             r-ggbeeswarm
                             r-ggnewscale
                             r-ggplot2
                             r-ggrepel
                             r-ggtext
                             r-jsonlite
                             r-magrittr
                             r-mgcv
                             r-parallelly
                             r-patchwork
                             r-pillar
                             r-plyr
                             r-readr
                             r-readxl
                             r-slam
                             r-vegan))
    (native-inputs (list r-testthat))
    (home-page "https://cmmr.github.io/rbiom/index.html")
    (synopsis "Read/write, transform, and summarize BIOM data")
    (description
     "This package provides a toolkit for working with @dfn{Biological
Observation Matrix} (BIOM) files.  Features include reading/writing all BIOM
formats, rarefaction, alpha diversity, beta diversity (including UniFrac),
summarizing counts by taxonomic level, and sample subsetting.  Standalone
functions for reading, writing, and subsetting phylogenetic trees are also
provided.")
    (license license:agpl3)))

(define-public r-rdpack
  (package
    (name "r-rdpack")
    (version "2.6.4")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "Rdpack" version))
       (sha256
        (base32
         "04wmy10iykmvfpmlysh4dfh5khsddl4pv2g1y30xbssysizn8l81"))))
    (properties `((upstream-name . "Rdpack")))
    (build-system r-build-system)
    ;; FIXME It's unclear why the tests fail.
    (arguments (list #:tests? #false))
    (propagated-inputs
     (list r-rbibutils))
    (native-inputs (list r-devtools r-gbrd r-testthat r-waldo))
    (home-page "https://github.com/GeoBosh/Rdpack")
    (synopsis "Update and manipulate Rd documentation objects")
    (description
     "This package provides functions for manipulation of R documentation
objects, including functions @code{reprompt()} and @code{ereprompt()} for
updating Rd documentation for functions, methods and classes; it also includes
Rd macros for citations and import of references from bibtex files for use in
Rd files and roxygen2 comments, as well as many functions for manipulation of
references and Rd files.")
    (license license:gpl2+)))

(define-public r-officer
  (package
    (name "r-officer")
    (version "0.6.10")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "officer" version))
       (sha256
        (base32
         "0xqcgb7jzxggrvmh4zab67lhg938c46j0rlxhy7k66ldkkxs03l8"))))
    (properties
     '((updater-extra-native-inputs . ("r-magick"))))
    (build-system r-build-system)
    (arguments
     (list
      #:phases
      '(modify-phases %standard-phases
         ;; Needed for saving ~/dump.RDS during tests.
         (add-after 'unpack 'set-HOME
           (lambda _ (setenv "HOME" "/tmp"))))))
    (propagated-inputs
     (list r-cli
           r-openssl
           r-r6
           r-ragg
           r-uuid
           r-xml2
           r-zip))
    (native-inputs (list r-gdtools
                         r-ggplot2
                         r-knitr
                         r-magick
                         r-rmarkdown
                         r-testthat
                         r-withr))
    (home-page "https://davidgohel.github.io/officer")
    (synopsis "Manipulation of Word and PowerPoint documents")
    (description
     "This package provides tools to access and manipulate Word and PowerPoint
documents from R.  The package focuses on tabular and graphical reporting from
R; it also provides two functions that let users get document content into
data objects.  A set of functions lets add and remove images, tables and
paragraphs of text in new or existing documents.  When working with PowerPoint
presentations, slides can be added or removed; shapes inside slides can also
be added or removed.  When working with Word documents, a cursor can be used
to help insert or delete content at a specific location in the document.")
    (license license:gpl3)))

(define-public r-profilemodel
  (package
    (name "r-profilemodel")
    (version "0.6.1")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "profileModel" version))
       (sha256
        (base32
         "01m5nb8cmq0aq555pxk2a99182si65hhmn68yn9nal2j3zl2bp4i"))))
    (properties `((upstream-name . "profileModel")))
    (build-system r-build-system)
    (home-page "https://github.com/ikosmidis/profileModel")
    (synopsis "Profiling inference functions for various model classes")
    (description
     "This package provides tools that can be used to calculate, evaluate,
plot and use for inference the profiles of *arbitrary* inference functions for
arbitrary @code{glm}-like fitted models with linear predictors.  More information
on the methods that are implemented can be found in Kosmidis (2008)
@url{https://www.r-project.org/doc/Rnews/Rnews_2008-2.pdf}.")
    (license license:gpl2+)))

(define-public r-brglm
  (package
    (name "r-brglm")
    (version "0.7.2")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "brglm" version))
       (sha256
        (base32
         "08shcz0j1npdn7xkhsvlzs3z4rdwq3g4rk6a4xx8wirqw8n8s2an"))))
    (properties `((upstream-name . "brglm")))
    (build-system r-build-system)
    (propagated-inputs
     (list r-profilemodel))
    (home-page "https://github.com/ikosmidis/brglm")
    (synopsis "Bias reduction in binomial-response generalized linear models")
    (description
     "Fit generalized linear models with binomial responses using either an
adjusted-score approach to bias reduction or maximum penalized likelihood
where penalization is by Jeffreys invariant prior.  These procedures return
estimates with improved frequentist properties (bias, mean squared error) that
are always finite even in cases where the maximum likelihood estimates are
infinite (data separation).  Fitting takes place by fitting generalized linear
models on iteratively updated pseudo-data.  The interface is essentially the
same as @code{glm}.  More flexibility is provided by the fact that custom
pseudo-data representations can be specified and used for model fitting.
Functions are provided for the construction of confidence intervals for the
reduced-bias estimates.")
    (license license:gpl2+)))

(define-public r-entropy
  (package
    (name "r-entropy")
    (version "1.3.2")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "entropy" version))
       (sha256
        (base32
         "19bnml9dlm5pgfc37pl1pi377vxyjb3jzg4cjifc9c4rizg2l6lh"))))
    (properties `((upstream-name . "entropy")))
    (build-system r-build-system)
    (home-page "https://www.strimmerlab.org/software/entropy/")
    (synopsis "Estimation of entropy, mutual information and related quantities")
    (description
     "This package implements various estimators of entropy, such as the
shrinkage estimator by Hausser and Strimmer, the maximum likelihood and the
Millow-Madow estimator, various Bayesian estimators, and the Chao-Shen
estimator.  It also offers an R interface to the NSB estimator.  Furthermore,
it provides functions for estimating Kullback-Leibler divergence, chi-squared,
mutual information, and chi-squared statistic of independence.  In addition
there are functions for discretizing continuous random variables.")
    (license license:gpl3+)))

(define-public r-acd
  (package
    (name "r-acd")
    (version "1.5.3")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "ACD" version))
       (sha256
        (base32
         "1a67bi3hklq8nlc50r0qnyr4k7m9kpvijy8sqqpm54by5hsysfd6"))))
    (properties `((upstream-name . "ACD")))
    (build-system r-build-system)
    (home-page "https://cran.r-project.org/web/packages/ACD/")
    (synopsis "Categorical data analysis with complete or missing responses")
    (description
     "This package provides tools for categorical data analysis with complete
or missing responses.")
    (license license:gpl2+)))

(define-public r-acdm
  (package
    (name "r-acdm")
    (version "1.0.4.3")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "ACDm" version))
       (sha256
        (base32
         "0g89827az5mnllp6l71znbvwxzygb8nvnmsv6x052w2ajhd16v7v"))))
    (properties `((upstream-name . "ACDm")))
    (build-system r-build-system)
    (propagated-inputs
     (list r-dplyr r-ggplot2 r-plyr r-rsolnp r-zoo))
    (home-page "https://cran.r-project.org/web/packages/ACDm/")
    (synopsis "Tools for Autoregressive Conditional Duration Models")
    (description
     "ACDm is a package for Autoregressive Conditional Duration (ACD, Engle
and Russell, 1998) models.  It creates trade, price or volume durations from
transactions (tic) data, performs diurnal adjustments, fits various ACD models
and tests them.")
    (license license:gpl2+)))

(define-public r-overlap
  (package
    (name "r-overlap")
    (version "0.3.9")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "overlap" version))
       (sha256
        (base32
         "0x6mmd7gya17saph4dncl9dspfwc8achwcg5s5f92flwis76r7km"))))
    (build-system r-build-system)
    (propagated-inputs
     (list r-suntools))
    (home-page "https://cran.r-project.org/web/packages/overlap/")
    (synopsis "Estimates of coefficient of overlapping for animal activity patterns")
    (description
     "This package provides functions to fit kernel density functions to data
on temporal activity patterns of animals; estimate coefficients of overlapping
of densities for two species; and calculate bootstrap estimates of confidence
intervals.")
    (license license:gpl3+)))

(define-public r-snakecase
  (package
    (name "r-snakecase")
    (version "0.11.1")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "snakecase" version))
       (sha256
        (base32
         "0888fng8zwm2zmi7rap9hc2q2x2gnhz8gyr35wwjx93w6f8rfpra"))))
    (build-system r-build-system)
    (arguments
     (list
      #:phases
      '(modify-phases %standard-phases
         (add-after 'unpack 'disable-bad-tests
           ;; One test requires the unavailable r-purrrlyr.
           (lambda _ (delete-file "tests/testthat/test-to_any_case.R"))))))
    (propagated-inputs
     (list r-stringi r-stringr))
    (native-inputs (list r-knitr r-testthat r-tibble))
    (home-page "https://github.com/Tazinho/snakecase")
    (synopsis "Convert strings into any case")
    (description
     "This package provides a consistent, flexible and easy to use tool to
parse and convert strings into cases like snake or camel among others.")
    (license license:gpl3)))

(define-public r-prediction
  (package
    (name "r-prediction")
    (version "0.3.18")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "prediction" version))
       (sha256
        (base32
         "194p2zbypslkd7slnvqw2z456xxwfzjxd11dirhpffjcsizkgrnh"))))
    (build-system r-build-system)
    (propagated-inputs
     (list r-data-table))
    (native-inputs (list r-testthat))
    (home-page "https://github.com/leeper/prediction")
    (synopsis "Tidy, type-safe prediction methods")
    (description
     "This package provides the @code{prediction()} function, a type-safe
alternative to @code{predict()} that always returns a data frame.  The package
currently supports common model types (e.g., @code{\"lm\"}, @code{\"glm\"})
from the @code{stats} package, as well as numerous other model classes from
other add-on packages.")
    (license license:expat)))

(define-public r-prettygraphs
  (package
    (name "r-prettygraphs")
    (version "2.2.0")
    (source (origin
              (method url-fetch)
              (uri (cran-uri "prettyGraphs" version))
              (sha256
               (base32
                "0va69qqgbn8fxzlm5dkzmaqv1xq5zb1s79wv1f065p61akx0ma16"))))
    (properties `((upstream-name . "prettyGraphs")))
    (build-system r-build-system)
    (home-page "https://cran.r-project.org/package=prettyGraphs")
    (synopsis "Publication-quality graphics")
    (description
     "This package provides simple and crisp publication-quality graphics for
the ExPosition family of packages.  See An ExPosition of the Singular Value
Decomposition in R (Beaton et al 2014) <doi:10.1016/j.csda.2013.11.006>.")
    (license license:gpl2)))

(define-public r-insight
  (package
    (name "r-insight")
    (version "1.3.0")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "insight" version))
       (sha256
        (base32
         "19d8wglqlasm6kbgsgyg5a7q7lz5qc3g77hsyclivcidaq1108x2"))))
    (build-system r-build-system)
    (arguments
     (list #:phases
           '(modify-phases %standard-phases
              (add-after 'unpack 'disable-bad-tests
                (lambda _
                  ;; This single test fails.
                  (delete-file "tests/testthat/test-find_formula.R"))))))
    ;; Note: this package has *lots* of test-time dependencies.  Hundreds of
    ;; tests will happily pass without them, and those tests needing these
    ;; inputs are skipped automatically.  There is no need to add them.
    (native-inputs
     (list r-knitr r-testthat))
    (home-page "https://easystats.github.io/insight/")
    (synopsis "Easy access to model information for various model objects")
    (description
     "This package provides a tool to provide an easy, intuitive and
consistent access to information contained in various R models, like model
formulas, model terms, information about random effects, data that was used to
fit the model or data from response variables.  The package mainly revolves
around two types of functions: Functions that find (the names of) information,
starting with @code{find_}, and functions that get the underlying data,
starting with @code{get_}.  The package has a consistent syntax and works with
many different model objects, where otherwise functions to access these
information are missing.")
    (license license:gpl3)))

(define-public r-sjlabelled
  (package
    (name "r-sjlabelled")
    (version "1.2.0")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "sjlabelled" version))
       (sha256
        (base32
         "1va86q5wddyvqgdpy8d0an2c7v1qbb4hpn0ai6y1v5v1ff87w73k"))))
    (properties
     '((updater-extra-native-inputs . ("r-haven"))))
    (build-system r-build-system)
    (propagated-inputs
     (list r-datawizard r-insight))
    (native-inputs
     (list r-haven r-knitr r-testthat))
    (home-page "https://github.com/strengejacke/sjlabelled")
    (synopsis "Labelled data utility functions")
    (description
     "This package provides a collection of functions dealing with labelled
data, like reading and writing data between R and other statistical software
packages.  This includes easy ways to get, set or change value and variable
label attributes, to convert labelled vectors into factors or numeric (and
vice versa), or to deal with multiple declared missing values.")
    (license license:gpl3)))

(define-public r-sjmisc
  (package
    (name "r-sjmisc")
    (version "2.8.10")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "sjmisc" version))
       (sha256
        (base32
         "12y5aa820h95dbak9zd2rbg1hc0636b2dpg0mn9mkb76a4ssnr1d"))))
    (build-system r-build-system)
    (propagated-inputs
     (list r-datawizard
           r-dplyr
           r-insight
           r-magrittr
           r-purrr
           r-rlang
           r-sjlabelled
           r-tidyselect))
    (native-inputs
     (list r-knitr r-testthat))
    (home-page "https://github.com/strengejacke/sjmisc")
    (synopsis "Data and variable transformation functions")
    (description
     "This package is a collection of miscellaneous utility functions,
supporting data transformation tasks like recoding, dichotomizing or grouping
variables, setting and replacing missing values.  The data transformation
functions also support labelled data, and all integrate seamlessly into a
tidyverse workflow.")
    (license license:gpl3)))

(define-public r-nodbi
  (package
    (name "r-nodbi")
    (version "0.12.0")
    (source (origin
              (method url-fetch)
              (uri (cran-uri "nodbi" version))
              (sha256
               (base32
                "0937scxibjd7l1pxf9x1a1b3l7dnfscv13mcs85xqr11y5apgbx2"))))
    (properties `((upstream-name . "nodbi")))
    (build-system r-build-system)
    (propagated-inputs
     (list r-dbi
           r-jqr
           r-jsonlite
           r-r-utils
           r-stringi
           r-uuid
           r-v8))
    (native-inputs (list r-callr
                         r-devtools
                         r-duckdb
                         r-knitr
                         r-rpostgres
                         r-rsqlite
                         r-testthat
                         r-webfakes
                         r-withr))
    (home-page "https://docs.ropensci.org/nodbi/")
    (synopsis "NoSQL database connector")
    (description
     "This is a package for simplified document database access and
manipulation, providing a common API across supported NoSQL databases
Elasticsearch, CouchDB, MongoDB as well as SQLite/JSON1, PostgreSQL, and
DuckDB.")
    (license license:expat)))

(define-public r-nortest
  (package
    (name "r-nortest")
    (version "1.0-4")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "nortest" version))
       (sha256
        (base32
         "17r0wpz72z9312c70nwi1i1kp1v9fm1h6jg7q5cx1mc1h420m1d3"))))
    (build-system r-build-system)
    (home-page "https://cran.r-project.org/web/packages/nortest/")
    (synopsis "Tests for normality")
    (description
     "This package provides five omnibus tests for testing the composite
hypothesis of normality.")
    (license license:gpl2+)))

(define-public r-moonbook
  (package
    (name "r-moonbook")
    (version "0.3.1")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "moonBook" version))
       (sha256
        (base32
         "1ml4vvm0mvrprpyi0l50aw38brx18bk2qny4gybmkvlbakalz9bx"))))
    (properties `((upstream-name . "moonBook")))
    (build-system r-build-system)
    (propagated-inputs
     (list r-crayon
           r-magrittr
           r-nortest
           r-sjmisc
           r-stringr
           r-survival))
    (native-inputs
     (list r-knitr r-testthat))
    (home-page "https://github.com/cardiomoon/moonBook")
    (synopsis "Functions and datasets for the book by Keon-Woong Moon")
    (description
     "This package provides several analysis-related functions for the book
entitled \"R statistics and graph for medical articles\" (written in Korean),
version 1, by Keon-Woong Moon with Korean demographic data with several plot
functions.")
    (license license:gpl2)))

(define-public r-flextable
  (package
    (name "r-flextable")
    (version "0.9.8")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "flextable" version))
       (sha256
        (base32
         "0pvka77jg97w0fk309mpdb7qv9k3dbrzg08rq21p624c217y2wln"))))
    (properties
     '((updater-extra-native-inputs . ("r-broom"))))
    (build-system r-build-system)
    (arguments
     (list
      #:phases
      '(modify-phases %standard-phases
         (add-after 'unpack 'disable-bad-tests
           (lambda _
             ;; These all fail with: 'write_xml.xml_document(private$doc, file
             ;; = private$filename)`: Error closing file
             (substitute* "tests/testthat/test-as_flextable.R"
               ((".*grouped data structure.*" m)
                (string-append m "skip('skip');\n")))
             (substitute* "tests/testthat/test-link.R"
               ((".*URL are preserved in pptx.*" m)
                (string-append m "skip('skip');\n")))
             (substitute* "tests/testthat/test-pptx-tables.R"
               ((".*(row height is valid|location is correct).*" m)
                (string-append m "skip('skip');\n")))
             (substitute* "tests/testthat/test-rotations.R"
               ((".*pptx rotations.*" m)
                (string-append m "skip('skip');\n")))
             (substitute* "tests/testthat/test-styles.R"
               ((".*borders with office docs are sanitized.*" m)
                (string-append m "skip('skip');\n")))
             (substitute* "tests/testthat/test-text.R"
               ((".*pptx - string are html encoded.*" m)
                (string-append m "skip('skip');\n"))))))))
    (propagated-inputs
     (list r-data-table
           r-gdtools
           r-htmltools
           r-knitr
           r-officer
           r-ragg
           r-rlang
           r-rmarkdown
           r-uuid
           r-xml2))
    (native-inputs
     (list r-broom r-knitr r-testthat))
    (home-page "https://davidgohel.github.io/flextable")
    (synopsis "Functions for tabular reporting")
    (description
     "This package provides tools to create pretty tables for HTML documents
and other formats.  Functions are provided to let users create tables, modify
and format their content.  It extends the @code{officer} package and can be
used within R markdown documents when rendering to HTML and to Word
documents.")
    (license license:gpl3)))

(define-public r-writexl
  (package
    (name "r-writexl")
    (version "1.5.4")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "writexl" version))
       (sha256
        (base32
         "1lv0fr333scllranvqi1agv3c071qqiwvishbxw7ig92x8lllmyh"))))
    (build-system r-build-system)
    (inputs (list zlib))
    (native-inputs
     (list r-bit64
           r-nycflights13
           r-readxl
           r-spelling
           r-testthat))
    (home-page "https://github.com/ropensci/writexl")
    (synopsis "Export data frames to xlsx format")
    (description
     "This package provides a data frame to xlsx exporter based on
libxlsxwriter.")
    (license license:bsd-2)))

(define-public r-writexls
  (package
    (name "r-writexls")
    (version "6.8.0")
    (source (origin
              (method url-fetch)
              (uri (cran-uri "WriteXLS" version))
              (sha256
               (base32
                "1xh93xxwa6v8bbzbz6ddn0np5isir6z1dkw3cm84zdayh69bimhb"))))
    (properties `((upstream-name . "WriteXLS")))
    (build-system r-build-system)
    (inputs (list perl))
    (home-page "https://github.com/marcschwartz/WriteXLS")
    (synopsis "Create Excel 2003 (XLS) and Excel 2007 (XLSX) files")
    (description
     "This package provides a cross-platform Perl-based R function to create
Excel 2003 (XLS) and Excel 2007 (XLSX) files from one or more data frames.
Each data frame will be written to a separate named worksheet in the Excel
spreadsheet.  The worksheet name will be the name of the data frame it
contains or can be specified by the user.")
    (license license:gpl2+)))

(define-public r-wrs2
  (package
    (name "r-wrs2")
    (version "1.1-7")
    (source (origin
              (method url-fetch)
              (uri (cran-uri "WRS2" version))
              (sha256
               (base32
                "13z3blfvzjddlkixz9cgzni6p435ppjndifif096bic8zrx9f827"))))
    (properties `((upstream-name . "WRS2")))
    (build-system r-build-system)
    (propagated-inputs (list r-mass r-plyr r-reshape))
    (native-inputs (list r-colorspace r-ggally r-ggplot2 r-knitr r-mediation))
    (home-page "https://r-forge.r-project.org/projects/psychor/")
    (synopsis "Collection of robust statistical methods")
    (description
     "R-wrs2 offers a range of strong stats methods from Wilcox WRS functions.
It implements robust t-tests, both independent and dependent, robust ANOVA,
including designs with between-within subjects, quantile ANOVA, robust
correlation, robust mediation, and nonparametric ANCOVA models using robust
location measures.")
    (license license:gpl3)))

(define-public r-biasedurn
  (package
    (name "r-biasedurn")
    (version "2.0.12")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "BiasedUrn" version))
       (sha256
        (base32
         "14jpijms81pgl4zyqrhwwdfj0jmlmml21blspvin8lqw8fbbbcr9"))))
    (properties `((upstream-name . "BiasedUrn")))
    (build-system r-build-system)
    (home-page "https://cran.r-project.org/web/packages/BiasedUrn/")
    (synopsis "Biased Urn model distributions")
    (description
     "This package provides statistical models of biased sampling in the form
of univariate and multivariate noncentral hypergeometric distributions,
including Wallenius' noncentral hypergeometric distribution and Fisher's
noncentral hypergeometric distribution (also called extended hypergeometric
distribution).")
    (license license:gpl3)))

(define-public r-golem
  (package
    (name "r-golem")
    (version "0.5.1")
    (source (origin
              (method url-fetch)
              (uri (cran-uri "golem" version))
              (sha256
               (base32
                "079zjzqvslv8k9pj52xwdhk6a9a8sg0p9wc6s457lz0ircan9ml6"))))
    (properties `((upstream-name . "golem")))
    (build-system r-build-system)
    ;; The tests attempt to install packages and mess up the test environment.
    ;; We don't do that around here.
    (arguments (list #:tests? #false))
    (propagated-inputs
     (list r-attempt
           r-config
           r-here
           r-htmltools
           r-rlang
           r-shiny
           r-yaml))
    (native-inputs (list r-knitr))
    (home-page "https://github.com/ThinkR-open/golem")
    (synopsis "Framework for robust Shiny applications")
    (description
     "This package implements an opinionated framework for building a
production- ready Shiny application.  Golem contains a series of tools like
dependency management, version management, easy installation and deployment or
documentation management.")
    (license license:expat)))

(define-public r-goplot
  (package
    (name "r-goplot")
    (version "1.0.2")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "GOplot" version))
       (sha256
        (base32
         "1y8dv0kbzpr9za91njw0x233vx5d13vqml9hmpddcyi9s6va5nix"))))
    (properties `((upstream-name . "GOplot")))
    (build-system r-build-system)
    (propagated-inputs
     (list r-ggdendro r-ggplot2 r-gridextra r-rcolorbrewer))
    (home-page "https://github.com/wencke/wencke.github.io")
    (synopsis "Visualization of functional analysis data")
    (description
     "This package provides an implementation of multilayered visualizations
for enhanced graphical representation of functional analysis data.  It
combines and integrates omics data derived from expression and functional
annotation enrichment analyses.  Its plotting functions have been developed
with an hierarchical structure in mind: starting from a general overview to
identify the most enriched categories (modified bar plot, bubble plot) to a
more detailed one displaying different types of relevant information for the
molecules in a given set of categories (circle plot, chord plot, cluster plot,
Venn diagram, heatmap).")
    (license license:gpl2)))

(define-public r-getopt
  (package
    (name "r-getopt")
    (version "1.20.4")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "getopt" version))
       (sha256
        (base32
         "12qy48adnibfi9rpv5qd8k3hipbc4q85514dsz0xnhdsdnz6rlw7"))))
    (build-system r-build-system)
    (native-inputs (list r-testthat))
    (home-page "https://github.com/trevorld/getopt")
    (synopsis "Command-line option processor for R")
    (description
     "This package is designed to be used with Rscript to write shebang
scripts that accept short and long options.  Many users will prefer to
use the packages @code{optparse} or @code{argparse} which add extra
features like automatically generated help options and usage texts,
support for default values, positional argument support, etc.")
    (license license:gpl2+)))

(define-public r-findpython
  (package
    (name "r-findpython")
    (version "1.0.9")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "findpython" version))
       (sha256
        (base32
         "1jxp5hm9n3i8fl0204cpi194sp8js2m4wzkgqz7v3m6dvw65x8dn"))))
    (build-system r-build-system)
    (native-inputs (list r-testthat))
    (home-page "https://github.com/trevorld/findpython")
    (synopsis "Functions to find an acceptable Python binary")
    (description
     "This package was designed to find an acceptable Python binary that
matches version and feature constraints.")
    (license license:expat)))

;; This in not the same as "r-argparser"
(define-public r-argparse
  (package
    (name "r-argparse")
    (version "2.2.5")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "argparse" version))
       (sha256
        (base32
         "194y4ablll2cqnjsy5nga0pxqcnbxca1n9ww7pmq8404a7mskj2k"))))
    (build-system r-build-system)
    (inputs (list python))
    (propagated-inputs
     (list r-findpython r-jsonlite r-r6))
    (native-inputs
     (list r-knitr r-testthat))
    (home-page "https://github.com/trevorld/argparse")
    (synopsis "Command line optional and positional argument parser")
    (description
     "This package provides a command line parser to be used with Rscript to
write shebang scripts that gracefully accept positional and optional arguments
and automatically generate usage notices.")
    (license license:gpl2+)))

(define-public r-hash
  (package
    (name "r-hash")
    (version "2.2.6.3")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "hash" version))
       (sha256
        (base32
         "044ifii4gpinzi9vbv5aw0da956ccslxg34xmx24njf6x5dhn0wa"))))
    (build-system r-build-system)
    (native-inputs (list r-testthat))
    (home-page "https://cran.r-project.org/web/packages/hash/")
    (synopsis "Implementation of hash/associated arrays/dictionaries")
    (description
     "This package implements a data structure similar to hashes in Perl and
dictionaries in Python but with a purposefully R flavor.  For objects of
appreciable size, access using hashes outperforms native named lists and
vectors.")
    (license license:gpl2+)))

(define-public r-orddom
  (package
    (name "r-orddom")
    (version "3.1")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "orddom" version))
       (sha256
        (base32
         "165axs15fvwhrp89xd87l81q3h2qjll1vrwcsap645cwvb85nwsh"))))
    (build-system r-build-system)
    (propagated-inputs (list r-psych))
    (home-page "https://cran.r-project.org/web/packages/orddom/")
    (synopsis "Ordinal dominance statistics")
    (description
     "This package provides tools to compute ordinal, statistics and effect
sizes as an alternative to mean comparison: Cliff's delta or success rate
difference (SRD), Vargha and Delaney's A or the Area Under a Receiver
Operating Characteristic Curve (AUC), the discrete type of McGraw & Wong's
Common Language Effect Size (CLES) or Grissom & Kim's Probability of
Superiority (PS), and the Number needed to treat (NNT) effect size.  Moreover,
comparisons to Cohen's d are offered based on Huberty & Lowman's Percentage of
Group (Non-)Overlap considerations.")
    (license license:gpl2)))

(define-public r-deriv
  (package
    (name "r-deriv")
    (version "4.1.6")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "Deriv" version))
       (sha256
        (base32
         "0wmslhggdhamvzfa0nvj6j5bc8jhiy3n5q0p5ha9bcsyvi92mf01"))))
    (properties `((upstream-name . "Deriv")))
    (build-system r-build-system)
    (native-inputs (list r-testthat))
    (home-page "https://cran.r-project.org/web/packages/Deriv")
    (synopsis "Symbolic differentiation")
    (description
     "This package provides an R-based solution for symbolic differentiation.
It admits user-defined functions as well as function substitution in arguments
of functions to be differentiated.  Some symbolic simplification is part of
the work.")
    (license license:gpl3+)))

(define-public r-doby
  (package
    (name "r-doby")
    (version "4.6.27")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "doBy" version))
       (sha256
        (base32
         "1gb0907dd7n9i1k83dcljfiwxk4hcqzjw41qgwdw7pbklc6yhxg1"))))
    (properties `((upstream-name . "doBy")))
    (build-system r-build-system)
    (propagated-inputs
     (list r-boot
           r-broom
           r-cowplot
           r-deriv
           r-dplyr
           r-ggplot2
           r-mass
           r-matrix
           r-microbenchmark
           r-modelr
           r-rlang
           r-tibble
           r-tidyr))
    (native-inputs
     (list r-geepack r-knitr r-lme4 r-multcomp r-testthat))
    (home-page "https://people.math.aau.dk/~sorenh/software/doBy/")
    (synopsis "Groupwise statistics, LSmeans, linear contrasts, and utilities")
    (description
     "This package contains:

@itemize
@item facilities for working with grouped data: @code{do}
  something to data stratified @code{by} some variables.
@item implementations of least-squares means, general linear contrasts, and
@item miscellaneous other utilities.
@end itemize\n")
    (license license:gpl2+)))

(define-public r-refgenome
  (package
    (name "r-refgenome")
    (version "1.7.7")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "refGenome" version))
       (sha256
        (base32
         "1za89bn3am1zgvm641qi1ab6kaqpll4rb9p9f1sjwvcgqq6065g5"))))
    (properties `((upstream-name . "refGenome")))
    (build-system r-build-system)
    ;; FIXME: Tests fail with: No matches between query and reference seqid's
    ;; (wrong genome?)
    (arguments (list #:tests? #false))
    (propagated-inputs
     (list r-dbi r-doby r-rsqlite))
    (home-page "https://cran.r-project.org/web/packages/refGenome/")
    (synopsis
     "Gene and splice site annotation using annotation data from Ensembl and UCSC")
    (description
     "This package contains functionality for importing and managing of
downloaded genome annotation data from the Ensembl genome browser (European
Bioinformatics Institute) and from the UCSC genome browser (University of
California, Santa Cruz) and annotation routines for genomic positions and
splice site positions.")
    (license license:gpl2)))

(define-public r-reformulas
  (package
    (name "r-reformulas")
    (version "0.4.1")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "reformulas" version))
       (sha256
        (base32 "1pph0g306rkm5fyimbd6c0cz5wdwza1srvn6s3wg7lwihzpqbib0"))))
    (properties `((upstream-name . "reformulas")))
    (build-system r-build-system)
    (propagated-inputs (list r-matrix r-rdpack))
    (home-page "https://github.com/bbolker/reformulas")
    (synopsis "Machinery for processing random effect formulas")
    (description
     "This package lets you take formulas including random-effects
components (formatted as in @code{lme4}, @code{glmmTMB}, etc.) and process
them.  It includes various helper functions.")
    (license license:gpl3)))

(define-public r-basix
  (package
    (name "r-basix")
    (version "1.1")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "BASIX" version))
       (sha256
        (base32
         "18dkvv1iwskfnlpl6xridcgqpalbbpm2616mvc3hfrc0b26v01id"))))
    (properties `((upstream-name . "BASIX")))
    (build-system r-build-system)
    (home-page "https://cran.r-project.org/web/packages/BASIX/")
    (synopsis "Efficient C/C++ toolset for R")
    (description
     "BASIX provides some efficient C/C++ implementations of native R
procedures to speed up calculations in R.")
    (license license:gpl2)))

(define-public r-blackbox
  (package
    (name "r-blackbox")
    (version "1.1.46")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "blackbox" version))
       (sha256
        (base32 "03m93v5nk5zg039axkf02drdj2q165k73xk6waaiyi0b8w0sbl8l"))))
    (properties
     '((upstream-name . "blackbox")
       (updater-ignored-native-inputs . ("r-pkg"))))
    (build-system r-build-system)
    (propagated-inputs (list r-foreach
                             r-geometry
                             r-lattice
                             r-mass
                             r-matrixstats
                             r-nloptr
                             r-numderiv
                             r-pbapply
                             r-proxy
                             r-rcdd
                             r-rcpp
                             r-rcppeigen
                             r-spamm))
    (native-inputs (list r-testthat))
    (home-page "https://kimura.univ-montp2.fr/~rousset/Migraine.htm")
    (synopsis "Black box optimization and exploration of parameter space")
    (description
     "This package performs prediction of a response function from simulated
response values, allowing black-box optimization of functions estimated with
some error.  It includes a simple user interface for such applications, as
well as more specialized functions designed to be called by the Migraine
software (Rousset and Leblois, 2012 <doi:10.1093/molbev/MSR262>; Leblois et
al., 2014 <doi:10.1093/molbev/msu212>; and see URL).  The latter functions are
used for prediction of likelihood surfaces and implied likelihood ratio
confidence intervals, and for exploration of predictor space of the surface.
Prediction of the response is based on ordinary Kriging (with residual error)
of the input.  Estimation of smoothing parameters is performed by generalized
cross-validation.")
    (license license:cecill)))

(define-public r-blavaan
  (package
    (name "r-blavaan")
    (version "0.5-8")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "blavaan" version))
       (sha256
        (base32 "00pxi5zj68796b3qkil3w66z446ib61xl2l5v1qia1mc9fznlzri"))))
    (properties `((upstream-name . "blavaan")))
    (build-system r-build-system)
    (propagated-inputs (list r-bayesplot
                             r-bh
                             r-coda
                             r-future-apply
                             r-lavaan
                             r-loo
                             r-matrix
                             r-mnormt
                             r-nonnest2
                             r-rcpp
                             r-rcppeigen
                             r-rcppparallel
                             r-rstan
                             r-rstantools
                             r-stanheaders
                             r-tmvnsim))
    (native-inputs (list r-tinytest))
    (home-page "https://ecmerkle.github.io/blavaan/")
    (synopsis "Bayesian latent variable analysis")
    (description
     "This package lets you fit a variety of Bayesian latent variable models,
including confirmatory factor analysis, structural equation models, and latent
growth curve models.")
    (license license:gpl3+)))

(define-public r-blockfest
  (package
    (name "r-blockfest")
    (version "2.0")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "BlockFeST" version))
       (sha256
        (base32
         "1fcl3yc1cf09znqbj787d3fd2kl5rp63la7pxawsgmap7nxwkp65"))))
    (properties `((upstream-name . "BlockFeST")))
    (build-system r-build-system)
    (propagated-inputs (list r-basix))
    (home-page "https://cran.r-project.org/web/packages/BlockFeST/")
    (synopsis "Bayesian calculation of region-specific fixation index")
    (description
     "This package provides an R implementation of an extension of the
BayeScan software for codominant markers, adding the option to group
individual SNPs into pre-defined blocks.  A typical application of this new
approach is the identification of genomic regions, genes, or gene sets
containing one or more SNPs that evolved under directional selection.")
    (license license:gpl2)))

(define-public r-brglm2
  (package
    (name "r-brglm2")
    (version "0.9.2")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "brglm2" version))
       (sha256
        (base32 "0islmx4kdy22qn2cq7lpzqq6lc6mci5qly645nfdhad9001jmhsa"))))
    (properties `((upstream-name . "brglm2")))
    (build-system r-build-system)
    (propagated-inputs (list r-enrichwith r-mass r-matrix r-nnet r-numderiv))
    (native-inputs (list r-knitr))
    (home-page "https://github.com/ikosmidis/brglm2")
    (synopsis "Bias reduction in generalized linear models")
    (description
     "This is a package for estimation and inference from generalized linear
models based on various methods for bias reduction and maximum penalized
likelihood with powers of the Jeffreys prior as penalty.  The @code{brglmFit}
fitting method can achieve reduction of estimation bias by solving either the
mean bias-reducing adjusted score equations in Firth (1993)
<doi:10.1093/biomet/80.1.27> and Kosmidis and Firth
(2009) <doi:10.1093/biomet/asp055>, or the median bias-reduction adjusted
score equations in Kenne et al. (2017) <doi:10.1093/biomet/asx046>, or through
the direct subtraction of an estimate of the bias of the maximum likelihood
estimator from the maximum likelihood estimates as in Cordeiro and
McCullagh (1991) <https://www.jstor.org/stable/2345592>.")
    (license license:gpl3)))

(define-public r-proc
  (package
    (name "r-proc")
    (version "1.18.5")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "pROC" version))
       (sha256
        (base32
         "129cnh3kh9sr42nc7n9f14kr9svi3501834x40njynnzlr0wi4sm"))))
    (properties
     '((upstream-name . "pROC")
       (updater-extra-native-inputs . ("r-ggplot2" "r-mass"))))
    (build-system r-build-system)
    (propagated-inputs
     (list r-plyr r-rcpp))
    (native-inputs (list r-ggplot2 r-mass r-testthat))
    (home-page "https://web.expasy.org/pROC/")
    (synopsis "Display and analyze ROC curves")
    (description
     "This package provides tools for visualizing, smoothing and comparing
receiver operating characteristic (ROC curves).  The area under the
curve (AUC) can be compared with statistical tests based on U-statistics or
bootstrap.  Confidence intervals can be computed for (p)AUC or ROC curves.")
    (license license:gpl3+)))

(define-public r-rootsolve
  (package
    (name "r-rootsolve")
    (version "1.8.2.4")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "rootSolve" version))
       (sha256
        (base32
         "0p9qmn82bg0ks9hmh2dkygnzhxcnp5z8z8b8aq52w6clliz32sp1"))))
    (properties `((upstream-name . "rootSolve")))
    (build-system r-build-system)
    (native-inputs (list gfortran))
    (home-page "https://cran.r-project.org/web/packages/rootSolve/")
    (synopsis "Tools for the analysis of ordinary differential equations")
    (description
     "This package provides routines to find the root of nonlinear functions,
and to perform steady-state and equilibrium analysis of @dfn{ordinary
differential equations} (ODE).  It includes routines that:

@enumerate
@item generate gradient and jacobian matrices (full and banded),
@item find roots of non-linear equations by the Newton-Raphson method,
@item estimate steady-state conditions of a system of (differential) equations
  in full, banded or sparse form, using the Newton-Raphson method, or by
  dynamically running,
@item solve the steady-state conditions for uni- and multicomponent 1-D, 2-D,
  and 3-D partial differential equations, that have been converted to ordinary
  differential equations by numerical differencing (using the method-of-lines
  approach).
@end enumerate\n")
    (license license:gpl2+)))

(define-public r-abcanalysis
  (package
    (name "r-abcanalysis")
    (version "1.2.1")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "ABCanalysis" version))
       (sha256
        (base32 "0wac1ksmnxa36v99ca4hv8k0rsh3igwpcllmlv9wf7i9kgqviqwi"))))
    (properties `((upstream-name . "ABCanalysis")))
    (build-system r-build-system)
    (propagated-inputs (list r-plotrix))
    (home-page "https://www.uni-marburg.de/fb12/arbeitsgruppen/datenbionik/software-en/")
    (synopsis "Computed ABC Analysis")
    (description
     "Multivariate data sets often differ in several factors or derived statistical
parameters, which have to be selected for a valid interpretation.  Basing this
selection on traditional statistical limits leads occasionally to the perception
of losing information from a data set.  This package provides tools to calculate
these limits on the basis of the mathematical properties of the distribution of
the analyzed items.")
    (license license:gpl3)))

(define-public r-slam
  (package
    (name "r-slam")
    (version "0.1-55")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "slam" version))
       (sha256
        (base32 "00qwx6yrsqxa8kk2dn8i024a2cq1hcg9801k0rari9rb006lbf0g"))))
    (build-system r-build-system)
    (home-page "https://cran.r-project.org/web/packages/slam/")
    (synopsis "Sparse lightweight arrays and matrices")
    (description
     "This package contains data structures and algorithms for sparse arrays and matrices,
based on index arrays and simple triplet representations, respectively.")
    (license license:gpl2)))

(define-public r-slanter
  (package
    (name "r-slanter")
    (version "0.2-0")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "slanter" version))
       (sha256
        (base32 "024dkman0r5qzc215gw0ds932vdaz8krrhv64fjw9pni37ixc3mf"))))
    (properties `((upstream-name . "slanter")))
    (build-system r-build-system)
    (propagated-inputs (list r-matrix r-pheatmap r-pracma))
    (native-inputs (list r-knitr))
    (home-page "https://cran.r-project.org/package=slanter")
    (synopsis "Slanted matrices and ordered clustering")
    (description
     "This is a package for slanted matrices and ordered clustering for better
visualization of similarity data.")
    (license license:expat)))

(define-public r-manipulatewidget
  (package
    (name "r-manipulatewidget")
    (version "0.11.1")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "manipulateWidget" version))
       (sha256
        (base32 "1dpgzmiv08afm57yxr017b014lfn9h3pa4w65prk5k3dgn6p4wsv"))))
    (properties
     `((upstream-name . "manipulateWidget")))
    (build-system r-build-system)
    (arguments
     (list
      #:modules '((guix build r-build-system)
                  (guix build minify-build-system)
                  (guix build utils)
                  (ice-9 match))
      #:imported-modules `(,@%r-build-system-modules
                           (guix build minify-build-system))
      #:phases
      '(modify-phases (@ (guix build r-build-system) %standard-phases)
         (add-after 'unpack 'process-javascript
           (lambda* (#:key inputs #:allow-other-keys)
             (with-directory-excursion "inst/lib/export"
               (for-each (match-lambda
                           ((source . target)
                            (minify source #:target target)))
                         `((,(assoc-ref inputs "js-html2canvas")
                            . "html2canvas/html2canvas.js")
                           (,(search-input-file inputs "FileSaver.js")
                            . "FileSaver/FileSaver.min.js")))))))))
    (propagated-inputs
     (list r-base64enc
           r-codetools
           r-htmltools
           r-htmlwidgets
           r-knitr
           r-miniui
           r-shiny
           r-shinyjs
           r-webshot))
    (native-inputs
     `(("esbuild" ,esbuild)
       ("r-knitr" ,r-knitr)
       ("r-testthat" ,r-testthat)
       ;; inst/lib/export/html2canvas/html2canvas.js, version 1.0.0-rc.3
       ("js-html2canvas"
        ,(let ((version "1.0.0-rc.3"))
           (origin
             (method url-fetch)
             (uri (string-append
                   "https://github.com/niklasvh/html2canvas/"
                   "releases/download/v" version "/html2canvas.js"))
             (sha256
              (base32
               "0gxw8ihxkiwhh8hs8n7k1fsim7gq7v31h89fc9k2dw3namg7m2qp")))))
       ;; inst/lib/export/FileSaver/FileSaver.min.js
       ("js-filesaver"
        ,(let ((version "1.2.0"))
           (origin
             (method git-fetch)
             (uri (git-reference
                   (url "https://github.com/eligrey/FileSaver.js")
                   (commit version)))
             (file-name (git-file-name "js-filesaver" version))
             (sha256
              (base32
               "07mw01056fk36pganhs27y8rl5y5hrdsm945pwbbvmdjnzq4ijny")))))))
    (home-page "https://github.com/rte-antares-rpackage/manipulateWidget/")
    (synopsis "Add even more interactivity to interactive charts")
    (description
     "This package lets you create in just a few lines of R code a nice user interface to
modify the data or the graphical parameters of one or multiple interactive
charts.  It is useful to quickly explore visually some data or for package
developers to generate user interfaces easy to maintain.")
    (license license:gpl2+)))

(define-public r-a3
  (package
    (name "r-a3")
    (version "1.0.0")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "A3" version))
       (sha256
        (base32 "017hq9pjsv1h9i7cqk5cfx27as54shlhdsdvr6jkhb8jfkpdb6cw"))))
    (properties `((upstream-name . "A3")))
    (build-system r-build-system)
    (propagated-inputs
     (list r-pbapply r-xtable))
    (home-page "https://cran.r-project.org/web/packages/A3/")
    (synopsis "Error metrics for predictive models")
    (description
     "This package supplies tools for tabulating and analyzing the results of predictive
models.  The methods employed are applicable to virtually any predictive model
and make comparisons between different methodologies straightforward.")
    (license license:gpl2+)))

(define-public r-infotheo
  (package
    (name "r-infotheo")
    (version "1.2.0.1")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "infotheo" version))
       (sha256
        (base32
         "1m1979vf8rvq3534mp1hihfadikhxrg3p6ac3hirz96kgb4qxyy0"))))
    (build-system r-build-system)
    (home-page "http://homepage.meyerp.com/software")
    (synopsis "Information-theoretic measures")
    (description
     "This package implements various measures of information theory based on
several entropy estimators.")
    (license license:gpl3+)))

(define-public r-nsprcomp
  (package
    (name "r-nsprcomp")
    (version "0.5.1-2")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "nsprcomp" version))
       (sha256
        (base32
         "1zlc1ximx96f235c0l8qfs6vbp1kpnbf943wxsfahnnlnxvwi59f"))))
    (properties `((upstream-name . "nsprcomp")))
    (build-system r-build-system)
    (native-inputs (list r-testthat))
    (home-page "https://sigg-iten.ch/research/")
    (synopsis "Non-negative and sparse PCA")
    (description
     "This package implements two methods for performing a constrained
principal component analysis (PCA), where non-negativity and/or sparsity
constraints are enforced on the principal axes (PAs).  The function
@code{nsprcomp} computes one principal component (PC) after the other.  Each
PA is optimized such that the corresponding PC has maximum additional variance
not explained by the previous components.  In contrast, the function
@code{nscumcomp} jointly computes all PCs such that the cumulative variance is
maximal.  Both functions have the same interface as the @code{prcomp} function
from the @code{stats} package (plus some extra parameters).")
    (license license:gpl2+)))

(define-public r-cmaesr
  (package
    (name "r-cmaesr")
    (version "1.0.3")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "cmaesr" version))
       (sha256
        (base32 "03zx2nrw24wmmjjpyh8pswasjjq0amf0g375fm2b3s111dx8fbj9"))))
    (properties `((upstream-name . "cmaesr")))
    (build-system r-build-system)
    (propagated-inputs (list r-bbmisc r-checkmate r-ggplot2 r-paramhelpers
                             r-smoof))
    (home-page "https://github.com/jakobbossek/cmaesr")
    (synopsis "Covariance matrix adaptation evolution strategy")
    (description
     "This is a pure R implementation of the Covariance Matrix Adaptation
Evolution Strategy (CMA-ES) with optional restarts (IPOP-CMA-ES).")
    (license license:bsd-2)))

(define-public r-cmplot
  (package
    (name "r-cmplot")
    (version "4.5.1")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "CMplot" version))
       (sha256
        (base32
         "0ml6n1wjxrnq13042jihpjlmm6vmkaiks9n49qp7v7rg47gn2ik8"))))
    (properties `((upstream-name . "CMplot")))
    (build-system r-build-system)
    (home-page "https://github.com/YinLiLin/CMplot")
    (synopsis "Circle Manhattan plot")
    (description
     "Circle Manhattan Plot is an R package that can lay out genome-wide
association study P-value results in both traditional rectangular patterns,
QQ-plot and novel circular ones.  United in only one bull's eye style plot,
association results from multiple traits can be compared interactively,
thereby to reveal both similarities and differences between signals.
Additional functions include: highlight signals, a group of SNPs, chromosome
visualization and candidate genes around SNPs.")
    (license license:gpl2+)))

(define-public r-precrec
  (package
    (name "r-precrec")
    (version "0.14.5")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "precrec" version))
       (sha256
        (base32
         "1n13zfmbbw7y73j09wkdpzyh5z6vkczljv5pr75lphcawshdyfa1"))))
    (properties `((upstream-name . "precrec")))
    (build-system r-build-system)
    (propagated-inputs
     (list r-assertthat
           r-data-table
           r-ggplot2
           r-gridextra
           r-rcpp
           r-rlang
           r-withr))
    (native-inputs (list r-knitr r-testthat r-vdiffr))
    (home-page "https://evalclass.github.io/precrec/")
    (synopsis "Calculate accurate precision-recall and ROC curves")
    (description
     "This package provides tools for accurate calculations and visualization
of precision-recall and ROC (Receiver Operator Characteristics) curves.")
    (license license:gpl3)))

(define-public r-netrep
  (package
    (name "r-netrep")
    (version "1.2.7")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "NetRep" version))
       (sha256
        (base32
         "02ss45giv30pi31b5rysa36bn5c4fs5x58g4vb0arz9cnicznv97"))))
    (properties `((upstream-name . "NetRep")))
    (build-system r-build-system)
    (propagated-inputs
     (list r-abind
           r-bh
           r-foreach
           r-rcolorbrewer
           r-rcpp
           r-rcpparmadillo
           r-rhpcblasctl
           r-statmod))
    (native-inputs (list r-knitr r-testthat))
    (home-page "https://cran.r-project.org/package=NetRep")
    (synopsis "Permutation testing network module preservation across datasets")
    (description
     "This package provides functions for assessing the
replication/preservation of a network module's topology across datasets
through permutation testing.")
    (license license:gpl2)))

(define-public r-intergraph
  (package
    (name "r-intergraph")
    (version "2.0-4")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "intergraph" version))
       (sha256
        (base32
         "1jarzhrgm5g8z2h10h8x7jk9q2al6rx5kgnwvwi2199am6gjypsq"))))
    (properties `((upstream-name . "intergraph")))
    (build-system r-build-system)
    (propagated-inputs
     (list r-igraph r-network))
    (native-inputs
     (list r-knitr r-testthat))
    (home-page "https://mbojan.github.io/intergraph")
    (synopsis "Coercion routines for network data objects")
    (description
     "Functions implemented in this package allow coercing (i.e. convert)
network data between classes provided by other R packages.  Currently
supported classes are those defined in packages @code{network} and
@code{igraph}.")
    (license license:gpl3)))

(define-public r-interp
  (package
    (name "r-interp")
    (version "1.1-6")
    (source (origin
              (method url-fetch)
              (uri (cran-uri "interp" version))
              (sha256
               (base32
                "0d6ddvm94113d9bjhghjsfbhgz44q0lkjc2l809dzv1lad708x1n"))))
    (properties `((upstream-name . "interp")))
    (build-system r-build-system)
    (propagated-inputs (list r-deldir r-rcpp r-rcppeigen))
    (native-inputs (list gfortran))
    (home-page "https://cran.r-project.org/package=interp")
    (synopsis "Interpolation methods")
    (description
     "Bivariate data interpolation on regular and irregular grids, either
linear or using splines are the main part of this package.  It is intended to
provide replacement functions for the ACM licensed @code{akima::interp} and
@code{tripack::tri.mesh} functions.")
    (license license:gpl2+)))

(define-public r-abcoptim
  (package
    (name "r-abcoptim")
    (version "0.15.0")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "ABCoptim" version))
       (sha256
        (base32 "1ih0xk88qhsmpvnxf56041wx5sk8as2f4f2gdnpnwdym9mbr9n4b"))))
    (properties `((upstream-name . "ABCoptim")))
    (build-system r-build-system)
    (propagated-inputs (list r-rcpp))
    (native-inputs (list r-testthat))
    (home-page "https://github.com/gvegayon/ABCoptim/")
    (synopsis "Optimization of Artificial Bee Colony algorithm")
    (description
     "Artificial Bee Colony (ABC) is one of the most recently defined algorithms by Dervis
Karaboga in 2005, motivated by the intelligent behavior of honey bees.  It is as
simple as Particle Swarm Optimization (PSO) and Differential Evolution (DE)
algorithms, and uses only common control parameters such as colony size and
maximum cycle number.  The @code{r-abcoptim} implements the Artificial bee
colony optimization algorithm @url{http://mf.erciyes.edu.tr/abc/pub/tr06_2005.pdf}.
  This version is a work-in-progress and is written in R code.")
    (license license:expat)))

(define-public r-abcp2
  (package
    (name "r-abcp2")
    (version "1.2")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "ABCp2" version))
       (sha256
        (base32 "1s2skkxpzss7c29i8600psgrp0hl46jcrxqrmy2b4db8hc0kcnbx"))))
    (properties `((upstream-name . "ABCp2")))
    (build-system r-build-system)
    (propagated-inputs (list r-mass))
    (home-page "https://cran.r-project.org/web/packages/ABCp2/")
    (synopsis "Approximate Bayesian Computational Model for Estimating P2")
    (description
     "This package tests the goodness of fit of a distribution of offspring to the Normal,
Poisson, and Gamma distribution and estimates the proportional paternity of the
second male (P2) based on the best fit distribution.")
    (license license:gpl2)))

(define-public r-abcrf
  (package
    (name "r-abcrf")
    (version "1.9")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "abcrf" version))
       (sha256
        (base32 "08mh1a6gxp0mfx6qnp1qzcrfx7xp64qj9kad4ziyswfx22ykdsxi"))))
    (build-system r-build-system)
    (propagated-inputs
     (list r-doparallel
           r-foreach
           r-mass
           r-matrixstats
           r-ranger
           r-rcpp
           r-rcpparmadillo
           r-readr
           r-stringr))
    (home-page "https://cran.r-project.org/web/packages/abcrf/")
    (synopsis "Approximate bayesian computation via random forests")
    (description
     "This package performs approximate bayesian computation (ABC) model choice and
parameter inference via random forests.  This machine learning tool named random
forests (RF) can conduct selection among the highly complex models covered by
ABC algorithms.")
    (license license:gpl2+)))

(define-public r-abctools
  (package
    (name "r-abctools")
    (version "1.1.7")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "abctools" version))
       (sha256
        (base32 "16gn5hk25glbjml7bclxqkybi90gqjijz6hl6ak8aig5wm08pgx2"))))
    (build-system r-build-system)
    (propagated-inputs
     (list r-abc r-abind r-hmisc r-plyr))
    (home-page "https://github.com/dennisprangle/abctools/")
    (synopsis "Tools for ABC analyses")
    (description
     "This @code{r-abctools} package provides tools for approximate Bayesian computation
including summary statistic selection and assessing coverage.  This includes
recent dimension reduction algorithms to tune the choice of summary statistics,
and coverage methods to tune the choice of threshold.")
    (license license:gpl2+)))

(define-public r-ggstance
  (package
    (name "r-ggstance")
    (version "0.3.7")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "ggstance" version))
       (sha256
        (base32 "0v25si348qdp68887yx4d652rsz8w5lfabwaq1nvglrhs6s4f9js"))))
    (build-system r-build-system)
    (propagated-inputs
     (list r-cli r-ggplot2 r-plyr r-rlang r-withr))
    (native-inputs (list r-testthat))
    (home-page "https://cran.r-project.org/web/packages/ggstance/")
    (synopsis "Horizontal and vertical versions of @code{r-ggplot2}")
    (description
     "This package is a @code{r-ggplot2} extension that provides flipped components:
@enumerate
@item horizontal versions of @code{r-ggplot2} stats and @code{r-ggplot2} geoms;
@item vertical versions of @code{r-ggplot2} positions.
@end enumerate")
    (license license:gpl3)))

(define-public r-ggnetwork
  (package
    (name "r-ggnetwork")
    (version "0.5.13")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "ggnetwork" version))
       (sha256
        (base32
         "0ipxw6j36n0hfn0nsimw8jbjszvm1d0hadwg4zirvn6v36npwabc"))))
    (properties `((upstream-name . "ggnetwork")))
    (build-system r-build-system)
    (propagated-inputs
     (list r-ggplot2 r-ggrepel r-igraph r-network r-sna))
    (native-inputs (list r-knitr r-testthat))
    (home-page "https://github.com/briatte/ggnetwork")
    (synopsis "Geometries to plot networks with ggplot2")
    (description
     "This package provides geometries to plot network objects with the
ggplot2 package.")
    (license license:gpl3)))

(define-public r-cvauc
  (package
    (name "r-cvauc")
    (version "1.1.4")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "cvAUC" version))
       (sha256
        (base32
         "1m2y50a1yapf1c74km9a4r47ds2z2bfp4wwwkqin7swv9v1s7d28"))))
    (properties `((upstream-name . "cvAUC")))
    (build-system r-build-system)
    (propagated-inputs
     (list r-data-table r-rocr))
    (home-page "https://github.com/ledell/cvAUC")
    (synopsis "Cross-validated area under the ROC curve confidence intervals")
    (description
     "This package contains various tools for working with and evaluating
cross-validated area under the ROC curve (AUC) estimators.  The primary
functions of the package are @code{ci.cvAUC} and @code{ci.pooled.cvAUC}, which
report cross-validated AUC and compute confidence intervals for
cross-validated AUC estimates based on influence curves for i.i.d. and pooled
repeated measures data, respectively.")
    (license license:asl2.0)))

(define-public r-gam
  (package
    (name "r-gam")
    (version "1.22-5")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "gam" version))
       (sha256
        (base32
         "0mg9h8hm76wz8fbppfirgmqm1x70n3q13mmy8wdpi0h9bq0a2cvx"))))
    (properties `((upstream-name . "gam")))
    (build-system r-build-system)
    (propagated-inputs
     (list r-foreach))
    (native-inputs
     (list gfortran r-testthat))
    (home-page "https://cran.r-project.org/package=gam")
    (synopsis "Generalized additive models")
    (description
     "This package provides functions for fitting and working with generalized
additive models, as described in chapter 7 of \"Statistical Models in
S\" (Chambers and Hastie (eds), 1991), and \"Generalized Additive
Models\" (Hastie and Tibshirani, 1990).")
    (license license:gpl2)))

(define-public r-superlearner
  (package
    (name "r-superlearner")
    (version "2.0-29")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "SuperLearner" version))
       (sha256
        (base32
         "0g1baz8jakgfwdh5bd9hrg1nm4ljpnxiiy5pmf00d27ld7wh6sr3"))))
    (properties `((upstream-name . "SuperLearner")))
    (build-system r-build-system)
    (propagated-inputs
     (list r-cvauc r-gam r-nnls))
    (native-inputs
     (list r-knitr r-rmarkdown r-testthat))
    (home-page "https://github.com/ecpolley/SuperLearner")
    (synopsis "Super learner prediction")
    (description
     "This package implements the super learner prediction method and contains
a library of prediction algorithms to be used in the super learner.")
    (license license:gpl3)))

(define-public r-drtmle
  (package
    (name "r-drtmle")
    (version "1.1.2")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "drtmle" version))
       (sha256
        (base32
         "0qvdxzvpi7a66gx61v6fj31zy4y5cid18g4qgv5lir7qc74rbbx0"))))
    (properties
     '((upstream-name . "drtmle")
       (updater-extra-native-inputs . ("r-nloptr"))))
    (build-system r-build-system)
    (propagated-inputs
     (list r-future-apply r-np r-superlearner))
    (native-inputs
     (list r-knitr r-nloptr r-testthat))
    (home-page "https://github.com/benkeser/drtmle")
    (synopsis "Doubly-robust nonparametric estimation and inference")
    (description
     "This package implements targeted minimum loss-based estimators of
counterfactual means and causal effects that are doubly-robust with respect
both to consistency and asymptotic normality.")
    (license license:expat)))

(define-public r-dofuture
  (package
    (name "r-dofuture")
    (version "1.1.0")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "doFuture" version))
       (sha256
        (base32
         "1bi07qs7gny79gjz3hk5m1j1aggmp9g68n0abdzimnn0wdcmvw2a"))))
    (properties `((upstream-name . "doFuture")))
    (build-system r-build-system)
    (arguments
     (list
      #:phases
      '(modify-phases %standard-phases
         (add-after 'unpack 'set-HOME
           (lambda _ (setenv "HOME" "/tmp"))))))
    (propagated-inputs
     (list r-foreach r-future r-future-apply r-globals r-iterators))
    (native-inputs
     (list r-r-rsp))                    ;vignette builder
    (home-page "https://github.com/HenrikBengtsson/doFuture")
    (synopsis "Foreach parallel adapter using the future API")
    (description
     "This package provides a @code{%dopar%} adapter such that any type of
futures can be used as backends for the @code{foreach} framework.")
    (license license:lgpl2.1+)))

(define-public r-superheat
  (package
    (name "r-superheat")
    (version "0.1.0")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "superheat" version))
       (sha256
        (base32
         "01v8s6px1k5fajlm6py3ksr1i853kwwlky1yryzhy3p1cxhwgg83"))))
    (properties `((upstream-name . "superheat")))
    (build-system r-build-system)
    (propagated-inputs
     (list r-dplyr
           r-ggdendro
           r-ggplot2
           r-gtable
           r-magrittr
           r-plyr
           r-scales))
    (native-inputs (list r-testthat))
    (home-page "https://cran.r-project.org/package=superheat")
    (synopsis "Graphical tool for exploring complex datasets using heatmaps")
    (description
     "This package provides a system for generating extendable and
customizable heatmaps for exploring complex datasets, including big data and
data with multiple data types.")
    (license license:cc0)))

(define-public r-qualv
  (package
    (name "r-qualv")
    (version "0.3-5")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "qualV" version))
       (sha256
        (base32
         "09qqfx94f46x585iipr9wii8ji6ih31xymbw4p5v3qixmfpja276"))))
    (properties `((upstream-name . "qualV")))
    (build-system r-build-system)
    (propagated-inputs
     (list r-kernsmooth))
    (home-page "https://qualV.R-Forge.R-Project.org/")
    (synopsis "Qualitative Validation Methods")
    (description
     "This package provides qualitative methods for the validation of dynamic
models.  It contains

@enumerate
@item an orthogonal set of deviance measures for absolute, relative and
  ordinal scale and
@item approaches accounting for time shifts.
@end enumerate

The first approach transforms time to take time delays and speed differences
into account.  The second divides the time series into interval units
according to their main features and finds the @dfn{longest common
subsequence} (LCS) using a dynamic programming algorithm.")
    (license license:gpl2+)))

(define-public r-mosaiccore
  (package
    (name "r-mosaiccore")
    (version "0.9.4.0")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "mosaicCore" version))
       (sha256
        (base32 "0v3xhv6yfk1hc6a40jjgp6vvq102qa1l4n787pfywx6jhzbhamp2"))))
    (properties `((upstream-name . "mosaicCore")))
    (build-system r-build-system)
    (arguments
     (list
      #:phases
      '(modify-phases %standard-phases
         (add-after 'unpack 'delete-bad-tests
           (lambda _
             ;; Two tests fail with accuracy problems.
             (delete-file "tests/testthat/test-interval-calculations.R"))))))
    (propagated-inputs
     (list r-dplyr r-mass r-rlang r-tidyr))
    (native-inputs (list r-mosaicdata r-testthat))
    (home-page "https://github.com/ProjectMOSAIC/mosaicCore/")
    (synopsis "Common utilities for mosaic family packages")
    (description
     "Common utilities used in other Mosaic family packages are collected here.")
    (license license:gpl2+)))

(define-public r-labelled
  (package
    (name "r-labelled")
    (version "2.14.1")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "labelled" version))
       (sha256
        (base32
         "01mi9vly79p5mir6wwfak0mbxnagaw01rd2fa539lfiwr49bllwc"))))
    (properties `((upstream-name . "labelled")))
    (build-system r-build-system)
    (propagated-inputs
     (list r-cli
           r-dplyr
           r-haven
           r-lifecycle
           r-rlang
           r-stringr
           r-tidyr
           r-tidyselect
           r-vctrs))
    (native-inputs
     (list r-knitr r-spelling r-testthat))
    (home-page "https://larmarange.github.io/labelled/")
    (synopsis "Manipulating labelled data")
    (description
     "This package provides useful functions to deal with the
@code{haven_labelled} and @code{haven_labelled_spss} classes introduced by the
haven package.")
    (license license:gpl3)))

(define-public r-ggformula
  (package
    (name "r-ggformula")
    (version "0.12.0")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "ggformula" version))
       (sha256
        (base32 "0vbpivyxms46px3wqkbl1wq199mqdxq94gsiplv4i7lz0lzghsfm"))))
    (build-system r-build-system)
    (arguments
     (list
      #:phases
      '(modify-phases %standard-phases
         (add-after 'unpack 'delete-bad-tests
           (lambda _
             ;; This file requires r-mosaic, which we can't add because of a
             ;; dependency cycle.
             (delete-file "tests/testthat/test-layer-factory.R"))))))
    (propagated-inputs
     (list r-ggplot2
           r-ggridges
           r-labelled
           r-mosaiccore
           r-rlang
           r-scales
           r-stringr
           r-tibble))
    (native-inputs
     (list r-knitr r-palmerpenguins r-testthat))
    (home-page "https://github.com/ProjectMOSAIC/ggformula/")
    (synopsis "Formula interface for the @code{r-ggplot2}")
    (description
     "The @code{r-ggformula} introduces a family of graphics functions, gf_point(),
gf_density(), and so on, bring the formula interface to ggplot().  This captures
and extends the excellent simplicity of the lattice-graphics formula interface,
while providing the intuitive capabilities of @code{r-ggplot2}.")
    (license license:expat)))

(define-public r-mosaicdata
  (package
    (name "r-mosaicdata")
    (version "0.20.4")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "mosaicData" version))
       (sha256
        (base32 "0y6ii234paknak0p8cm5wcjia4s4wh7iixjbbvdgp0w17c05dckh"))))
    (properties `((upstream-name . "mosaicData")))
    (build-system r-build-system)
    (home-page "https://cran.r-project.org/web/packages/mosaicData/")
    (synopsis "Data sets for project Mosaic")
    (description
     "This package provides data sets from project Mosaic @url{http://mosaic-web.org}
used to teach mathematics, statistics, computation and modeling.")
    (license license:gpl2+)))

(define-public r-raster
  (package
    (name "r-raster")
    (version "3.6-32")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "raster" version))
       (sha256
        (base32
         "14h61mq4jsjvpfbn023dhy8wdqlkv46md3gdv8pancczikpal2ih"))))
    (build-system r-build-system)
    (propagated-inputs
     (list r-rcpp r-sp r-terra))
    (native-inputs (list r-tinytest))
    (home-page "https://www.rspatial.org/")
    (synopsis "Geographic data analysis and modeling")
    (description
     "The package implements basic and high-level functions for reading,
writing, manipulating, analyzing and modeling of gridded spatial data.
Processing of very large files is supported.")
    (license license:gpl3+)))

(define-public r-mosaic
  (package
    (name "r-mosaic")
    (version "1.9.1")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "mosaic" version))
       (sha256
        (base32 "0l7h3zg5izr5xxqy1sngz6fzbwdffzljnjmfbshzzbl4x80f5lwl"))))
    (build-system r-build-system)
    (arguments
     (list
      #:phases
      '(modify-phases %standard-phases
         (add-after 'unpack 'delete-bad-tests
           (lambda _
             ;; This file contains tests that attempt to download data files
             ;; off the internet.
             (delete-file "tests/testthat/test-read.file.R")
             ;; Unknown failure.
             (delete-file "tests/testthat/test-ladd.R"))))))
    (propagated-inputs
     (list r-dplyr
           r-ggformula
           r-ggplot2
           r-lattice
           r-mass
           r-matrix
           r-mosaiccore
           r-mosaicdata
           r-purrr
           r-rlang
           r-tibble
           r-tidyr))
    (native-inputs
     (list r-broom r-ggdendro r-ggrepel r-knitr r-latticeextra r-testthat))
    (home-page "https://github.com/ProjectMOSAIC/mosaic/")
    (synopsis "Mathematics, statistics, and computation teaching utilities")
    (description
     "This package contain data sets and utilities from
@url{http://mosaic-web.org, Project MOSAIC} used to teach mathematics,
statistics, computation and modeling.  Project MOSAIC is a community of
educators working to tie together aspects of quantitative work that students
in science, technology, engineering and mathematics will need in their
professional lives, but which are usually taught in isolation, if at all.")
    (license license:gpl2+)))

(define-public r-abd
  (package
    (name "r-abd")
    (version "0.2-8")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "abd" version))
       (sha256
        (base32 "191gspqzdv573vaw624ri0f5cm6v4j524bjs74d4a1hn3kn6r9b7"))))
    (build-system r-build-system)
    (propagated-inputs
     (list r-lattice r-mosaic r-nlme))
    (home-page "https://cran.r-project.org/web/packages/abd/")
    (synopsis "Analysis of biological data")
    (description
     "The @code{r-abd} package contains data sets and sample code for the Analysis of
biological data by Michael Whitlock and Dolph Schluter.")
    (license license:gpl2)))

(define-public r-svgui
  (package
    (name "r-svgui")
    (version "1.0.1")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "svGUI" version))
       (sha256
        (base32 "0ch5gdfk834xj9w3vxpm3x4770fz3nnlyn8b0jsw9f3n2as7g979"))))
    (properties `((upstream-name . "svGUI")))
    (build-system r-build-system)
    (native-inputs
     (list r-knitr r-testthat))
    (home-page "https://github.com/SciViews/svGUI/")
    (synopsis "Functions for managing GUI clients in R")
    (description
     "The SciViews @code{svGUI} package eases the management of Graphical User
Interfaces (GUI) in R.  It is independent from any particular GUI widgets.  It
centralizes info about GUI elements currently used, and it dispatches GUI
calls to the particular toolkits in use in function of the context.")
    (license license:gpl2)))

(define-public r-svdialogs
  (package
    (name "r-svdialogs")
    (version "1.1.0")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "svDialogs" version))
       (sha256
        (base32 "0z3a5glsi0ab43mdk2yvslxyzg12nbqqqc35jvgzj475mpkbgjif"))))
    (properties `((upstream-name . "svDialogs")))
    (build-system r-build-system)
    (inputs
     (list yad zenity))
    (propagated-inputs
     (list r-rstudioapi r-svgui))
    (native-inputs
     (list r-knitr r-testthat))
    (home-page "https://github.com/SciViews/svDialogs/")
    (synopsis "Portable dialog boxes")
    (description
     "This package helps to construct standard dialog boxes for your GUI, including
message boxes, input boxes, list, file or directory selection, and others.  In
case R cannot display GUI dialog boxes, a simpler command line version of these
interactive elements is also provided as a fallback solution.")
    (license license:gpl2)))

(define-public r-svunit
  (package
    (name "r-svunit")
    (version "1.0.6")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "svUnit" version))
       (sha256
        (base32 "08nmlbdrmmz04ira30721l99i74w07w2avdr4pypswf2sq1nqgi6"))))
    (properties `((upstream-name . "svUnit")))
    (build-system r-build-system)
    (native-inputs (list r-knitr))
    (home-page "https://github.com/SciViews/svUnit")
    (synopsis "Unit, integration and system testing")
    (description
     "This package provides a complete unit test system and functions to
implement its GUI part.")
    (license license:gpl2)))

(define-public r-abe
  (package
    (name "r-abe")
    (version "5.1.2")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "abe" version))
       (sha256
        (base32
         "0i1ziyydma5vgr2c3qmi53cximvj2hqpfz2vzxkfby1n4cyc50y2"))))
    (build-system r-build-system)
    (propagated-inputs
     (list r-foreach
           r-ggplot2
           r-lifecycle
           r-reshape2
           r-survival
           r-tidytext))
    (native-inputs
     (list r-testthat))
    (home-page "https://cran.r-project.org/web/packages/abe/")
    (synopsis "Augmented backward elimination")
    (description
     "This package performs augmented backward elimination and checks the
stability of the obtained model.  Augmented backward elimination combines
significance or information based criteria with the change in estimate to
either select the optimal model for prediction purposes or to serve as a tool
to obtain a practically sound, highly interpretable model.")
    (license license:gpl2+)))

(define-public r-abf2
  (package
    (name "r-abf2")
    (version "0.7-1")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "abf2" version))
       (sha256
        (base32 "0d65mc1w4pbiv7xaqzdlw1bfsxf25587rv597hh41vs0j0zlfpxx"))))
    (build-system r-build-system)
    (home-page "https://cran.r-project.org/web/packages/abf2/")
    (synopsis "Load gap-free axon @code{r-abf2} files")
    (description
     "This package loads electrophysiology data from ABF2 files, as created by
Axon Instruments/Molecular Devices software.  Only files recorded in gap-free
mode are currently supported.")
    (license license:artistic2.0)))

(define-public r-abhgenotyper
  (package
    (name "r-abhgenotyper")
    (version "1.0.1")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "ABHgenotypeR" version))
       (sha256
        (base32 "08cpmnaaxsm5c5bjifnfxdlvg5inrf13biqpcl2yq5zpqjmiki0l"))))
    (properties `((upstream-name . "ABHgenotypeR")))
    (build-system r-build-system)
    (propagated-inputs
     (list r-ggplot2 r-reshape2))
    (home-page "https://github.com/StefanReuscher/ABHgenotypeR/")
    (synopsis "Visualize and manipulate ABH genotypes")
    (description
     "The @code{r-abhgenotyper} package provides simple imputation,
error-correction and plotting capacities for genotype data.  The package is
supposed to serve as an intermediate but independent analysis tool between the
TASSEL GBS pipeline and the @code{r-qtl} package.  It provides functionalities
not found in either TASSEL or @code{r-qtl} in addition to visualization of
genotypes as \"graphical genotypes\".")
    (license license:gpl3)))

(define-public r-furrr
  (package
    (name "r-furrr")
    (version "0.3.1")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "furrr" version))
       (sha256
        (base32
         "12z4q0fn7asxis17hisi82bvfabl5if1338lmfqmkrwv5rg7748d"))))
    (build-system r-build-system)
    (properties
     '((updater-extra-native-inputs . ("r-dplyr"))))
    (propagated-inputs
     (list r-future
           r-globals
           r-lifecycle
           r-purrr
           r-rlang
           r-vctrs))
    (native-inputs (list r-dplyr r-testthat))
    (home-page "https://github.com/DavisVaughan/furrr")
    (synopsis "Apply mapping functions in parallel using futures")
    (description
     "This package provides implementations of the family of @code{map()}
functions from the @code{purrr} package that can be resolved using any
@code{future}-supported backend, e.g. parallel on the local machine or
distributed on a compute cluster.")
    (license license:lgpl2.1+)))

(define-public r-abjutils
  (package
    (name "r-abjutils")
    (version "0.3.2")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "abjutils" version))
       (sha256
        (base32 "0lmf4va8qnzwg698i2h4fcwvd6dhsgdkqsfh41aa3wg1flimhsr7"))))
    (build-system r-build-system)
    (propagated-inputs
     (list r-dplyr
           r-magrittr
           r-purrr
           r-rlang
           r-rstudioapi
           r-stringi
           r-stringr
           r-tidyr))
    (native-inputs (list r-testthat))
    (home-page "https://github.com/abjur/abjutils/")
    (synopsis "Collection of tools for jurimetrical analysis")
    (description
     "This package implements general purpose tools, such as functions for
sampling and basic manipulation of Brazilian lawsuits identification number.
It also implements functions for text cleaning, such as accentuation
removal.")
    (license license:expat)))

(define-public r-abnormality
  (package
    (name "r-abnormality")
    (version "0.1.0")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "abnormality" version))
       (sha256
        (base32 "1fzfskl9akl06nliy8hkv2a0pznpj8pwcypg3gj5r2nzvr3kan9v"))))
    (build-system r-build-system)
    (propagated-inputs
     (list r-mass r-matrix))
    (home-page "https://cran.r-project.org/web/packages/abnormality/")
    (synopsis "Measure a subject's abnormality with respect to a reference population")
    (description
     "This package contains functions to implement the methodology and
considerations laid out by Marks et al. in the article \"Measuring abnormality
in high dimensional spaces: applications in biomechanical gait analysis\".
Using high-dimensional datasets to measure a subject's overall level of
abnormality as compared to a reference population is often needed in outcomes
research.")
    (license license:expat)))

(define-public r-abodoutlier
  (package
    (name "r-abodoutlier")
    (version "0.1")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "abodOutlier" version))
       (sha256
        (base32 "1pvhgxmh23br84r0fbmv7g53z2427birdja96a67vqgz18r3fdvj"))))
    (properties `((upstream-name . "abodOutlier")))
    (build-system r-build-system)
    (propagated-inputs
     (list r-cluster))
    (home-page "https://cran.r-project.org/web/packages/abodOutlier/")
    (synopsis "Angle-based outlier detection")
    (description
     "This package performs angle-based outlier detection on a given data
frame.  It offers three methods to process data:
@enumerate
@item full but slow implementation using all the data that has cubic
  complexity;
@item a fully randomized method;
@item a method using k-nearest neighbours.
@end enumerate
These algorithms are well suited for high dimensional data outlier
detection.")
    (license license:expat)))

(define-public r-abps
  (package
    (name "r-abps")
    (version "0.3")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "ABPS" version))
       (sha256
        (base32 "0n3f66nmfi5v94il1mxy026mi84w01ph2aljk60vn3mrz8kwf2ll"))))
    (properties `((upstream-name . "ABPS")))
    (build-system r-build-system)
    (propagated-inputs (list r-kernlab))
    (native-inputs (list r-testthat))
    (home-page "https://cran.r-project.org/web/packages/ABPS/")
    (synopsis "Abnormal blood profile score to detect blood doping")
    (description
     "This package offers an implementation of the @dfn{Abnormal blood profile score} (ABPS).
The ABPS is a part of the Athlete biological passport program of the World
anti-doping agency, which combines several blood parameters into a single
score in order to detect blood doping.  The package also contains functions to
calculate other scores used in anti-doping programs, such as the ratio of
hemoglobin to reticulocytes (OFF-score), as well as example data.")
    (license license:gpl2+)))

(define-public r-parmigene
  (package
    (name "r-parmigene")
    (version "1.1.1")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "parmigene" version))
       (sha256
        (base32
         "03n93x8qsc4cl5a3d2z3q56rm2zs7xnpn9iqli25g3plv69hp0kk"))))
    (build-system r-build-system)
    (home-page "https://cran.r-project.org/web/packages/parmigene/")
    (synopsis "Mutual information estimation for gene network reconstruction")
    (description
     "This package provides a parallel estimation of the mutual information
based on entropy estimates from k-nearest neighbors distances and algorithms
for the reconstruction of gene regulatory networks.")
    (license license:agpl3+)))

(define-public r-partr2
  (package
    (name "r-partr2")
    (version "0.9.2")
    (source (origin
              (method url-fetch)
              (uri (cran-uri "partR2" version))
              (sha256
               (base32
                "09x8ykg90y4xq0sqm6zvx41sccgdbglmhpqm9sp3m74a87j4bjly"))))
    (properties `((upstream-name . "partR2")))
    (build-system r-build-system)
    (propagated-inputs (list r-dplyr
                             r-ggplot2
                             r-lme4
                             r-magrittr
                             r-pbapply
                             r-purrr
                             r-rlang
                             r-tibble
                             r-tidyr))
    (native-inputs (list r-furrr r-future r-knitr r-testthat))
    (home-page "https://github.com/mastoffel/partR2")
    (synopsis "Partitioning R2 in generalized linear mixed models")
    (description
     "This package provides an R tool for estimating and partitioning R2 in
@dfn{generalized linear mixed models} (GLMMs) based on predictor variance.")
    (license license:gpl2+)))

(define-public r-pscl
  (package
    (name "r-pscl")
    (version "1.5.9")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "pscl" version))
       (sha256
        (base32 "1zkfzrc1cr3f5dlz0mv45ym0as1yp9gicds6lhxpj13qk38zz1c0"))))
    (build-system r-build-system)
    (propagated-inputs
     (list r-mass))
    (home-page "https://github.com/atahk/pscl/")
    (synopsis "Political science computational laboratory")
    (description
     "The @code{pscl} is an R package providing classes and methods for:
@enumerate
@item Bayesian analysis of roll call data (item-response models);
@item elementary Bayesian statistics;
@item maximum likelihood estimation of zero-inflated and hurdle models for count
data;
@item utility functions.
@end enumerate")
    (license license:gpl2)))

(define-public r-accelmissing
  (package
    (name "r-accelmissing")
    (version "1.4")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "accelmissing" version))
       (sha256
        (base32 "1nql9inx6azdzi3z4sfm2vdml2mms6krl8wzlf1dn1c97ahn57fy"))))
    (build-system r-build-system)
    (propagated-inputs
     (list r-mice r-pscl))
    (home-page "https://cran.r-project.org/web/packages/accelmissing/")
    (synopsis "Missing value imputation for accelerometer data")
    (description
     "This package provides a statistical method to impute the missing values in
accelerometer data.  The methodology includes both parametric and
semi-parametric multiple imputations under the zero-inflated Poisson lognormal
model.  It also provides multiple functions to preprocess the accelerometer data
previous to the missing data imputation.  These include detecting the wearing
and the non-wearing time, selecting valid days and subjects, and creating plots.")
    (license license:gpl2+)))

(define-public r-mhsmm
  (package
    (name "r-mhsmm")
    (version "0.4.21")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "mhsmm" version))
       (sha256
        (base32 "1fibgpl65bl3rwlf9dhlams3gxbjqgwcd26gb0flp4wln6pl8d99"))))
    (build-system r-build-system)
    (propagated-inputs (list r-mvtnorm))
    (home-page "https://github.com/jaredo/mhsmm/")
    (synopsis "Inference for hidden Markov and semi-Markov models")
    (description
     "The @code{r-mhsmm} package implements estimation and prediction methods for
hidden Markov and semi-Markov models for multiple observation sequences.  Such
techniques are of interest when observed data is thought to be dependent on some
unobserved (or hidden) state.  Also, this package is suitable for equidistant
time series data, with multivariate and/or missing data.  Allows user defined
emission distributions.")
    (license license:gpl2+)))

(define-public r-nleqslv
  (package
    (name "r-nleqslv")
    (version "3.3.5")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "nleqslv" version))
       (sha256
        (base32 "0fjby0qva2lp2i7x752wva0z15xqys9fgrrcfimqszg65wnig60j"))))
    (build-system r-build-system)
    (native-inputs (list gfortran))
    (home-page "https://cran.r-project.org/web/packages/nleqslv/")
    (synopsis "Solve systems of nonlinear equations")
    (description
     "The @code{r-nleqslv} package solves a system of nonlinear equations using a
Broyden or a Newton method with a choice of global strategies such as line
search and trust region.  There are options for using a numerical or user
supplied Jacobian, for specifying a banded numerical Jacobian and for allowing a
singular or ill-conditioned Jacobian.")
    (license license:gpl2+)))

(define-public r-phyclust
  (package
    (name "r-phyclust")
    (version "0.1-34")
    (source (origin
              (method url-fetch)
              (uri (cran-uri "phyclust" version))
              (sha256
               (base32
                "1wzmd02ng7zphn97xdra3hgivrxqpizqcy5kpg45sk7jx4q7016j"))))
    (properties `((upstream-name . "phyclust")))
    (build-system r-build-system)
    (propagated-inputs (list r-ape))
    (home-page "https://snoweye.github.io/phyclust/")
    (synopsis "Studying phyloclustering and exploring DNA sequence data")
    (description
     "@dfn{Phylogenetic clustering} (phyloclustering) is an evolutionary continuous
time Markov Chain model-based approach to identify population structure from
molecular data without assuming linkage equilibrium.  The package @code{phyclust}
provides a convenient implementation of phyloclustering for DNA and SNP data,
capable of clustering individuals into subpopulations and identifying molecular
sequences representative of those subpopulations.  It is designed in @code{C} for
performance and interfaced with @code{R} for visualization.")
    (license license:gpl2+)))

(define-public r-phylolm
  (package
    (name "r-phylolm")
    (version "2.6.5")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "phylolm" version))
       (sha256
        (base32 "0sg2a7isy5f5phk2db4v2b78apdmd3k9c8jdwpkrm3lw7vxj52v5"))))
    (properties `((upstream-name . "phylolm")))
    (build-system r-build-system)
    (propagated-inputs (list r-ape r-future-apply))
    (native-inputs (list r-nlme r-testthat))
    (home-page "https://github.com/lamho86/phylolm")
    (synopsis "Phylogenetic linear regression")
    (description
     "This package provides functions for fitting phylogenetic linear models
and phylogenetic generalized linear models.  The computation uses an algorithm
that is linear in the number of tips in the tree.  The package also provides
functions for simulating continuous or binary traits along the tree.  Other
tools include functions to test the adequacy of a population tree.")
    (license license:gpl2+)))

(define-public r-physicalactivity
  (package
    (name "r-physicalactivity")
    (version "0.2-4")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "PhysicalActivity" version))
       (sha256
        (base32 "0b27prkv3x6v2afz0y53ccs9scibpc7nj54n0hpd9fgn1wyg4c40"))))
    (properties
     `((upstream-name . "PhysicalActivity")))
    (build-system r-build-system)
    (home-page "https://cran.r-project.org/web/packages/PhysicalActivity/")
    (synopsis "Processing accelerometer data for physical activity measurement")
    (description
     "This @code{r-physicalactivity} package provides a function @code{wearingMarking}
for classification of monitored wear and nonwear time intervals in accelerometer
data collected to assess physical activity.  The package also contains functions
for making plots of accelerometer data and obtaining the summary of various
information including daily monitor wear time and the mean monitor wear time
during valid days.  The revised package version 0.2-1 improved the functions
regarding speed, robustness and add better support for time zones and daylight
saving.  In addition, several functions were added:
@enumerate
@item the @code{markDelivery} can classify days for ActiGraph delivery by mail;
@item the @code{markPAI} can categorize physical activity intensity level based
on user-defined cut-points of accelerometer counts.
@end enumerate
  It also supports importing ActiGraph (AGD) files with @code{readActigraph} and
@code{queryActigraph} functions.")
    (license license:gpl3+)))

(define-public r-acc
  (package
    (name "r-acc")
    (version "1.3.3")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "acc" version))
       (sha256
        (base32 "1ii2vm47djxbixa75h690q1s2f9m9x6i8nkygik93j6dayr6kr1m"))))
    (build-system r-build-system)
    (propagated-inputs
     (list r-circlize
           r-dbi
           r-ggplot2
           r-iterators
           r-mhsmm
           r-nleqslv
           r-physicalactivity
           r-plyr
           r-r-utils
           r-rcpp
           r-rcpparmadillo
           r-rsqlite
           r-zoo))
    (home-page "https://cran.r-project.org/web/packages/acc/")
    (synopsis "Exploring accelerometer data")
    (description
     "This package processes accelerometer data from uni-axial and tri-axial devices
and generates data summaries.  Also, includes functions to plot, analyze, and
simulate accelerometer data.")
    (license license:gpl2+)))

(define-public r-rbenchmark
  (package
    (name "r-rbenchmark")
    (version "1.0.0")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "rbenchmark" version))
       (sha256
        (base32 "010fn3qwnk2k411cbqyvra1d12c3bhhl3spzm8kxffmirj4p2al9"))))
    (build-system r-build-system)
    (home-page "https://cran.r-project.org/web/packages/rbenchmark/")
    (synopsis "Benchmarking routine for R")
    (description
     "This @code{r-rbenchmark} package is inspired by the Perl module Benchmark,
and is intended to facilitate benchmarking of arbitrary R code.  The library
consists of just one function, benchmark, which is a simple wrapper around
system.time.  Given a specification of the benchmarking process (counts of
replications, evaluation environment) and an arbitrary number of expressions,
benchmark evaluates each of the expressions in the specified environment,
replicating the evaluation as many times as specified, and returning the results
conveniently wrapped into a data frame.")
    (license license:gpl2+)))

(define-public r-mitools
  (package
    (name "r-mitools")
    (version "2.4")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "mitools" version))
       (sha256
        (base32
         "0c2x2n1p53lcw0vx4vmy5j7m2f95i7g2iwbryl89imr99rvz617j"))))
    (build-system r-build-system)
    (propagated-inputs (list r-dbi))
    (home-page "https://cran.r-project.org/web/packages/mitools/")
    (synopsis "Tools for multiple imputation of missing data")
    (description
     "This package provides tools to perform analyses and combine results from
multiple-imputation datasets.")
    (license license:gpl2)))

(define-public r-mixsqp
  (package
   (name "r-mixsqp")
   (version "0.3-54")
   (source (origin
            (method url-fetch)
            (uri (cran-uri "mixsqp" version))
            (sha256
             (base32
              "13pv3mmz514kl4svxqwyk5b241dy1q52khwdc6rmh712ia8xxl7p"))))
   (properties `((upstream-name . "mixsqp")))
   (build-system r-build-system)
   (propagated-inputs
    (list r-irlba r-rcpp r-rcpparmadillo))
   (native-inputs
    (list r-knitr r-testthat))
   (home-page "https://github.com/stephenslab/mixsqp")
   (synopsis
    "Sequential quadratic programming for maximum-likelihood estimation")
   (description
    "This package provides an optimization method based on sequential
quadratic programming for maximum likelihood estimation of the mixture
proportions in a finite mixture model where the component densities are
known.  The algorithm is expected to obtain solutions that are at least
as accurate as the state-of-the-art MOSEK interior-point solver, and they
are expected to arrive at solutions more quickly when the number of
samples is large and the number of mixture components is not too large.")
   (license license:expat)))

(define-public r-magick
  (package
    (name "r-magick")
    (version "2.8.6")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "magick" version))
       (sha256
        (base32
         "19fli9blk5hmn9s3v9ppxpnyfyf9xbbv21kj3hn07382bfmbwf9h"))))
    (properties
     '((updater-extra-inputs . ("imagemagick"))))
    (build-system r-build-system)
    (inputs
     (list imagemagick pcre2 zlib))
    (propagated-inputs
     (list r-curl r-magrittr r-rcpp))
    (native-inputs
     (list pkg-config r-knitr r-spelling))
    (home-page "https://github.com/ropensci/magick")
    (synopsis "Advanced graphics and image-processing in R")
    (description
     "This package provides bindings to ImageMagick, a comprehensive image
processing library.  It supports many common formats (PNG, JPEG, TIFF, PDF,
etc.)  and manipulations (rotate, scale, crop, trim, flip, blur, etc).  All
operations are vectorized via the Magick++ STL meaning they operate either on
a single frame or a series of frames for working with layers, collages, or
animation.  In RStudio, images are automatically previewed when printed to the
console, resulting in an interactive editing environment.")
    (license license:expat)))

(define-public r-survey
  (package
    (name "r-survey")
    (version "4.4-2")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "survey" version))
       (sha256
        (base32
         "1ggisal5g16p3n03bch7ymawd4hig3fmm02nhxy1z5zh48qhyjla"))))
    (build-system r-build-system)
    (arguments
     (list
      #:phases
      '(modify-phases %standard-phases
         ;; This is needed for vignettes.
         (add-after 'unpack 'set-HOME
           (lambda _ (setenv "HOME" "/tmp"))))))
    (propagated-inputs
     (list r-lattice
           r-matrix
           r-minqa
           r-mitools
           r-numderiv
           r-rcpp
           r-rcpparmadillo
           r-survival))
    (native-inputs (list r-aer r-mass r-r-rsp r-rsqlite))
    (home-page "https://r-survey.r-forge.r-project.org/survey/")
    (synopsis "Analysis of complex survey samples")
    (description
     "This package provides tools for the analysis of complex survey samples.
The provided features include: summary statistics, two-sample tests, rank
tests, generalised linear models, cumulative link models, Cox models,
loglinear models, and general maximum pseudolikelihood estimation for
multistage stratified, cluster-sampled, unequally weighted survey samples;
variances by Taylor series linearisation or replicate weights;
post-stratification, calibration, and raking; two-phase subsampling designs;
graphics; PPS sampling without replacement; principal components, and factor
analysis.")
    ;; Either version of the GPL.
    (license (list license:gpl2 license:gpl3))))

(define-public r-gee
  (package
    (name "r-gee")
    (version "4.13-29")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "gee" version))
       (sha256
        (base32
         "157zqbshnmkhxbq5r0ss5mswhd7s603gjdgyv1wklagpq6qfz0z0"))))
    (properties `((upstream-name . "gee")))
    (build-system r-build-system)
    (native-inputs
     (list gfortran))
    (home-page "https://cran.r-project.org/web/packages/gee/")
    (synopsis "Generalized estimation equation solver")
    (description
     "This package provides a solver for generalized estimation equations.")
    (license license:gpl2)))

(define-public r-geepack
  (package
    (name "r-geepack")
    (version "1.3.12")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "geepack" version))
       (sha256
        (base32 "0k856hw7zh553yrqp9g3s19hjviadh36drg2vvaddv2ma5ayj6z0"))))
    (properties `((upstream-name . "geepack")))
    (build-system r-build-system)
    (propagated-inputs (list r-broom r-magrittr r-mass))
    (home-page "https://cran.r-project.org/package=geepack")
    (synopsis "Generalized estimating equation package")
    (description
     "This package provides a generalized estimating equations solver for
parameters in mean, scale, and correlation structures, through mean link,
scale link, and correlation link.  It can also handle clustered categorical
responses.")
    (license license:gpl3+)))

(define-public r-tab
  (package
    (name "r-tab")
    (version "5.1.1")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "tab" version))
       (sha256
        (base32
         "1kg8c1safi9klkx2mdkmsf5dn9piy4jljwd4ma7g4jz2rwl4jzhv"))))
    (properties `((upstream-name . "tab")))
    (build-system r-build-system)
    (propagated-inputs
     (list r-dplyr r-kableextra r-knitr r-mass r-survey))
    (native-inputs
     (list r-knitr))
    (home-page "https://cran.r-project.org/web/packages/tab/")
    (synopsis "Create summary tables for statistical reports")
    (description
     "This package contains functions for creating various types of summary
tables, e.g. comparing characteristics across levels of a categorical variable
and summarizing fitted generalized linear models, generalized estimating
equations, and Cox proportional hazards models.  Functions are available to
handle data from simple random samples as well as complex surveys.")
    (license license:gpl3+)))

(define-public r-tarchetypes
  (package
    (name "r-tarchetypes")
    (version "0.13.1")
    (source (origin
              (method url-fetch)
              (uri (cran-uri "tarchetypes" version))
              (sha256
               (base32
                "0h1d658crp717iwpc8q2ly1yybj4l33jr5gzgncx2b8mm14ykiij"))))
    (properties `((upstream-name . "tarchetypes")))
    (build-system r-build-system)
    ;; Many tests fail, because r-targets looks up the system's partitions,
    ;; which fails in the build environment.  Unfortunately, the error
    ;; messages are both verbose and close to useless, so I can't see how we
    ;; can work around this.
    (arguments (list #:test-types '(list "vignettes")))
    (propagated-inputs (list r-dplyr
                             r-fs
                             r-rlang
                             r-secretbase
                             r-targets
                             r-tibble
                             r-tidyselect
                             r-vctrs
                             r-withr))
    (native-inputs (list r-curl r-quarto r-rmarkdown r-testthat r-xml2))
    (home-page "https://docs.ropensci.org/tarchetypes/")
    (synopsis "Archetypes for Targets")
    (description
     "Function-oriented Make-like declarative pipelines for statistics and
data science are supported in the targets R package.  As an extension to
targets, the tarchetypes package provides convenient user-side functions to
make targets easier to use.  By establishing reusable archetypes for common
kinds of targets and pipelines, these functions help express complicated
reproducible pipelines concisely and compactly.  The methods in this package
were influenced by the drake R package by Will Landau (2018)
<doi:10.21105/joss.00550>.")
    (license license:expat)))

(define-public r-targets
  (package
    (name "r-targets")
    (version "1.11.3")
    (source (origin
              (method url-fetch)
              (uri (cran-uri "targets" version))
              (sha256
               (base32
                "1i99gl0ynfwckyq3ib6r3rscwpi91grj1k8w4z76k7djy7gyg5y9"))))
    (properties
     '((upstream-name . "targets")
       (updater-extra-native-inputs . ("r-crew"))))
    (build-system r-build-system)
    (arguments
     (list
      #:phases
      '(modify-phases %standard-phases
         (add-after 'unpack 'disable-bad-tests
           (lambda _
             ;; These tests fail with "Could not determine local IP".
             (substitute* "tests/testthat/test-class_builder.R"
               ((".*long chain of rev.*dep.*" m)
                (string-append m "skip('skip');\n"))))))))
    (propagated-inputs (list r-base64url
                             r-callr
                             r-cli
                             r-codetools
                             r-data-table
                             r-igraph
                             r-knitr
                             r-prettyunits
                             r-ps
                             r-r6
                             r-rlang
                             r-secretbase
                             r-tibble
                             r-tidyselect
                             r-vctrs
                             r-yaml))
    ;; The importer adds a large number of test inputs, but we really don't
    ;; need to add them.
    (native-inputs (list r-crew r-knitr r-testthat))
    (home-page "https://docs.ropensci.org/targets/")
    (synopsis "Dynamic function-oriented Make-like declarative pipelines")
    (description
     "This package provides a pipeline toolkit for statistics and data science
in R; the @code{targets} package brings function-oriented programming to
Make-like declarative pipelines.  It orchestrates a pipeline as a graph of
dependencies, skips steps that are already up to date, runs the necessary
computation with optional parallel workers, abstracts files as R objects, and
provides tangible evidence that the results are reproducible given the
underlying code and data.  The methodology in this package borrows from GNU
Make (2015, ISBN:978-9881443519) and drake (2018,
<doi:10.21105/joss.00550>).")
    (license license:expat)))

(define-public r-tidygeocoder
  (package
    (name "r-tidygeocoder")
    (version "1.0.6")
    (source (origin
              (method url-fetch)
              (uri (cran-uri "tidygeocoder" version))
              (sha256
               (base32
                "1x8040rkrw56bdy5wg9cr38hvx1myxmzpwxdrs85v39w9vjf0aqz"))))
    (properties `((upstream-name . "tidygeocoder")))
    (build-system r-build-system)
    (propagated-inputs (list r-dplyr r-httr r-jsonlite r-progress r-tibble))
    (native-inputs (list r-knitr r-testthat))
    (home-page "https://jessecambon.github.io/tidygeocoder/")
    (synopsis
     "Intuitive interface for getting data from geocoding services")
    (description
     "Tidygeocoder makes getting data from geocoding services easy.
A unified high-level interface is provided for a selection of supported
geocoding services and results are returned in tibble format.")
    (license license:expat)))

(define-public r-dvmisc
  (package
    (name "r-dvmisc")
    (version "1.1.4")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "dvmisc" version))
       (sha256
        (base32 "01v6sixx0f3nrn6ymfifb3pvd2msfrwm21kmdv38laxq29vc4rsi"))))
    (build-system r-build-system)
    (propagated-inputs
     (list r-cubature
           r-data-table
           r-dplyr
           r-ggplot2
           r-mass
           r-mvtnorm
           r-pracma
           r-rbenchmark
           r-rcpp
           r-survey
           r-tab))
    (home-page "https://cran.r-project.org/web/packages/dvmisc/")
    (synopsis "Faster computation of common statistics and miscellaneous functions")
    (description
     "This package implements faster versions of base R functions (e.g. mean, standard
deviation, covariance, weighted mean), mostly written in C++, along with
miscellaneous functions for various purposes (e.g. create the histogram with
fitted probability density function or probability mass function curve, create
the body mass index groups, assess the linearity assumption in logistic
regression).")
    (license license:gpl2)))

(define-public r-accelerometry
  (package
    (name "r-accelerometry")
    (version "3.1.2")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "accelerometry" version))
       (sha256
        (base32 "13xzrwhr4i1nj9c8vrmfdg2rmrc8n446iihcyxmy99sm99hpzyip"))))
    (build-system r-build-system)
    (propagated-inputs
     (list r-dvmisc r-rcpp))
    (home-page "https://cran.r-project.org/web/packages/accelerometry/")
    (synopsis "Functions for processing accelerometer data")
    (description
     "This package provides a collection of functions that perform operations on
time-series accelerometer data, such as identify the non-wear time, flag minutes
that are part of an activity bout, and find the maximum 10-minute average count
value.  The functions are generally very flexible, allowing for a variety of
algorithms to be implemented.")
    (license license:gpl3)))

(define-public r-absim
  (package
    (name "r-absim")
    (version "0.2.6")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "AbSim" version))
       (sha256
        (base32 "16ddjk8b6xw80ch4jis1y751i9561wdxh0gifbf15qiz3vjckq8m"))))
    (properties `((upstream-name . "AbSim")))
    (build-system r-build-system)
    (propagated-inputs
     (list r-ape r-powerlaw))
    (home-page "https://cran.r-project.org/web/packages/AbSim/")
    (synopsis "Time resolved simulations of antibody repertoires")
    (description
     "This package provides simulation methods for the evolution of antibody repertoires.
  The heavy and light chain variable region of both human and C57BL/6 mice can
be simulated in a time-dependent fashion.  Both single lineages using one set of
V-, D-, and J-genes or full repertoires can be simulated.  The algorithm begins
with an initial V-D-J recombination event, starting the first phylogenetic tree.
  Upon completion, the main loop of the algorithm begins, with each iteration
representing one simulated time step.  Various mutation events are possible at
each time step, contributing to a diverse final repertoire.")
    (license license:gpl2)))

(define-public r-quic
  (package
    (name "r-quic")
    (version "1.1")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "QUIC" version))
       (sha256
        (base32 "021bp9xbaih60qmss015ycblbv6d1dvb1z89y93zpqqnc2qhpv3c"))))
    (properties `((upstream-name . "QUIC")))
    (build-system r-build-system)
    (home-page "https://www.cs.utexas.edu/users/sustik/QUIC/")
    (synopsis "Regularized sparse inverse covariance matrix estimation")
    (description
     "This package implements the regularized Gaussian maximum likelihood
estimation of the inverse of a covariance matrix.  It uses Newton's method and
coordinate descent to solve the regularized inverse covariance matrix
estimation problem.")
    ;; The project home page states that the release is under GPLv3 or later.
    ;; The CRAN page only says GPL-3.
    (license license:gpl3+)))

(define-public r-quickjsr
  (package
    (name "r-quickjsr")
    (version "1.7.0")
    (source (origin
              (method url-fetch)
              (uri (cran-uri "QuickJSR" version))
              (sha256
               (base32
                "1s31sfcjnb7m4apibqs4rj418rc3ljvyc1sj3j8i524sf5r9mag8"))))
    (properties `((upstream-name . "QuickJSR")))
    (build-system r-build-system)
    (native-inputs (list r-knitr r-tinytest))
    (home-page "https://cran.r-project.org/package=QuickJSR")
    (synopsis "Interface for the QuickJS lightweight JavaScript engine")
    (description
     "This package provides an R interface to the @code{QuickJS} portable
@code{JavaScript} engine.  The engine is bundled entirely within the package,
requiring no external system dependencies beyond a C compiler.")
    (license license:expat)))

(define-public r-abundant
  (package
    (name "r-abundant")
    (version "1.2")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "abundant" version))
       (sha256
        (base32 "15m3ngj5aipjg961yy5kvdg9xlfcpliw30dq6gchzxabhnfzcipd"))))
    (build-system r-build-system)
    (propagated-inputs
     (list r-glasso))
    (home-page "https://cran.r-project.org/web/packages/abundant/")
    (synopsis "Abundant regression and high-dimensional principal fitted components")
    (description
     "This package provides tools to fit and predict with the high-dimensional
principal fitted components model.  This model is described by Cook, Forzani,
and Rothman (2012) @url{doi:10.1214/11-AOS962}.")
    ;; The DESCRIPTION file states GPL-2, but since it directly depends on a
    ;; GPLv3+ package (QUIC) this likely means GPLv2+.
    (license license:gpl2+)))

(define-public r-ac3net
  (package
    (name "r-ac3net")
    (version "1.2.2")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "Ac3net" version))
       (sha256
        (base32 "1ns4n0xxz6p34c11bj0k7nzgmyqr9mis2b0g5nfz37dbikndyqyz"))))
    (properties `((upstream-name . "Ac3net")))
    (build-system r-build-system)
    (propagated-inputs
     (list r-data-table))
    (home-page "https://cran.r-project.org/web/packages/Ac3net/")
    (synopsis "Inferring directional conservative causal core gene networks")
    (description "This package infers directional Conservative causal core
(gene) networks (C3NET).  This is a version of the algorithm C3NET with
directional network.")
    (license license:gpl3+)))

(define-public r-aca
  (package
    (name "r-aca")
    (version "1.1")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "ACA" version))
       (sha256
        (base32 "1i3hm27nvnkvc39xlh0d1blq8q0q02czmvgi3cazmjx3jvxay0vq"))))
    (properties `((upstream-name . "ACA")))
    (build-system r-build-system)
    (home-page "https://cran.r-project.org/web/packages/ACA/")
    (synopsis "Abrupt change-point or aberration detection in point series")
    (description
     "This package offers an interactive function for the detection of breakpoints in
series.")
    ;; Any version of the GPL
    (license (list license:gpl2+ license:gpl3+))))

(define-public r-acceptancesampling
  (package
    (name "r-acceptancesampling")
    (version "1.0-10")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "AcceptanceSampling" version))
       (sha256
        (base32 "1sbv2yrvnn0zgdmqvjlmz2vllsg6r9nlmxdgadhymhm9s51gfx65"))))
    (properties
     `((upstream-name . "AcceptanceSampling")))
    (build-system r-build-system)
    (home-page "https://cran.r-project.org/web/packages/AcceptanceSampling/")
    (synopsis "Creation and evaluation of acceptance sampling plans")
    (description
     "This @code{r-acceptancesampling} provides functionality for creating and evaluating
acceptance sampling plans.  Acceptance sampling is a methodology commonly used
in quality control and improvement.  International standards of acceptance
sampling provide sampling plans for specific circumstances.  The aim of this
package is to provide an easy-to-use interface to visualize single, double or
multiple sampling plans.  In addition, methods have been provided to enable the
user to assess sampling plans against pre-specified levels of performance, as
measured by the probability of acceptance for a given level of quality in the
lot.")
    (license license:gpl3+)))

(define-public r-acclma
  (package
    (name "r-acclma")
    (version "1.0")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "ACCLMA" version))
       (sha256
        (base32 "1na27sp18fq12gp6vxgqw1ffsz2yi1d8xvrxbrzx5g1kqxrayy0v"))))
    (properties `((upstream-name . "ACCLMA")))
    (build-system r-build-system)
    (home-page "https://cran.r-project.org/web/packages/ACCLMA/")
    (synopsis "ACC & LMA graph plotting")
    (description
     "This package contains a function that imports data from a @acronym{CSV,
Comma-Separated Values} file, or uses manually entered data from the format (x,
y, weight) and plots the appropriate @acronym{ACC, Absolute Concentration
Curve} vs @acronym{LOI, Line of Independence} graph and
@acronym{LMA, @acronym{LOI} Minus @acronym{ACC}} graph.  The main
function is @code{plotLMA} (source file, header) that takes a data set and plots the
appropriate @acronym{LMA} and @acronym{ACC} graphs.  If no source file (a
string) was passed, a manual data entry window is opened.  The header parameter
indicates by TRUE/FALSE (false by default) if the source @acronym{CSV} file has
a header row or not.  The dataset should contain only one independent variable
(x) and one dependent variable (y) and can contain a weight for each
observation.")
    (license license:gpl2)))

(define-public r-aspi
  (package
    (name "r-aspi")
    (version "0.2.0")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "aspi" version))
       (sha256
        (base32 "0rhvxw243vvdv3hxa6pi343gcjc2cbxq1jzqirl9k1l4i3897l87"))))
    (build-system r-build-system)
    (native-inputs (list r-knitr r-testthat))
    (home-page "https://cran.r-project.org/web/packages/aspi/")
    (synopsis "Analysis of symmetry of parasitic infections")
    (description
     "This package provides tools for the analysis and visualization of
bilateral asymmetry in parasitic infections.")
    (license license:gpl3+)))

(define-public r-sandwich
  (package
    (name "r-sandwich")
    (version "3.1-1")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "sandwich" version))
       (sha256
        (base32
         "06cikmpgv0dla92dhp8i89wj52wjwky1g4sb9cxqpac38bx1xrgc"))
       (modules '((guix build utils)))
       (snippet
        '(with-directory-excursion "inst/doc"
           ;; These files are generated from Rnw files.
           (for-each delete-file
                     (list "sandwich-OOP.pdf"
                           "sandwich-OOP.R"
                           "sandwich-OOP.Rnw"
                           "sandwich-CL.R"
                           "sandwich-CL.Rnw"
                           "sandwich-CL.pdf"
                           "sim-CL.rda"
                           "sim-CL.R"
                           "sandwich.pdf"
                           "sandwich.R"))))))
    (build-system r-build-system)
    (propagated-inputs
     (list r-zoo))
    (home-page "https://cran.r-project.org/web/packages/sandwich/")
    (synopsis "Robust Covariance Matrix Estimators")
    (description
     "This package provides model-robust standard error estimators for
cross-sectional, time series, clustered, panel, and longitudinal data.")
    ;; Either version of the license.
    (license (list license:gpl2 license:gpl3))))

(define-public r-th-data
  (package
    (name "r-th-data")
    (version "1.1-3")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "TH.data" version))
       (sha256
        (base32
         "0fy6dp66r8l4pdhdn2k6rbyqyn411mrj05faylffgi20r4a81sz2"))))
    (properties
     `((upstream-name . "TH.data")
       (updater-ignored-native-inputs
        . ("r-coin" "r-multcomp" "r-rms"))))
    (build-system r-build-system)
    (propagated-inputs
     (list r-mass r-survival))
    (native-inputs
     (list r-colorspace
           r-gridextra
           r-knitr
           r-lattice
           r-vcd))
    (home-page "https://cran.r-project.org/web/packages/TH.data/")
    (synopsis "Shared data sets")
    (description
     "This package contains supporting data sets that are used in other
packages maintained by Torsten Hothorn.")
    (license license:gpl3)))

(define-public r-themis
  (package
    (name "r-themis")
    (version "1.0.3")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "themis" version))
       (sha256
        (base32 "13biv9pizp7zrcgjq5ynnr64c6ivvhzy17vkvzv0dvrf4pm49jqb"))))
    (properties `((upstream-name . "themis")))
    (build-system r-build-system)
    (propagated-inputs (list r-cli
                             r-dplyr
                             r-generics
                             r-glue
                             r-gower
                             r-hardhat
                             r-lifecycle
                             r-purrr
                             r-rann
                             r-recipes
                             r-rlang
                             r-rose
                             r-tibble
                             r-vctrs
                             r-withr))
    (native-inputs (list r-testthat))
    (home-page "https://github.com/tidymodels/themis")
    (synopsis "Extra recipes steps for dealing with unbalanced data")
    (description
     "This package provides a dataset with an uneven number of cases in each
class is said to be unbalanced.  Many models produce a subpar performance on
unbalanced datasets.")
    (license license:expat)))

(define-public r-multcomp
  (package
    (name "r-multcomp")
    (version "1.4-28")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "multcomp" version))
       (sha256
        (base32
         "02m6bg64ys582dingsr0sfpdf5lnkz8rxvs3ybbdgqqns5cghd93"))))
    (build-system r-build-system)
    ;; Vignettes require r-coin, but r-coin depends on r-multcomp.
    (arguments (list #:test-types '(list "tests")))
    (propagated-inputs
     (list r-codetools r-mvtnorm r-sandwich r-survival r-th-data))
    (native-inputs (list r-foreign
                         r-lme4
                         r-mass
                         r-robustbase
                         r-xtable))
    (home-page "https://cran.r-project.org/web/packages/multcomp/")
    (synopsis "Simultaneous inference in general parametric models")
    (description
     "Simultaneous tests and confidence intervals for general linear
hypotheses in parametric models, including linear, generalized linear, linear
mixed effects, and survival models.  The package includes demos reproducing
analyzes presented in the book \"Multiple Comparisons Using R\" (Bretz,
Hothorn, Westfall, 2010, CRC Press).")
    (license license:gpl2)))

(define-public r-multcompview
  (package
    (name "r-multcompview")
    (version "0.1-10")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "multcompView" version))
       (sha256
        (base32 "12mdk12xciq1d3zn94rixahhcah2qq41lvb5n4kzgjaq4yr4kwiq"))))
    (properties `((upstream-name . "multcompView")))
    (build-system r-build-system)
    (home-page "https://cran.r-project.org/package=multcompView")
    (synopsis "Visualizations of paired comparisons")
    (description
     "Convert a logical vector or a vector of p-values or a correlation,
difference, or distance matrix into a display identifying the pairs for which
the differences were not significantly different.")
    ;; Any version of the GPL.
    (license license:gpl3+)))

(define-public r-emmeans
  (package
    (name "r-emmeans")
    (version "1.11.1")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "emmeans" version))
       (sha256
        (base32
         "1iw4rf24al6bcg818b38iag0k947f32y2ipwrrzpaykxd68nyfv8"))))
    (build-system r-build-system)
    (propagated-inputs
     (list r-estimability r-mvtnorm r-numderiv))
    (native-inputs
     (list r-knitr r-testthat))
    (home-page "https://github.com/rvlenth/emmeans")
    (synopsis "Estimated marginal means, aka least-squares means")
    (description
     "This package provides tools to obtain @dfn{estimated marginal
means} (EMMs) for many linear, generalized linear, and mixed models.  It can
be used to compute contrasts or linear functions of EMMs, trends, and
comparisons of slopes.")
    ;; Either version of the license.
    (license (list license:gpl2 license:gpl3))))

(define-public r-pwr
  (package
    (name "r-pwr")
    (version "1.3-0")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "pwr" version))
       (sha256
        (base32
         "1kfzy73v3z6ipc3kdfkcjrp4b4p5k54nwk796gqi36srm93hgc2v"))))
    (build-system r-build-system)
    (native-inputs
     (list r-knitr))
    (home-page "https://github.com/heliosdrm/pwr")
    (synopsis "Basic functions for power analysis")
    (description
     "This package provides power analysis functions along the lines of
Cohen (1988).")
    (license license:gpl3+)))

(define-public r-libcoin
  (package
    (name "r-libcoin")
    (version "1.0-10")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "libcoin" version))
       (sha256
        (base32 "1bvysrq2s3951vr5ab1jzbz4hyx5j04yzh04vxdpd287bm4y08rh"))))
    (build-system r-build-system)
    (arguments
     (list
      #:phases
      '(modify-phases %standard-phases
         (add-after 'unpack 'delete-bad-tests
           (lambda _
             ;; This file requires r-coin, which depends on this package.
             (delete-file "tests/regtest_libcoin.R"))))))
    (propagated-inputs (list r-mvtnorm))
    (home-page "https://cran.r-project.org/web/packages/libcoin")
    (synopsis "Linear test statistics for permutation inference")
    (description
     "This package provides basic infrastructure for linear test statistics
and permutation inference in the framework of Strasser and Weber (1999).")
    (license license:gpl2)))

(define-public r-libgeos
  (package
    (name "r-libgeos")
    (version "3.11.1-3")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "libgeos" version))
       (sha256
        (base32 "1w83i5afbvgjhj64y6ml5x9dd8g803rs44r792kdirm8njzfa3g1"))))
    (properties `((upstream-name . "libgeos")))
    (build-system r-build-system)
    (native-inputs (list r-testthat))
    (home-page "https://paleolimbot.github.io/libgeos/")
    (synopsis "Open Source Geometry Engine (GEOS) C API")
    (description
     "This package provides the Open Source Geometry Engine (GEOS) as a C API
that can be used to write high-performance C and C++ geometry operations using
R as an interface.  Headers are provided to make linking to and using these
functions from C++ code as easy and as safe as possible.  This package
contains an internal copy of the GEOS library to guarantee the best possible
consistency on multiple platforms.")
    (license license:lgpl2.1+)))

(define-public r-coin
  (package
    (name "r-coin")
    (version "1.4-3")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "coin" version))
       (sha256
        (base32
         "0x5rh002w4xgczbvnh7qfv3qv4iv7p6vdrwwyvchqmzgygdh4qwa"))))
    (build-system r-build-system)
    (propagated-inputs
     (list r-libcoin
           r-matrixstats
           r-modeltools
           r-multcomp
           r-mvtnorm
           r-survival))
    (native-inputs (list r-e1071 r-vcd r-xtable))
    (home-page "https://coin.r-forge.r-project.org")
    (synopsis "Conditional inference procedures in a permutation test framework")
    (description
     "This package provides conditional inference procedures for the general
independence problem including two-sample, K-sample (non-parametric ANOVA),
correlation, censored, ordered and multivariate problems.")
    (license license:gpl2)))

(define-public r-bayesplot
  (package
    (name "r-bayesplot")
    (version "1.12.0")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "bayesplot" version))
       (sha256
        (base32
         "1savil71px6p6nsz01jj4fapzccz62aqbb80fman5ysk5slyaqxi"))))
    (properties
     ;; Avoid dependency cycle.
     '((updater-ignored-native-inputs . ("r-rstanarm"))))
    (build-system r-build-system)
    (inputs
     (list pandoc))
    (native-inputs
     (list r-cmdstanr
           r-devtools
           r-gridextra
           r-knitr
           r-loo
           r-rcolorbrewer
           r-rstan
           r-rstantools
           r-testthat
           r-vdiffr))
    (propagated-inputs
     (list r-dplyr
           r-ggplot2
           r-ggridges
           r-glue
           r-posterior
           r-reshape2
           r-rlang
           r-tibble
           r-tidyr
           r-tidyselect))
    (home-page "https://mc-stan.org/bayesplot")
    (synopsis "Plotting for Bayesian models")
    (description
     "This package provides plotting functions for posterior analysis, model
checking, and MCMC diagnostics.  The package is designed not only to provide
convenient functionality for users, but also a common set of functions that
can be easily used by developers working on a variety of R packages for
Bayesian modeling.")
    (license license:gpl3+)))

(define-public r-tmb
  (package
    (name "r-tmb")
    (version "1.9.17")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "TMB" version))
       (sha256
        (base32
         "0abmczkgxa2lp4259scvixwhf55cj4l17qzj37fy43c15fdxzi4a"))))
    (properties `((upstream-name . "TMB")))
    (build-system r-build-system)
    (propagated-inputs
     (list r-matrix r-rcppeigen))
    (home-page "http://tmb-project.org")
    (synopsis "Template model builder: a general random effect tool")
    (description
     "With this tool, a user should be able to quickly implement complex
random effect models through simple C++ templates.  The package combines
@code{CppAD} (C++ automatic differentiation), @code{Eigen} (templated
matrix-vector library) and @code{CHOLMOD} (sparse matrix routines available
from R) to obtain an efficient implementation of the applied Laplace
approximation with exact derivatives.  Key features are: Automatic sparseness
detection, parallelism through BLAS and parallel user templates.")
    (license license:gpl2)))

(define-public r-sjstats
  (package
    (name "r-sjstats")
    (version "0.19.0")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "sjstats" version))
       (sha256
        (base32 "07qv32gnrhrl21zgj1xp1gqdqjn6ax1nf40s11nmpag8r0xgvqnk"))))
    (properties
     '((updater-extra-native-inputs . ("r-mass"))))
    (build-system r-build-system)
    (propagated-inputs
     (list r-datawizard r-effectsize r-insight r-parameters r-performance))
    (native-inputs (list r-mass r-testthat))
    (home-page "https://github.com/strengejacke/sjstats")
    (synopsis "Functions for common statistical computations")
    (description
     "This package provides a collection of convenient functions for common
statistical computations, which are not directly provided by R's @code{base}
or @code{stats} packages.  This package aims at providing, first, shortcuts
for statistical measures, which otherwise could only be calculated with
additional effort.  Second, these shortcut functions are generic, and can be
applied not only to vectors, but also to other objects as well.  The focus of
most functions lies on summary statistics or fit measures for regression
models, including generalized linear models, mixed effects models and Bayesian
models.")
    (license license:gpl3)))

(define-public r-glmmadaptive
  (package
    (name "r-glmmadaptive")
    (version "0.9-7")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "GLMMadaptive" version))
       (sha256
        (base32 "0g71ysa1g4pk59v0m9s2l45f0ik5h3dc23hjv8513lcrj3jc471z"))))
    (properties `((upstream-name . "GLMMadaptive")))
    (build-system r-build-system)
    (propagated-inputs (list r-mass r-matrixstats r-nlme))
    (native-inputs (list r-knitr))
    (home-page "https://drizopoulos.github.io/GLMMadaptive/")
    (synopsis
     "Generalized Linear Mixed Models using adaptive gaussian quadrature")
    (description
     "This package lets you fit generalized linear mixed models for a single
grouping factor under maximum likelihood approximating the integrals over the
random effects with an adaptive Gaussian quadrature rule; Jose C. Pinheiro and
Douglas M. Bates (1995) <doi:10.1080/10618600.1995.10474663>.")
    (license license:gpl3+)))

(define-public r-glmmml
  (package
    (name "r-glmmml")
    (version "1.1.7")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "glmmML" version))
       (sha256
        (base32 "07w6b1i9fkv8dxcmvky81f87ysbrrry3d4jczwkg953g9lankr5j"))))
    (properties `((upstream-name . "glmmML")))
    (build-system r-build-system)
    (native-inputs (list gfortran r-knitr))
    (home-page "https://cran.r-project.org/package=glmmML")
    (synopsis "Generalized linear models with clustering")
    (description
     "This is a package for binomial and Poisson regression for clustered
data, fixed and random effects with bootstrapping.")
    (license license:gpl3+)))

(define-public r-glmmtmb
  (package
    (name "r-glmmtmb")
    (version "1.1.11")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "glmmTMB" version))
       (sha256
        (base32
         "0qkwskjb5ciwj1pcfgrpxhna1f7l9mbzgls72kvcd8i7y11mpl1c"))))
    (properties `((upstream-name . "glmmTMB")))
    (build-system r-build-system)
    ;; TODO: tests take forever and eventually the build times out.
    (arguments (list #:tests? #false))
    (propagated-inputs
     (list r-lme4
           r-matrix
           r-mgcv
           r-nlme
           r-numderiv
           r-rcppeigen
           r-reformulas
           r-tmb))
    (native-inputs
     (list r-knitr r-rmarkdown r-testthat)) ; for vignettes
    (home-page "https://github.com/glmmTMB")
    (synopsis "Generalized linear mixed models")
    (description
     "Fit linear and generalized linear mixed models with various extensions,
including zero-inflation.  The models are fitted using maximum likelihood
estimation via the Template Model Builder.  Random effects are assumed to be
Gaussian on the scale of the linear predictor and are integrated out using the
Laplace approximation.  Gradients are calculated using automatic
differentiation.")
    (license license:agpl3+)))

(define-public r-glmtoolbox
  (package
    (name "r-glmtoolbox")
    (version "0.1.12")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "glmtoolbox" version))
       (sha256
        (base32 "1nzn5nqicry2687d0nx6dacy0kbl0fzsw2wqwwi07mc12b84m7j9"))))
    (properties `((upstream-name . "glmtoolbox")))
    (build-system r-build-system)
    (propagated-inputs (list r-broom
                             r-formula
                             r-mass
                             r-numderiv
                             r-rfast
                             r-statmod
                             r-suppdists))
    (home-page "https://mlgs.netlify.app/")
    (synopsis "Set of tools to data analysis using generalized linear models")
    (description
     "This package provides a set of tools for the statistical analysis of
data using:

@enumerate
@item normal linear models;
@item generalized linear models;
@item negative binomial regression models as alternative to the Poisson
  regression models under the presence of overdispersion;
@item beta-binomial and random-clumped binomial regression models as
  alternative to the binomial regression models under the presence of
  overdispersion;
@item zero-inflated and zero-altered regression models to deal with
  zero-excess in count data;
@item generalized nonlinear models;
@item generalized estimating equations for cluster correlated data.
@end enumerate
")
    (license (list license:gpl2 license:gpl3))))

(define-public r-bayestestr
  (package
    (name "r-bayestestr")
    (version "0.16.0")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "bayestestR" version))
       (sha256
        (base32
         "0zcqfqx3my6rdxzq3miq0plmdrj4czynax3zhp7x1ac4als1dyl3"))))
    (properties
     '((upstream-name . "bayestestR")
       (updater-extra-native-inputs . ("r-logspline"))
       (updater-ignored-native-inputs . ("r-modelbased"))))
    (build-system r-build-system)
    (propagated-inputs
     (list r-datawizard r-insight))
    (native-inputs
     (list r-bayesfactor
           r-blavaan
           r-bridgesampling
           r-brms
           r-cmdstanr
           r-emmeans
           r-glmmtmb
           r-knitr
           r-lme4
           r-logspline
           r-marginaleffects
           r-posterior
           r-rstanarm
           r-testthat
           r-withr))
    (home-page "https://github.com/easystats/bayestestR")
    (synopsis "Describe Bayesian models and posterior distributions")
    (description
     "This package provides utilities to understand and describe posterior
distributions and Bayesian models.  It includes point-estimates such as
@dfn{Maximum A Posteriori} (MAP), measures of dispersion such as @dfn{Highest
Density Interval} (HDI), and indices used for null-hypothesis testing (such as
ROPE percentage and pd).")
    (license license:gpl3)))

(define-public r-performance
  (package
    (name "r-performance")
    (version "0.14.0")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "performance" version))
       (sha256
        (base32
         "1sibccf0kswv8gv8mk91593ikzkqigsj6n1bjflacihhjrpxyn1a"))))
    (properties
     '((updater-extra-native-inputs . ("r-dharma"))))
    (build-system r-build-system)
    (propagated-inputs
     (list r-bayestestr r-datawizard r-insight))
    (native-inputs (list r-aer
                         r-afex
                         r-bayesfactor
                         r-betareg
                         r-dharma
                         r-dirichletreg
                         r-fixest
                         r-gamm4
                         r-glmmtmb
                         r-lme4
                         r-lmtest
                         r-mass
                         r-mclogit
                         r-metafor
                         r-mgcv
                         r-nlme
                         r-nonnest2
                         r-ordinal
                         r-parameters
                         r-pscl
                         r-quantreg
                         r-rstanarm
                         r-survival
                         r-testthat
                         r-withr))
    (home-page "https://easystats.github.io/performance/")
    (synopsis "Assessment of regression models performance")
    (description
     "This package provides utilities for computing measures to assess model
quality, which are not directly provided by R's @code{base} or @code{stats}
packages.  These include e.g. measures like r-squared, intraclass correlation
coefficient, root mean squared error or functions to check models for
overdispersion, singularity or zero-inflation and more.  Functions apply to a
large variety of regression models, including generalized linear models, mixed
effects models and Bayesian models.")
    (license license:gpl3)))

(define-public r-ggeffects
  (package
    (name "r-ggeffects")
    (version "2.2.1")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "ggeffects" version))
       (sha256
        (base32
         "1q616qzqpxjrlswhcam34j24nqvajvhi7c8n2ca088jl22szvp2i"))))
    (build-system r-build-system)
    (propagated-inputs
     (list r-datawizard r-insight))
    (native-inputs
     ;; The importer/updater generates a massive list of inputs for running
     ;; tests, but we actually don't need them.
     (list r-knitr r-testthat))
    (home-page "https://github.com/strengejacke/ggeffects")
    (synopsis "Create tidy data frames of marginal effects for ggplot")
    (description
     "This package provides tools to compute marginal effects from statistical
models and return the result as tidy data frames.  These data frames are ready
to use with the @code{ggplot2} package.  Marginal effects can be calculated
for many different models.  Interaction terms, splines and polynomial terms
are also supported.  The two main functions are @code{ggpredict()} and
@code{ggeffect()}.  There is a generic @code{plot()} method to plot the
results using @code{ggplot2}.")
    (license license:gpl3)))

(define-public r-effectsize
  (package
    (name "r-effectsize")
    (version "1.0.1")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "effectsize" version))
       (sha256
        (base32
         "1lq23s8nnya4l79ahfr9dh1b9ncgw3r8x2qz0i81ca683lh5kzrd"))))
    (properties `((upstream-name . "effectsize")))
    (build-system r-build-system)
    (propagated-inputs
     (list r-bayestestr r-datawizard r-insight r-parameters r-performance))
    (native-inputs
     (list r-afex
           r-bayesfactor
           r-car
           r-correlation
           r-knitr
           r-lavaan
           r-lme4
           r-lmeinfo
           r-lmertest
           r-mgcv
           r-nlme
           r-parsnip
           r-propcis
           r-rms
           r-rstanarm
           r-testthat))
    (home-page "https://github.com/easystats/effectsize")
    (synopsis "Indices of effect size and standardized parameters")
    (description
     "This package provides utilities to work with indices of effect size and
standardized parameters for a wide variety of models, allowing computation and
conversion of indices such as Cohen's d, r, odds, etc.")
    (license license:gpl3)))

(define-public r-effsize
  (package
    (name "r-effsize")
    (version "0.8.1")
    (source (origin
              (method url-fetch)
              (uri (cran-uri "effsize" version))
              (sha256
               (base32
                "1m5ch2g77f4ldbxhzp2ls1pga8hq7ggkz1xs8a90h0s09rj0gd7w"))))
    (properties `((upstream-name . "effsize")))
    (build-system r-build-system)
    (native-inputs (list r-testthat))
    (home-page "https://github.com/mtorchiano/effsize/")
    (synopsis "Efficient effect size computation")
    (description
     "This package provides a collection of functions to compute the
standardized effect sizes for experiments (Cohen d, Hedges g, Cliff delta,
Vargha-Delaney A).  The computation algorithms have been optimized to allow
efficient computation even with very large data sets.")
    (license license:gpl2)))

(define-public r-sjplot
  (package
    (name "r-sjplot")
    (version "2.8.17")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "sjPlot" version))
       (sha256
        (base32 "0rai02bnqj5q829f35vw1z779cyw4rx84w6ngv7mpiagw3nb6agj"))))
    (properties `((upstream-name . "sjPlot")))
    (build-system r-build-system)
    (propagated-inputs
     (list r-bayestestr
           r-datawizard
           r-dplyr
           r-ggeffects
           r-ggplot2
           r-insight
           r-knitr
           r-mass
           r-parameters
           r-performance
           r-purrr
           r-rlang
           r-scales
           r-sjlabelled
           r-sjmisc
           r-sjstats
           r-tidyr))
    (native-inputs
     (list r-glmmtmb
           r-haven
           r-knitr
           r-lme4
           r-rstanarm
           r-testthat))
    (home-page "https://strengejacke.github.io/sjPlot/")
    (synopsis "Data visualization for statistics in social science")
    (description
     "This package represents a collection of plotting and table output
functions for data visualization.  Results of various statistical
analyses (that are commonly used in social sciences) can be visualized using
this package, including simple and cross tabulated frequencies, histograms,
box plots, (generalized) linear models, mixed effects models, principal
component analysis and correlation matrices, cluster analyses, scatter plots,
stacked scales, effects plots of regression models (including interaction
terms) and much more.  This package supports labelled data.")
    (license license:gpl3)))

(define-public r-ini
  (package
    (name "r-ini")
    (version "0.3.1")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "ini" version))
       (sha256
        (base32
         "04yqij344dwm0xqgara8xia42mlmij3i8711qbb5534w05a1l6bv"))))
    (build-system r-build-system)
    (native-inputs (list r-testthat))
    (home-page "https://github.com/dvdscripter/ini")
    (synopsis "Read and write configuration files")
    (description
     "This package provides tools to parse simple @code{.ini} configuration
files to an structured list.  Users can manipulate this resulting list with
@code{lapply()} functions.  This same structured list can be used to write
back to file after modifications.")
    (license license:gpl3)))

(define-public r-gillespiessa2
  (package
    (name "r-gillespiessa2")
    (version "0.3.0")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "GillespieSSA2" version))
       (sha256
        (base32 "0wjz0fh9cwvaw6n7hs2lkh818jzbjl11ps5gxnjqizz8gfp9fr10"))))
    (properties
     '((upstream-name . "GillespieSSA2")
       (updater-extra-native-inputs . ("r-ggplot2"))))
    (build-system r-build-system)
    (propagated-inputs
     (list r-assertthat
           r-dplyr
           r-dynutils
           r-matrix
           r-purrr
           r-rcpp
           r-rcppxptrutils
           r-readr
           r-rlang
           r-stringr
           r-tidyr))
    (native-inputs (list r-ggplot2 r-knitr r-testthat))
    (home-page "https://github.com/rcannood/GillespieSSA2")
    (synopsis "Gillespie's stochastic simulation algorithm")
    (description
     "This package provides a fast, scalable, and versatile framework for
simulating large systems with Gillespie's @dfn{Stochastic Simulation
Algorithm} (SSA).  This package is the spiritual successor to the GillespieSSA
package.  Benefits of this package include major speed improvements (>100x),
easier to understand documentation, and many unit tests that try to ensure the
package works as intended.")
    (license license:gpl3+)))

(define-public r-gitcreds
  (package
    (name "r-gitcreds")
    (version "0.1.2")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "gitcreds" version))
       (sha256
        (base32
         "0pf70g4a2kxjcid5rc4ppmgcl3kpjhkszdgz4fqn4l33lp6apij1"))))
    (properties
     `((upstream-name . "gitcreds")
       (updater-extra-native-inputs . ("r-mockery" "r-codetools"))))
    (build-system r-build-system)
    (inputs (list git-minimal/pinned))
    (native-inputs (list r-codetools r-knitr r-mockery r-testthat))
    (home-page "https://github.com/r-lib/gitcreds")
    (synopsis "Query git credentials from R")
    (description
     "Query, set, and delete credentials from the git credential store.
Manage GitHub tokens and other git credentials.  This package is to be used by
other packages that need to authenticate to GitHub and/or other git
repositories.")
    (license license:expat)))

(define-public r-gh
  (package
    (name "r-gh")
    (version "1.5.0")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "gh" version))
       (sha256
        (base32
         "13lv6bh3g28s9z4v4y8h8hin2gb5igdy2xbd2n8cf3wnhhq0cni9"))))
    (properties
     '((updater-ignored-native-inputs . ("r-connectcreds"))))
    (build-system r-build-system)
    (propagated-inputs
     (list r-cli
           r-gitcreds
           r-glue
           r-httr2
           r-ini
           r-jsonlite
           r-lifecycle
           r-rlang))
    (native-inputs
     (list r-knitr
           r-rprojroot
           r-spelling
           r-testthat
           r-withr))
    (home-page "https://github.com/r-lib/gh#readme")
    (synopsis "Access the GitHub API via R")
    (description
     "This package provides a minimal R client to access the GitHub API.")
    (license license:expat)))

(define-public r-fs
  (package
    (name "r-fs")
    (version "1.6.6")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "fs" version))
       (sha256
        (base32
         "02l5ymh77c3yfm3vbi23zryl6ank0y7d20crzvk2iv1g9s2a1lsp"))))
    (properties
     '((updater-ignored-native-inputs
        . ("r-testthat" "r-spelling" "r-vctrs" "r-withr"))))
    (build-system r-build-system)
    ;; Tests require r-testthat, which indirectly depends on this package.
    (arguments (list #:tests? #false))
    (native-inputs
     (list r-knitr))
    (home-page "https://fs.r-lib.org")
    (synopsis "Cross-platform file system operations based on libuv")
    (description
     "This package provides a cross-platform interface to file system
operations, built on top of the libuv C library.")
    (license license:gpl3)))

(define-public r-clisymbols
  (package
    (name "r-clisymbols")
    (version "1.2.0")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "clisymbols" version))
       (sha256
        (base32
         "1q7gi2zmykhzas9v8fdnbpdq7pzdcpbhim1yxvd2062l777g4j86"))))
    (build-system r-build-system)
    (native-inputs (list r-testthat))
    (home-page "https://github.com/gaborcsardi/clisymbols")
    (synopsis "Unicode symbols at the R prompt")
    (description
     "This package provides a small subset of Unicode symbols, that are useful
when building command line applications.  They fall back to alternatives on
terminals that do not support Unicode.")
    (license license:expat)))

(define-public r-credentials
  (package
    (name "r-credentials")
    (version "2.0.2")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "credentials" version))
       (sha256
        (base32
         "02jxbd6nwii243r88h57h9z37knl7jm1jdzg9bpd6g5r6a4dfss9"))))
    (properties `((upstream-name . "credentials")))
    (build-system r-build-system)
    (arguments
     `(#:phases
       (modify-phases %standard-phases
         (add-after 'unpack 'setenv-HOME
           (lambda _
             ;; This is necessary because git looks for $HOME/.gitconfig
             (setenv "HOME" "/tmp"))))))
    (inputs
     (list git-minimal/pinned))
    (propagated-inputs
     (list r-askpass r-curl r-jsonlite r-openssl r-sys))
    (native-inputs
     (list r-knitr r-testthat))
    (home-page "https://docs.ropensci.org/credentials/")
    (synopsis "Tools for managing SSH and Git credentials")
    (description
     "This package assists you in setting up and retrieving of HTTPS and SSH
credentials for use with git and other services.  For HTTPS remotes the
package interfaces the @command{git-credential} utility which @command{git}
uses to store HTTP usernames and passwords.  For SSH remotes this package
provides convenient functions to find or generate appropriate SSH keys.  The
package both helps the user to setup a local git installation, and also
provides a back-end for git/ssh client libraries to authenticate with existing
user credentials.")
    (license license:expat)))

(define-public r-gert
  (package
    (name "r-gert")
    (version "2.1.5")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "gert" version))
       (sha256
        (base32
         "066r59czxqad00ab160nsyfsy7dr87zax0c5ya6cq46bkk5pdhrx"))))
    (properties `((upstream-name . "gert")))
    (build-system r-build-system)
    (inputs
     (list libgit2 openssh openssl zlib))
    (propagated-inputs
     (list r-askpass
           r-credentials
           r-openssl
           r-rstudioapi
           r-sys
           r-zip))
    (native-inputs
     (list pkg-config r-knitr r-spelling r-testthat))
    (home-page "https://docs.ropensci.org/gert/")
    (synopsis "Simple Git client for R")
    (description
     "This package provides a simple git client for R based on libgit2 with
support for SSH and HTTPS remotes.  All functions in gert use basic R data
types (such as vectors and data-frames) for their arguments and return values.
User credentials are shared with command line git through the
@code{git-credential} store and SSH keys stored on disk or ssh-agent.")
    (license license:expat)))

(define-public r-usethis
  (package
    (name "r-usethis")
    (version "3.1.0")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "usethis" version))
       (sha256
        (base32
         "1n0nd6z8scwx8scl1y2i80d1h1h3c29kqcbipzdy36xi3lffibv3"))))
    (properties
     `((upstream-name . "usethis")
       (updater-extra-native-inputs . ("r-roxygen2"))
       (updater-ignored-native-inputs
        . ("r-archive"                  ;not needed, but also fails to build
           "r-devtools"                 ;avoid dependency cycle
           "r-github"                   ;not needed
           "r-gitlab"                   ;not needed
           "r-roxyglobals")))) ;not needed
    (build-system r-build-system)
    (arguments
     '(#:phases
       (modify-phases %standard-phases
         (add-after 'unpack 'delete-bad-tests
           (lambda _
             ;; FIXME cran_version("usethis") return NULL
             (delete-file "tests/testthat/test-release.R")))
         ;; This is needed for tests.
         (add-after 'unpack 'set-HOME
           (lambda _ (setenv "HOME" "/tmp"))))))
    (propagated-inputs
     (list r-cli
           r-clipr
           r-crayon
           r-curl
           r-desc
           r-fs
           r-gert
           r-gh
           r-glue
           r-jsonlite
           r-lifecycle
           r-purrr
           r-rappdirs
           r-rlang
           r-rprojroot
           r-rstudioapi
           r-whisker
           r-withr
           r-yaml))
    (native-inputs (list r-knitr
                         r-magick
                         r-rmarkdown
                         r-roxygen2
                         r-spelling
                         r-testthat
                         r-tibble))
    (home-page "https://github.com/r-lib/usethis")
    (synopsis "Automate R package and project setup")
    (description
     "This package helps you to automate R package and project setup tasks
that are otherwise performed manually.  This includes setting up unit testing,
test coverage, continuous integration, Git, GitHub integration, licenses,
Rcpp, RStudio projects, and more.")
    (license license:gpl3)))

(define-public r-sessioninfo
  (package
    (name "r-sessioninfo")
    (version "1.2.3")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "sessioninfo" version))
       (sha256
        (base32
         "0l66w40lfhb8n5n5201d4fdp4kmlbahwbsrcjyflk6n4lsl90ax0"))))
    (build-system r-build-system)
    (arguments
     (list
      #:phases
      '(modify-phases %standard-phases
         (add-after 'unpack 'delete-bad-tests
           (lambda _
             ;; One test attempts to connect to a website
             (delete-file "tests/testthat/test-diff.R")
             ;; This one fails for silly reasons.
             (delete-file "tests/testthat/test-platform-info.R"))))))
    (propagated-inputs
     (list r-cli))
    (native-inputs (list r-callr r-testthat r-withr))
    (home-page "https://github.com/r-lib/sessioninfo#readme")
    (synopsis "R session information")
    (description
     "This package provides tools to query and print information about the
current R session.  It is similar to @code{utils::sessionInfo()}, but includes
more information about packages, and where they were installed from.")
    (license license:gpl2)))

(define-public r-remotes
  (package
    (name "r-remotes")
    (version "2.5.0")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "remotes" version))
       (sha256
        (base32
         "0345s9q0fyv0wrxkklcy97h7bi85jfb3vwkh80px926d4qa3yrjd"))))
    (build-system r-build-system)
    (native-inputs
     (list r-knitr r-testthat))
    (home-page "https://github.com/r-lib/remotes#readme")
    (synopsis "R package installation from remote repositories")
    (description
     "Download and install R packages stored in GitHub, BitBucket, or plain
subversion or git repositories.  This package is a lightweight replacement of
the @code{install_*} functions in the @code{devtools} package.  Indeed most of
the code was copied over from @code{devtools}.")
    (license license:gpl2+)))

(define-public r-xopen
  (package
    (name "r-xopen")
    (version "1.0.1")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "xopen" version))
       (sha256
        (base32
         "1v4sna4md4cpqwi7802m4mfflgi506fxh78la0kam894qfw7icp3"))))
    (build-system r-build-system)
    (propagated-inputs
     (list r-processx))
    (native-inputs (list r-testthat))
    (home-page "https://github.com/r-lib/xopen#readme")
    (synopsis "Open system files, URLs, anything")
    (description
     "This package provides a cross-platform solution to open files,
directories or URLs with their associated programs.")
    (license license:expat)))

(define-public r-rcmdcheck
  (package
    (name "r-rcmdcheck")
    (version "1.4.0")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "rcmdcheck" version))
       (sha256
        (base32
         "1l696byn3kjq2xvz4wxybzaj6ink85h4lz3a35v2132ba5yyzm5v"))))
    (build-system r-build-system)
    ;; Four tests fail for unknown reasons.
    (arguments (list #:tests? #false))
    (propagated-inputs
     (list r-callr
           r-cli
           r-curl
           r-desc
           r-digest
           r-pkgbuild
           r-prettyunits
           r-r6
           r-rprojroot
           r-sessioninfo
           r-withr
           r-xopen))
    (native-inputs (list r-mockery r-testthat r-webfakes))
    (home-page "https://github.com/r-Lib/rcmdcheck#readme")
    (synopsis "Run R CMD check from R and capture results")
    (description
     "Run @code{R CMD check} from R programmatically, and capture the results
of the individual checks.")
    (license license:expat)))

(define-public r-rapportools
  (package
    (name "r-rapportools")
    (version "1.2")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "rapportools" version))
       (sha256
        (base32
         "0yxj7kll7583hp7fpr5y3krbymw354gmb5qz8hv122yr3g2kj2sj"))))
    (build-system r-build-system)
    ;; Tests fail: could not find function "context"
    (arguments (list #:tests? #false))
    (propagated-inputs
     (list r-mass r-pander r-plyr r-reshape2))
    (home-page "https://cran.r-project.org/web/packages/rapportools/")
    (synopsis "Miscellaneous helper functions with sane defaults for reporting")
    (description
     "This package provides helper functions that act as wrappers to more
advanced statistical methods with the advantage of having sane defaults for
quick reporting.")
    (license license:agpl3+)))

(define-public r-pander
  (package
    (name "r-pander")
    (version "0.6.6")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "pander" version))
       (sha256
        (base32
         "1piad5aq9wjpss5diw89nwfgw8q833di22h26mpjh4h21jsfchc0"))))
    (properties
     '((updater-extra-native-inputs . ("r-testthat"))))
    (build-system r-build-system)
    (arguments
     (list
      #:phases
      '(modify-phases %standard-phases
         (add-after 'unpack 'delete-bad-tests
           (lambda _
             ;; These tests fail in the C locale.
             (delete-file "inst/tests/test-helpers.R")
             (delete-file "inst/tests/test-S3.R")
             (delete-file "inst/tests/test-evals.R"))))))
    (propagated-inputs
     (list r-digest r-rcpp))
    (native-inputs
     (list pandoc r-knitr r-testthat))
    (home-page "https://rapporter.github.io/pander")
    (synopsis "Render R objects into Pandoc's markdown")
    (description
     "The main aim of the pander R package is to provide a minimal and easy
tool for rendering R objects into Pandoc's markdown.  The package is also
capable of exporting/converting complex Pandoc documents (reports) in various
ways.")
    ;; This package is licensed under either the AGPLv3+ or the very rarely
    ;; used OSL 3.0.
    (license license:agpl3+)))

(define-public r-summarytools
  (package
    (name "r-summarytools")
    (version "1.1.4")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "summarytools" version))
       (sha256
        (base32
         "0xp80mh6y5n3rq0bci6kvfd2maf378k9ghldhf8ap7f6c8s0w9r3"))))
    (build-system r-build-system)
    ;; TODO
    ;; inst/includes/scripts/bootstrap.min.js
    ;; inst/includes/scripts/jquery-3.7.0.slim.min.js
    (propagated-inputs
     (list r-base64enc
           r-checkmate
           r-dplyr
           r-htmltools
           r-lubridate
           r-magick
           r-matrixstats
           r-pander
           r-pryr
           r-rapportools
           r-tibble
           r-tidyr))
    (native-inputs
     (list esbuild r-knitr))
    (home-page "https://github.com/dcomtois/summarytools")
    (synopsis "Tools to quickly and neatly summarize data")
    (description
     "This package provides tools for data frame summaries, cross-tabulations,
weight-enabled frequency tables and common univariate statistics in concise
tables available in a variety of formats (plain ASCII, Markdown and HTML).  A
good point-of-entry for exploring data, both for experienced and new R
users.")
    (license license:gpl2)))

(define-public r-lsei
  (package
    (name "r-lsei")
    (version "1.3-0")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "lsei" version))
       (sha256
        (base32
         "1dka0rigfw4vj809qma2dkiwjb3nw5635ynnba5cm299cn7hb2b2"))))
    (build-system r-build-system)
    (native-inputs
     (list gfortran))
    (home-page "https://www.stat.auckland.ac.nz/~yongwang")
    (synopsis "Solve regression problems under equality/inequality constraints")
    (description
     "It contains functions that solve least squares linear regression
problems under linear equality/inequality constraints.  Functions for solving
quadratic programming problems are also available, which transform such
problems into least squares ones first.")
    (license license:gpl2+)))

(define-public r-npsurv
  (package
    (name "r-npsurv")
    (version "0.5-0")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "npsurv" version))
       (sha256
        (base32
         "1ihxhb42cga1hssj2jv4ah0f4hlwsky899ij5261fzh1wxvdp1xw"))))
    (build-system r-build-system)
    (propagated-inputs
     (list r-lsei))
    (home-page "https://www.stat.auckland.ac.nz/~yongwang")
    (synopsis "Nonparametric survival analysis")
    (description
     "This package contains functions for non-parametric survival analysis of
exact and interval-censored observations.")
    (license license:gpl2+)))

(define-public r-clustercrit
  (package
    (name "r-clustercrit")
    (version "1.3.0")
    (source (origin
              (method url-fetch)
              (uri (cran-uri "clusterCrit" version))
              (sha256
               (base32
                "0raxlyvr3kr8c8bzjgs7hb9n76m314vzvfiz7c74v6cqpkmh6dkx"))))
    (properties `((upstream-name . "clusterCrit")))
    (build-system r-build-system)
    (native-inputs (list gfortran r-runit))
    (home-page "https://www.r-project.org/")
    (synopsis "Computing clustering validation indices")
    (description
     "The @code{clusterCrit} package provides an implementation of the
following indices: Czekanowski-Dice, Folkes-Mallows, Hubert Γ, Jaccard,
McNemar, Kulczynski, Phi, Rand, Rogers-Tanimoto, Russel-Rao or Sokal-Sneath.
ClusterCrit defines several functions which compute internal quality indices
or external comparison indices.  The partitions are specified as an integer
vector giving the index of the cluster each observation belongs to.")
    (license license:gpl2+)))

(define-public r-clusteval
  (package
    (name "r-clusteval")
    (version "0.1")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "clusteval" version))
       (sha256
        (base32
         "1ld0bdl4fy8dsfzm3k7a37cyxc6pfc9qs31x4pxd3z5rslghz7rj"))))
    (build-system r-build-system)
    (propagated-inputs
     (list r-mvtnorm r-rcpp))
    (home-page "https://cran.r-project.org/web/packages/clusteval/")
    (synopsis "Evaluation of clustering algorithms")
    (description
     "This R package provides a suite of tools to evaluate clustering
algorithms, clusterings, and individual clusters.")
    (license license:expat)))

(define-public r-clustergeneration
  (package
    (name "r-clustergeneration")
    (version "1.3.8")
    (source (origin
              (method url-fetch)
              (uri (cran-uri "clusterGeneration" version))
              (sha256
               (base32
                "0w1sywv9cgl78wrsamh1zrig67r3grnyl27f036ipd1ab1b2510g"))))
    (properties `((upstream-name . "clusterGeneration")))
    (build-system r-build-system)
    (propagated-inputs (list r-mass))
    (home-page "https://cran.r-project.org/package=clusterGeneration")
    (synopsis "Random cluster generation (with specified degree of separation)")
    (description
     "The clusterGeneration package provides functions for generating random
clusters, generating random covariance/correlation matrices, calculating a
separation index (data and population version) for pairs of clusters or
cluster distributions, and 1-D and 2-D projection plots to visualize clusters.
The package also contains a function to generate random clusters based on
factorial designs with factors such as degree of separation, number of
clusters, number of variables, number of noisy variables.")
    (license license:gpl2+)))

(define-public r-tweedie
  (package
    (name "r-tweedie")
    (version "2.3.5")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "tweedie" version))
       (sha256
        (base32
         "0ghwggdx6d391m7nay9n5li2xjqh3kmw416xx130sy2sxrgp8g4q"))))
    (build-system r-build-system)
    (native-inputs (list gfortran))
    (home-page "https://cran.r-project.org/web/packages/tweedie/")
    (synopsis "Evaluation of Tweedie exponential family models")
    (description
     "Maximum likelihood computations for Tweedie families, including the
series expansion (Dunn and Smyth, 2005; <doi10.1007/s11222-005-4070-y>) and
the Fourier inversion (Dunn and Smyth, 2008; <doi:10.1007/s11222-007-9039-6>),
and related methods.")
    (license license:gpl2+)))

(define-public r-rcppgsl
  (package
    (name "r-rcppgsl")
    (version "0.3.13")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "RcppGSL" version))
       (sha256
        (base32 "1rwkin79ppkdz1y9pghxx29vlyvs84bylvqblkhj8r4w26y76ppy"))))
    (properties `((upstream-name . "RcppGSL")))
    (build-system r-build-system)
    (propagated-inputs
     (list r-rcpp gsl))
    (home-page "https://cran.r-project.org/web/packages/RcppGSL/")
    (synopsis "Rcpp integration for GSL vectors and matrices")
    (description
     "The GNU Scientific Library (or GSL) is a collection of numerical
routines for scientific computing.  It is particularly useful for C and C++
programs as it provides a standard C interface to a wide range of mathematical
routines.  There are over 1000 functions in total with an extensive test
suite.  The RcppGSL package provides an easy-to-use interface between GSL data
structures and R using concepts from Rcpp which is itself a package that eases
the interfaces between R and C++.")
    (license license:gpl2+)))

(define-public r-mvabund
  (package
    (name "r-mvabund")
    (version "4.2.1")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "mvabund" version))
       (sha256
        (base32
         "01kss9dx4an1ir5zs46jypvhj8sdc8wcs00i1223ai09av4lcsgd"))))
    (build-system r-build-system)
    (propagated-inputs
     (list r-mass r-rcpp r-rcppgsl r-statmod r-tweedie))
    (native-inputs (list r-testthat))
    (home-page "https://cran.r-project.org/web/packages/mvabund/")
    (synopsis "Statistical methods for analysing multivariate abundance data")
    (description
     "This package provides a set of tools for displaying, modeling and
analysing multivariate abundance data in community ecology.")
    (license license:lgpl2.1+)))

(define-public r-mvnfast
  (package
    (name "r-mvnfast")
    (version "0.2.8")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "mvnfast" version))
       (sha256
        (base32 "1869xqq2wd7yw23q4ma5qawcnbdp7myafk6rdxazqymqak7f0wc8"))))
    (properties `((upstream-name . "mvnfast")))
    (build-system r-build-system)
    ;; FIXME Tests fail with: could not find function "context"
    (arguments (list #:tests? #false))
    (propagated-inputs (list r-bh r-rcpp r-rcpparmadillo))
    (native-inputs (list r-knitr r-testthat))
    (home-page "https://github.com/mfasiolo/mvnfast/")
    (synopsis "Fast multivariate normal and Student's t methods")
    (description
     "This package provides computationally efficient tools related to the
multivariate normal and Student's t distributions.  The main functionalities
are: simulating multivariate random vectors, evaluating multivariate normal or
Student's t densities and Mahalanobis distances.  These tools are developed
using C++ code and of the OpenMP API.")
    (license license:gpl2+)))

(define-public r-afex
  (package
    (name "r-afex")
    (version "1.4-1")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "afex" version))
       (sha256
        (base32
         "17i8am28l937vd2v6z17bfngslpskjx301pk050zvz3hf7ckayms"))))
    (build-system r-build-system)
    ;; This is needed for the vignette builder
    (arguments
     '(#:phases
       (modify-phases %standard-phases
         (add-after 'unpack 'set-HOME
           (lambda _ (setenv "HOME" "/tmp"))))))
    (propagated-inputs
     (list r-car r-lme4 r-lmertest r-pbkrtest r-reshape2))
    (native-inputs
     (list r-knitr r-r-rsp r-testthat)) ;vignette builder
    (home-page "https://afex.singmann.science/")
    (synopsis "Analysis of factorial experiments")
    (description
     "This package provides convenience functions for analyzing factorial
experiments using ANOVA or mixed models.")
    (license license:gpl2+)))

(define-public r-lmertest
  (package
    (name "r-lmertest")
    (version "3.1-3")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "lmerTest" version))
       (sha256
        (base32
         "1zd8gqjkazhxgpnnr484xwsq30p62fq8592nzyc171zjyplpbaim"))))
    (properties `((upstream-name . "lmerTest")))
    (build-system r-build-system)
    (propagated-inputs
     (list r-ggplot2 r-lme4 r-mass r-numderiv))
    (home-page "https://github.com/runehaubo/lmerTestR")
    (synopsis "Tests in linear mixed effects models")
    (description
     "This package provides p-values in type I, II or III anova and summary
tables for @code{lmer} model fits via Satterthwaite's degrees of freedom
method.  A Kenward-Roger method is also available via the @code{pbkrtest}
package.  Model selection methods include step, drop1 and anova-like tables
for random effects (ranova).  Methods for Least-Square means (LS-means) and
tests of linear contrasts of fixed effects are also available.")
    (license license:gpl2+)))

(define-public r-r2glmm
  (package
    (name "r-r2glmm")
    (version "0.1.3")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "r2glmm" version))
       (sha256
        (base32
         "0sdyiashyi332yxnimggrlglbsgad4b7wc7wyvvk1ayx9wb5lvrj"))))
    (build-system r-build-system)
    (propagated-inputs
     (list r-afex
           r-ggplot2
           r-gridextra
           r-mass
           r-matrix
           r-mgcv
           r-pbkrtest))
    (native-inputs (list r-lme4 r-nlme r-testthat))
    (home-page "https://github.com/bcjaeger/r2glmm")
    (synopsis "Compute R squared for mixed (multilevel) models")
    (description
     "This package computes model and semi partial R squared with confidence
limits for the linear and generalized linear mixed model (LMM and GLMM).  The
R squared measure from L. J. Edwards et al. (2008) is extended to the GLMM
using @dfn{penalized quasi-likelihood} (PQL) estimation (see Jaeger et
al. (2016)).")
    (license license:gpl2)))

(define-public r-cmdfun
  (package
    (name "r-cmdfun")
    (version "1.0.2")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "cmdfun" version))
       (sha256
        (base32
         "1pbcq7hi2lcmqnghmy3q2fsk0c9fy5m0637acyzmc096fxbx723j"))))
    (properties `((upstream-name . "cmdfun")))
    (build-system r-build-system)
    (propagated-inputs
     (list r-magrittr
           r-purrr
           r-r-utils
           r-rlang
           r-testthat
           r-usethis))
    (native-inputs
     (list r-knitr r-testthat))
    (home-page "https://snystrom.github.io/cmdfun/")
    (synopsis "Framework for building interfaces to shell commands")
    (description
     "Writing interfaces to command line software is cumbersome.  The cmdfun
package provides a framework for building function calls to seamlessly
interface with shell commands by allowing lazy evaluation of command line
arguments.  It also provides methods for handling user-specific paths to tool
installs or secrets like API keys.  Its focus is to equally serve package
builders who wish to wrap command line software, and to help analysts stay
inside R when they might usually leave to execute non-R software.")
    (license license:expat)))

(define-public r-rslurm
  (package
    (name "r-rslurm")
    (version "0.6.2")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "rslurm" version))
       (sha256
        (base32
         "0z5lyrkvfh2201sc772gzbz3hc1mc04pxww611iwjf6qwzn5h0al"))))
    (properties `((upstream-name . "rslurm")))
    (build-system r-build-system)
    (propagated-inputs (list r-whisker))
    (native-inputs (list r-knitr r-testthat))
    (home-page "http://cyberhelp.sesync.org/rslurm/")
    (synopsis "Submit R calculations to a Slurm cluster")
    (description
     "This package provides functions that simplify submitting R scripts to a
Slurm workload manager, in part by automating the division of embarrassingly
parallel calculations across cluster nodes.")
    (license license:gpl3)))

(define-public r-chk
  (package
    (name "r-chk")
    (version "0.10.0")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "chk" version))
       (sha256
        (base32
         "116kmgyi8wndl4r4fmbbdi2bpzxnl92izz1rr6xzwr8zd7xcs22v"))))
    (properties
     `((upstream-name . "chk")
       (updater-extra-native-inputs . ("tzdata-for-tests"))))
    (build-system r-build-system)
    (propagated-inputs
     (list r-lifecycle r-rlang))
    (native-inputs (list r-knitr r-testthat r-withr tzdata-for-tests))
    (home-page "https://github.com/poissonconsulting/chk")
    (synopsis "Check user-supplied function arguments")
    (description
     "This is a package for developers to check user-supplied function
arguments.  It is designed to be simple, fast and customizable.  Error
messages follow the tidyverse style guide.")
    (license license:expat)))

(define-public r-weights
  (package
    (name "r-weights")
    (version "1.0.4")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "weights" version))
       (sha256
        (base32
         "1fnchf7f0hyl514bk8sc3l884kg25kb5xm4mc2l28n6hm7l6bgpg"))))
    (build-system r-build-system)
    (propagated-inputs
     (list r-gdata r-hmisc r-lme4 r-mice))
    (home-page "https://cran.r-project.org/web/packages/weights/")
    (synopsis "Weighting and weighted statistics")
    (description "This package Provides a variety of functions for producing
simple weighted statistics, such as weighted Pearson's correlations, partial
correlations, Chi-Squared statistics, histograms, and t-tests.  Also now
includes some software for quickly recoding survey data and plotting point
estimates from interaction terms in regressions (and multiply imputed
regressions).  NOTE: Weighted partial correlation calculations pulled to
address a bug.")
  (license license:gpl2+)))

(define-public r-rcppalgos
  (package
    (name "r-rcppalgos")
    (version "2.9.3")
    (source (origin
              (method url-fetch)
              (uri (cran-uri "RcppAlgos" version))
              (sha256
               (base32
                "17qaadi0xlcgwhim3bjjyk3g946xyqpbi0wljnv2k4lqarbkvsfd"))))
    (properties `((upstream-name . "RcppAlgos")))
    (build-system r-build-system)
    (inputs (list gmp))
    (propagated-inputs (list r-cpp11 r-gmp))
    (native-inputs (list r-knitr r-partitions r-testthat))
    (home-page "https://github.com/jwood000/RcppAlgos")
    (synopsis
     "High performance tools for combinatorics and computational mathematics")
    (description
     "This package provides optimized functions and flexible combinatorial
iterators implemented in C++ for solving problems in combinatorics and
computational mathematics.  It utilizes the @code{RMatrix} class from
@code{RcppParallel} for thread safety.  There are combination/permutation
functions with constraint parameters that allow for generation of all results
of a vector meeting specific criteria.  It is capable of generating specific
combinations/permutations which sets up nicely for parallelization as well as
random sampling.  Gmp support permits exploration where the total number of
results is large.  Additionally, there are several high performance number
theoretic functions that are useful for problems common in computational
mathematics.")
    (license license:gpl2+)))

(define-public r-rcppannoy
  (package
    (name "r-rcppannoy")
    (version "0.0.22")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "RcppAnnoy" version))
       (sha256
        (base32
         "0rcgvmlp3by57k562pbxsncirww1vv8zarfxrjzfgly4hzbj28cz"))))
    (properties `((upstream-name . "RcppAnnoy")))
    (build-system r-build-system)
    (propagated-inputs
     (list r-rcpp))
    (home-page "https://cran.r-project.org/web/packages/RcppAnnoy/")
    (synopsis "Rcpp bindings for Annoy, a library for Approximate Nearest Neighbors")
    (description
     "Annoy is a small C++ library for Approximate Nearest Neighbors written
for efficient memory usage as well an ability to load from and save to disk.
This package provides an R interface.")
    ;; Annoy is released under ASL 2.0, but this wrapper is released under
    ;; GPLv2+.
    (license (list license:gpl2+ license:asl2.0))))

(define-public r-rcpphnsw
  (package
    (name "r-rcpphnsw")
    (version "0.6.0")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "RcppHNSW" version))
       (sha256
        (base32
         "03sqzz1993jsjm5vpyd1n1fpsrdfrky6dpv7m9ialhs1m00fv9m5"))))
    (properties `((upstream-name . "RcppHNSW")))
    (build-system r-build-system)
    (propagated-inputs (list r-rcpp))
    (native-inputs (list r-testthat))
    (home-page "https://cran.r-project.org/web/packages/RcppHNSW/")
    (synopsis "Rcpp bindings for hnswlib, a library for approximate nearest neighbors")
    (description
     "Hnswlib is a C++ library for approximate nearest neighbors.  This
package provides a minimal R interface by relying on the Rcpp package.")
    ;; hnswlib is released under Version 2.0 of the Apache License.
    (license (list license:gpl3 license:asl2.0))))

(define-public r-rcppparallel
  (package
    (name "r-rcppparallel")
    (version "5.1.10")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "RcppParallel" version))
       (sha256
        (base32
         "0kgkjbiprfw90rdwq352z4jbnwb98s3dsv2xyzkzi413rq2709gb"))
       (modules '((guix build utils)))
       (snippet
        '(delete-file-recursively "src/tbb/"))))
    (properties
     `((upstream-name . "RcppParallel")
       (updater-extra-native-inputs . ("r-rcpp" "r-runit"))))
    (build-system r-build-system)
    (arguments
     (list
      #:phases
      #~(modify-phases %standard-phases
          (add-after 'unpack 'use-system-tbb
            (lambda* (#:key inputs #:allow-other-keys)
              (setenv "TBB_ROOT" (assoc-ref inputs "tbb"))))
          (add-before 'install 'relax-gcc-14-strictness
            (lambda _
              ;; XXX FIXME: $HOME/.R/Makevars seems to be the only way to
              ;; set custom CFLAGS for R?
              (setenv "HOME" (getcwd))
              (mkdir-p ".R")
              (with-directory-excursion ".R"
                (with-output-to-file "Makevars"
                  (lambda _
                    (display (string-append
                              "CXXFLAGS=-g -O2"
                              " -Wno-error=changes-meaning\n"))))))))))
    (inputs (list tbb-2020))
    (native-inputs (list r-rcpp r-runit))
    (home-page "https://rcppcore.github.io/RcppParallel/")
    (synopsis "Parallel programming tools for Rcpp")
    (description
     "This package provides high level functions for parallel programming with
Rcpp.  For example, the @code{parallelFor()} function can be used to convert
the work of a standard serial @code{for} loop into a parallel one and the
@code{parallelReduce()} function can be used for accumulating aggregates or
other values.")
    (license license:gpl2)))

(define-public r-ncdf4
  (package
    (name "r-ncdf4")
    (version "1.24")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "ncdf4" version))
       (sha256
        (base32
         "1q2rv6byprg53vmn8lzxwi1d2mwajdj3r44s4gh4igwkn03rkfkc"))))
    (properties
     '((updater-extra-inputs . ("netcdf"))
       (updater-ignored-inputs . ("curl" "openssh" "openssl"))))
    (build-system r-build-system)
    (inputs
     (list netcdf zlib))
    (home-page "https://cran.r-project.org/web/packages/ncdf4/index.html")
    (synopsis "R interface to Unidata netCDF format data files")
    (description
     "This package provides a high-level R interface to data files written
using Unidata's netCDF library (version 4 or earlier), which are binary data
files that are portable across platforms and include metadata information in
addition to the data sets.  Using this package, netCDF files can be opened and
data sets read in easily.  It is also easy to create new netCDF dimensions,
variables, and files, in either version 3 or 4 format, and manipulate existing
netCDF files.")
    (license license:gpl3+)))

(define-public r-ncmisc
  (package
    (name "r-ncmisc")
    (version "1.2.0")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "NCmisc" version))
       (sha256
        (base32 "10wzznqa26fxyj6bl979qmq29p3dkr8yap4s70l3mwhhk33zpz16"))))
    (properties `((upstream-name . "NCmisc")))
    (build-system r-build-system)
    (home-page "https://cran.r-project.org/package=NCmisc")
    (synopsis "Functions for creating adaptive functions and scripts")
    (description
     "This package provides a set of handy functions.  It includes a versatile
one line progress bar, one line function timer with detailed output, time delay
function, text histogram, object preview, CRAN package search, simpler package
installer, Linux command install check, a flexible Mode function, top function,
simulation of correlated data, and more.")
    (license license:gpl2+)))

(define-public r-biocmanager
  (package
    (name "r-biocmanager")
    (version "1.30.25")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "BiocManager" version))
       (sha256
        (base32 "058ym2j400xj8v4k02b6r3wy3lrs1nk909f6x3hhydf7vibqpvw3"))))
    (properties `((upstream-name . "BiocManager")))
    (build-system r-build-system)
    ;; One test requires Internet access.
    (arguments (list #:tests? #false))
    (native-inputs
     (list r-knitr r-testthat))
    (home-page "https://cran.r-project.org/web/packages/BiocManager/")
    (synopsis "Access the Bioconductor project package repository")
    (description
     "This package provides a convenient tool to install and update
Bioconductor packages.")
    (license license:artistic2.0)))

;; TODO: one more minified JavaScript files is included that should be built
;; from the included .src.js files, but it is not entirely clear how.  The
;; file is inst/htmlwidgets/lib/rglClass/rglClass.min.js.
(define-public r-rgl
  (package
    (name "r-rgl")
    (version "1.3.18")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "rgl" version))
       (sha256
        (base32
         "0qv226nm5iaq09jifm96v4xx6ki4735xnm9mgm22absrl6w43fia"))
       (snippet
        '(delete-file "inst/htmlwidgets/lib/CanvasMatrix/CanvasMatrix.min.js"))))
    ;; For OpenGL and X11 support
    (properties
     '((updater-extra-inputs . ("glu" "libx11"))))
    (build-system r-build-system)
    (arguments
     (list
      #:phases
      '(modify-phases %standard-phases
         (add-after 'unpack 'process-javascript
           (lambda* (#:key inputs #:allow-other-keys)
             (with-directory-excursion "inst/htmlwidgets/lib/"
               (let ((source "CanvasMatrix/CanvasMatrix.src.js")
                     (target "CanvasMatrix/CanvasMatrix.min.js"))
                 (invoke "esbuild" source "--minify"
                         (string-append "--outfile=" target)))))))))
    (native-inputs
     (list esbuild pkg-config r-knitr))
    (inputs
     (list freetype
           glu
           libpng
           libx11
           zlib
           zlib))
    (propagated-inputs
     (list r-base64enc
           r-htmltools
           r-htmlwidgets
           r-jsonlite
           r-knitr
           r-magrittr
           r-mime
           r-r6))
    (home-page "https://r-forge.r-project.org/projects/rgl/")
    (synopsis "3D visualization using OpenGL")
    (description
     "This package provides medium to high level functions for 3D interactive graphics,
including functions modelled on base graphics (@code{plot3d()}, etc.) as well
as functions for constructing representations of geometric
objects (@code{cube3d()}, etc.).  Output may be on screen using OpenGL, or to
various standard 3D file formats including WebGL, PLY, OBJ, STL as well as 2D
image formats, including PNG, Postscript, SVG, PGF.")
    ;; Any version of the GPL.
    (license (list license:gpl2+ license:gpl3+))))

(define-public r-multicool
  (package
    (name "r-multicool")
    (version "1.0.1")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "multicool" version))
       (sha256
        (base32
         "07vcyp7yd1rzlldxzpzrdgifnw88z0maq2dgsqc218vyplgxwwmx"))))
    (build-system r-build-system)
    (propagated-inputs (list r-rcpp))
    (home-page "https://cran.r-project.org/web/packages/multicool/")
    (synopsis "Permutations of multisets in cool-lex order")
    (description
     "This package provides a set of tools to permute multisets without loops
or hash tables and to generate integer partitions.  Cool-lex order is similar
to colexicographical order.")
    (license license:gpl2)))

(define-public r-multidplyr
  (package
    (name "r-multidplyr")
    (version "0.1.3")
    (source (origin
              (method url-fetch)
              (uri (cran-uri "multidplyr" version))
              (sha256
               (base32
                "18yl24s1g8wf3xi6f0k7jhs99ka4dslxf5p9ax9m5l1rbva5xdwj"))))
    (properties
     '((upstream-name . "multidplyr")
       (updater-extra-native-inputs . ("r-covr"))))
    (build-system r-build-system)
    (propagated-inputs
     (list r-callr
           r-cli
           r-crayon
           r-dplyr
           r-magrittr
           r-qs
           r-r6
           r-rlang
           r-tibble
           r-tidyselect
           r-vctrs))
    (native-inputs (list r-covr r-knitr r-testthat))
    (home-page "https://multidplyr.tidyverse.org")
    (synopsis "Multi-process dplyr backend")
    (description
     "Partition a data frame across multiple worker processes to provide
simple multicore parallelism.")
    (license license:expat)))

(define-public r-multigraph
  (package
    (name "r-multigraph")
    (version "0.99-3")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "multigraph" version))
       (sha256
        (base32 "0q634jsr1m9nzn4g3bcy5dxl26bdzdg6imcym2jifaa29b7m1790"))))
    (properties `((upstream-name . "multigraph")))
    (build-system r-build-system)
    (propagated-inputs (list r-multiplex))
    (home-page "https://github.com/mplex/multigraph/")
    (synopsis "Plot and manipulate multigraphs")
    (description
     "This package provides functions to plot and manipulate multigraphs,
signed and valued graphs, bipartite graphs, multilevel graphs, and Cayley
graphs with various layout options.")
    (license license:gpl3)))

(define-public r-multiplex
  (package
    (name "r-multiplex")
    (version "3.9")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "multiplex" version))
       (sha256
        (base32 "1niqaq9y56j7ryy1p5pa6kify8a4v380hr1nrd69f1p6iqyr7nw9"))))
    (properties `((upstream-name . "multiplex")))
    (build-system r-build-system)
    (native-inputs (list r-knitr))
    (home-page "https://github.com/mplex/multiplex/")
    (synopsis "Algebraic tools for the analysis of multiple social networks")
    (description
     "Algebraic procedures for analyses of multiple social networks are
delivered with this package.  @code{multiplex} makes possible, among other
things, to create and manipulate multiplex, multimode, and multilevel network
data with different formats.  Effective ways are available to treat multiple
networks with routines that combine algebraic systems like the partially
ordered semigroup with decomposition procedures or semiring structures with
the relational bundles occurring in different types of multivariate networks.
multiplex provides also an algebraic approach for affiliation networks through
Galois derivations between families of the pairs of subsets in the two domains
of the network with visualization options.")
    (license license:gpl3)))

(define-public r-misc3d
  (package
    (name "r-misc3d")
    (version "0.9-1")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "misc3d" version))
       (sha256
        (base32
         "0r9x57s63kx9f6dgam2nhbziq8nrs9wd8pk7g76hds2kw46vnyx0"))))
    (build-system r-build-system)
    (home-page "https://cran.r-project.org/web/packages/misc3d/")
    (synopsis "Miscellaneous 3D Plots")
    (description
     "This package provides a collection of miscellaneous 3d plots, including
isosurfaces.")
    ;; Any version of the GPL.
    (license (list license:gpl2+ license:gpl3+))))

(define-public r-missforest
  (package
    (name "r-missforest")
    (version "1.5")
    (source (origin
              (method url-fetch)
              (uri (cran-uri "missForest" version))
              (sha256
               (base32
                "13c38hpl60ca1kwyv61cxsla6ccmsj4qzp0vrxcq7b827fh5aw21"))))
    (properties `((upstream-name . "missForest")))
    (build-system r-build-system)
    (propagated-inputs
     (list r-dorng
           r-foreach
           r-iterators
           r-itertools
           r-randomforest))
    (home-page "https://github.com/stekhoven/missForest")
    (synopsis "Nonparametric missing value imputation using Random Forest")
    (description
     "The function @code{missForest} in this package is used to impute missing
values, particularly in the case of mixed-type data.  It uses a random forest
trained on the observed values of a data matrix to predict the missing values.
It can be used to impute continuous and/or categorical data, including complex
interactions and non-linear relations.  It yields an @acronym{OOB, out-of-bag}
imputation error estimate without the need of a test set or elaborate cross-
validation.  It can be run in parallel to save computation time.")
    (license license:gpl2+)))

(define-public r-ks
  (package
    (name "r-ks")
    (version "1.15.1")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "ks" version))
       (sha256
        (base32 "0wsyhcqsrmmd1bpqp8faj6d70dpnph4q9r90950wds22pbsz9mvv"))))
    (build-system r-build-system)
    (propagated-inputs
     (list r-fnn
           r-kernlab
           r-kernsmooth
           r-matrix
           r-mclust
           r-mgcv
           r-multicool
           r-mvtnorm
           r-pracma))
    (home-page "https://www.mvstat.net/tduong/")
    (synopsis "Kernel smoothing")
    (description
     "This package provides kernel smoothers for univariate and multivariate
data, including density functions, density derivatives, cumulative
distributions, modal clustering, discriminant analysis, and two-sample
hypothesis testing.")
    ;; Either version of the GPL.
    (license (list license:gpl2 license:gpl3))))

(define-public r-feature
  (package
    (name "r-feature")
    (version "1.2.15")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "feature" version))
       (sha256
        (base32
         "0yzn1w1sasilcp8v0pcjnxjv9l6lspkskqi412i6h040gqmjjf6y"))))
    (build-system r-build-system)
    (propagated-inputs
     (list r-ks r-plot3d))
    (native-inputs
     (list r-knitr))
    (home-page "https://www.mvstat.net/tduong/")
    (synopsis "Inferential feature significance for kernel density estimation")
    (description
     "The feature package contains functions to display and compute kernel
density estimates, significant gradient and significant curvature regions.
Significant gradient and/or curvature regions often correspond to significant
features (e.g. local modes).")
    ;; Either version of the GPL.
    (license (list license:gpl2 license:gpl3))))

(define-public r-arm
  (package
    (name "r-arm")
    (version "1.14-4")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "arm" version))
       (sha256
        (base32
         "1g8732naydqyv5pq1fkyb1i6qddv62jdmn2ys5lbdvx2zq5cnns2"))))
    (build-system r-build-system)
    (propagated-inputs
     (list r-abind
           r-coda
           r-lme4
           r-mass
           r-matrix
           r-nlme))
    (home-page "https://cran.r-project.org/web/packages/arm/")
    (synopsis "Data analysis using regression and multilevel/hierarchical models")
    (description
     "This package provides functions to accompany A. Gelman and J. Hill,
Data Analysis Using Regression and Multilevel/Hierarchical Models, Cambridge
University Press, 2007.")
    (license license:gpl3+)))

(define-public r-circular
  (package
    (name "r-circular")
    (version "0.5-1")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "circular" version))
       (sha256
        (base32
         "1ngkhdvdzxdm8amc4s9jmiqc916fmf1xnm70gz3znxyp368zqngv"))))
    (build-system r-build-system)
    (propagated-inputs
     (list r-boot r-mvtnorm))
    (native-inputs
     (list gfortran))
    (home-page "https://cran.r-project.org/web/packages/circular/")
    (synopsis "Circular statistics")
    (description
     "This package provides tools for circular statistics, from \"Topics in
circular Statistics\" (2001) S. Rao Jammalamadaka and A. SenGupta, World
Scientific.")
    (license license:gpl2+)))

(define-public r-activity
  (package
    (name "r-activity")
    (version "1.3.4")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "activity" version))
       (sha256
        (base32
         "10gp2yvqxz5ysmh5z8qvrpli8kc2kn2z3nd2llfabpyh21476in2"))))
    (build-system r-build-system)
    (propagated-inputs
     (list r-pbapply))
    (home-page "https://cran.r-project.org/web/packages/activity/")
    (synopsis "Animal activity statistics")
    (description
     "This package provides functions to fit kernel density functions to
animal activity time data; plot activity distributions; quantify overall
levels of activity; statistically compare activity metrics through
bootstrapping; and evaluate variation in linear variables with time (or other
circular variables).")
    (license license:gpl3)))

(define-public r-ouch
  (package
    (name "r-ouch")
    (version "2.20")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "ouch" version))
       (sha256
        (base32
         "1r1nj4m2hw4gdaw596q14d6majcz15ppa0mfhfl8f791phcyarka"))))
    (build-system r-build-system)
    (propagated-inputs (list r-subplex))
    (home-page "https://kingaa.github.io/ouch/")
    (synopsis "Ornstein-Uhlenbeck models for phylogenetic comparative hypotheses")
    (description
     "This package provides tools to fit and compare Ornstein-Uhlenbeck models
for evolution along a phylogenetic tree.")
    (license license:gpl2+)))

(define-public r-fmesher
  (package
    (name "r-fmesher")
    (version "0.3.0")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "fmesher" version))
       (sha256
        (base32 "1l860v9mr66y7181pi9954hrz9hgfh9yrq8w379asmgi8dm6v400"))))
    (properties
     '((upstream-name . "fmesher")
       ;; Don't have it, don't need it.
       (updater-ignored-native-inputs . ("r-inlabru"))))
    (build-system r-build-system)
    (propagated-inputs (list r-dplyr
                             r-lifecycle
                             r-matrix
                             r-rcpp
                             r-rlang
                             r-sf
                             r-tibble
                             r-withr))
    (native-inputs (list r-ggplot2 r-knitr r-sp r-testthat))
    (home-page "https://inlabru-org.github.io/fmesher/")
    (synopsis "Triangle meshes and related geometry tools")
    (description
     "This package lets you generate planar and spherical triangle meshes,
compute finite element calculations for 1- and 2-dimensional flat and curved
manifolds with associated basis function spaces, methods for lines and
polygons, and transparent handling of coordinate reference systems and
coordinate transformation, including @code{sf} and @code{sp} geometries.  The
core @code{fmesher} library code was originally part of the INLA package, and
implements parts of \"Triangulations and Applications\" by Hjelle and
Daehlen (2006) <doi:10.1007/3-540-33261-8>.")
    (license license:mpl2.0)))

(define-public r-fmri
  (package
    (name "r-fmri")
    (version "1.9.12.1")
    (source (origin
              (method url-fetch)
              (uri (cran-uri "fmri" version))
              (sha256
               (base32
                "0fyvnc39la5wgd9232nw6lp6yi1v3nkjwzn0sbhm4rckknibb5s4"))))
    (properties `((upstream-name . "fmri")))
    (build-system r-build-system)
    (propagated-inputs (list r-aws r-metafor r-nlme r-oro-nifti))
    (native-inputs (list gfortran))
    (home-page "http://www.wias-berlin.de/software/imaging/")
    (synopsis "Analysis of fMRI experiments")
    (description
     "This package contains R-functions to perform an fMRI analysis as
described in Polzehl and Tabelow (2019) <DOI:10.1007/978-3-030-29184-6>,
Tabelow et al. (2006) <DOI:10.1016/j.neuroimage.2006.06.029>, Polzehl et
al. (2010) <DOI:10.1016/j.neuroimage.2010.04.241>, Tabelow and Polzehl (2011)
<DOI:10.18637/jss.v044.i11>.")
    (license license:gpl2+)))

(define-public r-fmsb
  (package
    (name "r-fmsb")
    (version "0.7.6")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "fmsb" version))
       (sha256
        (base32
         "1cnkg4njb432p05j8hdwfa2swiynwm864yixgfbyr26r8jfz4zg5"))))
    (build-system r-build-system)
    (home-page "https://minato.sip21c.org/msb/")
    (synopsis "Functions for medical statistics book with demographic data")
    (description
     "This package provides several utility functions for the book entitled
\"Practices of Medical and Health Data Analysis using R\" (Pearson Education
Japan, 2007) with Japanese demographic data and some demographic analysis
related functions.")
    (license license:gpl2+)))

(define-public r-stabledist
  (package
    (name "r-stabledist")
    (version "0.7-2")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "stabledist" version))
       (sha256
        (base32
         "1mbgl6an18dzry55pvy08zdhj1gar5mlyvkfnlawiqyqq081frr6"))))
    (build-system r-build-system)
    ;; Tests require r-fbasics, which depends on this package
    (arguments (list #:tests? #false))
    (home-page "https://www.rmetrics.org")
    (synopsis "Stable distribution functions")
    (description
     "This package provides density, probability and quantile functions, and
random number generation for (skew) stable distributions, using the
parametrizations of Nolan.")
    (license license:gpl2+)))

(define-public r-gsl
  (package
    (name "r-gsl")
    (version "2.1-8")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "gsl" version))
       (sha256
        (base32
         "159d782nz7fqhgcj3fa79hlmkdrqnkd0ypgzcl71kgas92zhjdpk"))))
    (build-system r-build-system)
    (inputs
     (list gsl))
    (home-page "https://cran.r-project.org/web/packages/gsl")
    (synopsis "Wrapper for the GNU Scientific Library")
    (description
     "This package provides an R wrapper for the special functions and quasi
random number generators of the GNU Scientific Library.")
    (license license:gpl2+)))

(define-public r-adgoftest
  (package
    (name "r-adgoftest")
    (version "0.3")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "ADGofTest" version))
       (sha256
        (base32
         "0ik817qzqp6kfbckjp1z7srlma0w6z2zcwykh0jdiv7nahwk3ncw"))))
    (properties `((upstream-name . "ADGofTest")))
    (build-system r-build-system)
    (home-page "https://cran.r-project.org/web/packages/ADGofTest")
    (synopsis "Anderson-Darling GoF test")
    (description
     "This package provides an implementation of the Anderson-Darling GoF test
with p-value calculation based on Marsaglia's 2004 paper \"Evaluating the
Anderson-Darling Distribution\".")
    ;; Any version of the GPL.
    (license license:gpl3+)))

(define-public r-adimpro
  (package
    (name "r-adimpro")
    (version "0.9.7.2")
    (source (origin
              (method url-fetch)
              (uri (cran-uri "adimpro" version))
              (sha256
               (base32
                "0b7dncf1w4yvm9i67q19fj95p3sc57lqv9wb2n9kvjddqk0vk4iv"))))
    (properties `((upstream-name . "adimpro")
                  (updater-extra-propagated-inputs . ("imagemagick"))))
    (build-system r-build-system)
    (propagated-inputs
     (list imagemagick r-awsmethods))
    (native-inputs (list gfortran))
    (home-page "https://www.wias-berlin.de/software/imaging/")
    (synopsis "Adaptive smoothing of digital images")
    (description
     "This package implements tools for manipulation of digital images and the
Propagation Separation approach by Polzehl and Spokoiny (2006)
<DOI:10.1007/s00440-005-0464-1> for smoothing digital images, see Polzehl and
Tabelow (2007) <DOI:10.18637/jss.v019.i01>.")
    (license license:gpl2+)))

(define-public r-admisc
  (package
    (name "r-admisc")
    (version "0.38")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "admisc" version))
       (sha256
        (base32 "0lxw0mb7d57mlgb2jxxsp2agh2znfiv7v3392gd3gbpxfxvaj9y8"))))
    (properties `((upstream-name . "admisc")))
    (build-system r-build-system)
    (home-page "https://github.com/dusadrian/admisc")
    (synopsis "Adrian Dusa's miscellaneous")
    (description
     "This package contains miscellaneous functions used to interpret and
translate, factorize and negate Sum of Products expressions, for both binary
and multi-value crisp sets, and to extract information (set names, set values)
from those expressions.  Other functions perform various other checks if
possibly numeric (even if all numbers reside in a character vector) and coerce
to numeric, or check if the numbers are whole.  It also offers, among many
others, a highly flexible recoding routine and a more flexible alternative to
the base function @code{with()}.")
    (license license:gpl3+)))

(define-public r-oro-nifti
  (package
    (name "r-oro-nifti")
    (version "0.11.4")
    (source (origin
              (method url-fetch)
              (uri (cran-uri "oro.nifti" version))
              (sha256
               (base32
                "01mn90qxb7i15zr83xrl2cn4akayfzpm83r5x71zczz3qb9gbr7g"))))
    (properties `((upstream-name . "oro.nifti")))
    (build-system r-build-system)
    (propagated-inputs (list r-abind r-bitops r-rnifti))
    (native-inputs (list r-testthat))
    (home-page "https://rigorousanalytics.blogspot.com")
    (synopsis "Visualization of medical imaging data")
    (description
     "This package provides functions for the input/output and visualization
of medical imaging data that follow either the ANALYZE, NIfTI or AFNI formats.
This package is part of the Rigorous Analytics bundle.")
    (license license:bsd-3)))

(define-public r-mritc
  (package
    (name "r-mritc")
    (version "0.5-3")
    (source (origin
              (method url-fetch)
              (uri (cran-uri "mritc" version))
              (sha256
               (base32
                "1bpnm2qzq67dgjxsa4wxn51f4a4cxal5r6abgs3m7p5a9a16jmjp"))))
    (properties `((upstream-name . "mritc")))
    (build-system r-build-system)
    (propagated-inputs (list r-lattice r-misc3d r-oro-nifti))
    (home-page "https://cran.r-project.org/package=mritc")
    (synopsis "MRI tissue classification")
    (description "This package provides various methods for MRI tissue
classification.")
    ;; Any version of the GPL.
    (license license:gpl3+)))

(define-public r-sodium
  (package
    (name "r-sodium")
    (version "1.4.0")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "sodium" version))
       (sha256
        (base32
         "1k8sa1y27hxmi5mi35aw4pxk0qlwq3bm1qa9g40ggy81wkam6zck"))))
    (properties `((upstream-name . "sodium")))
    (build-system r-build-system)
    (inputs
     (list libsodium))
    (native-inputs
     (list pkg-config r-knitr))
    (home-page "https://github.com/jeroen/sodium")
    (synopsis "R bindings to the libsodium crypto library")
    (description
     "This package provides bindings to libsodium: a library for encryption,
decryption, signatures, password hashing and more.  Sodium uses curve25519, a
Diffie-Hellman function by Daniel Bernstein, which has become very popular
after it was discovered that the NSA had backdoored Dual EC DRBG.")
    (license license:expat)))

(define-public r-softimpute
  (package
    (name "r-softimpute")
    (version "1.4-3")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "softImpute" version))
       (sha256
        (base32
         "1d6f3v409zb4h6ld7kcvf4fvld8x34sj22bdi207kcz7a1s4959n"))))
    (properties `((upstream-name . "softImpute")))
    (build-system r-build-system)
    (propagated-inputs
     (list r-matrix))
    (native-inputs
     (list gfortran r-knitr))
    (home-page "https://cran.r-project.org/web/packages/softImpute")
    (synopsis "Matrix completion via iterative soft-thresholded SVD")
    (description
     "This package provides iterative methods for matrix completion that use
nuclear-norm regularization.  The package includes procedures for centering
and scaling rows, columns or both, and for computing low-rank @dfn{single
value decompositions} (SVDs) on large sparse centered matrices (i.e. principal
components).")
    (license license:gpl2)))

(define-public r-som
  (package
    (name "r-som")
    (version "0.3-5.2")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "som" version))
       (sha256
        (base32 "0ibhcadjfgi93p5jvs8hni7a92k3x1k74m93w6h2xl6c2q2vpavn"))))
    (properties `((upstream-name . "som")))
    (build-system r-build-system)
    (home-page "https://cran.r-project.org/package=som")
    (synopsis "Self-organizing map")
    (description
     "This package implements a self-organizing map which has application in
gene clustering.  It provides functions like:

@itemize
@item filtering data by certain floor, ceiling, max/min ratio, and max - min
  difference;
@item normalization of the data;
@item get the average distortion measure;
@item train a self-organizing map;
@item summarize a som object;
@item yeast cell cycle.
@end itemize")
    (license license:gpl3+)))

(define-public r-fftwtools
  (package
    (name "r-fftwtools")
    (version "0.9-11")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "fftwtools" version))
       (sha256
        (base32
         "0zrchp4l0jdbir2gibjf00x225y9giqk80zvqmr2yyvc12lwkw7i"))))
    (build-system r-build-system)
    (inputs (list fftw))
    (native-inputs
     (list pkg-config))
    (home-page "https://github.com/krahim/fftwtools")
    (synopsis "Wrapper for FFTW3")
    (description
     "This package provides a wrapper for several FFTW functions.  It provides
access to the two-dimensional FFT, the multivariate FFT, and the
one-dimensional real to complex FFT using the FFTW3 library.  The package
includes the functions @code{fftw()} and @code{mvfftw()} which are designed to
mimic the functionality of the R functions @code{fft()} and @code{mvfft()}.
The FFT functions have a parameter that allows them to not return the
redundant complex conjugate when the input is real data.")
    (license license:gpl2+)))

(define-public r-tiff
  (package
    (name "r-tiff")
    (version "0.1-12")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "tiff" version))
       (sha256
        (base32
         "0p41irri0nxg9mm06g8jp5zqssv80g5zg0iifrr7ancjkxqww46z"))))
    (build-system r-build-system)
    (inputs
     (list libtiff libjpeg-turbo zlib))
    (native-inputs
     (list pkg-config))
    (home-page "https://www.rforge.net/tiff/")
    (synopsis "Read and write TIFF images")
    (description
     "This package provides an easy and simple way to read, write and display
bitmap images stored in the TIFF format.  It can read and write both files and
in-memory raw vectors.")
    ;; Either of these two license versions.
    (license (list license:gpl2 license:gpl3))))

(define-public r-nlp
  (package
    (name "r-nlp")
    (version "0.3-2")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "NLP" version))
       (sha256
        (base32
         "09a24nlyc1h2a69s87virrcgb3ps2jc14dvwdq3vqdjk9338p7n5"))))
    (properties `((upstream-name . "NLP")))
    (build-system r-build-system)
    (home-page "https://cran.r-project.org/web/packages/NLP/")
    (synopsis "Natural language processing infrastructure")
    (description
     "This package provides basic classes and methods for Natural Language
Processing.")
    (license license:gpl3)))

(define-public r-tm
  (package
    (name "r-tm")
    (version "0.7-16")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "tm" version))
       (sha256
        (base32
         "124nhgpainbws7y3nv9lqmkx20f63d7vfzxnkzrkcyj4ia2hr1h8"))))
    (properties
     '((upstream-name . "tm")
       ;; Needed for vignettes.
       (updater-extra-native-inputs . ("r-snowballc"))))
    (build-system r-build-system)
    (propagated-inputs
     (list r-bh r-nlp r-rcpp r-slam r-xml2))
    (native-inputs (list r-snowballc r-testthat))
    (home-page "https://tm.r-forge.r-project.org/")
    (synopsis "Text mining package")
    (description
     "This package provides a framework for text mining applications within R.")
    (license license:gpl3)))

(define-public r-waffle
  (package
    (name "r-waffle")
    (version "1.0.2")
    (source (origin
              (method url-fetch)
              (uri (cran-uri "waffle" version))
              (sha256
               (base32
                "17z05mlnp2k9dywr0bbqz633sq1xs8q9879bl2na1in39qxq0l76"))))
    (properties `((upstream-name . "waffle")))
    (build-system r-build-system)
    (propagated-inputs
     (list r-curl
           r-dt
           r-extrafont
           r-ggplot2
           r-gridextra
           r-gtable
           r-htmlwidgets
           r-plyr
           r-rcolorbrewer
           r-rlang
           r-stringr))
    (home-page "https://github.com/hrbrmstr/waffle/tree/cran")
    (synopsis "Creating waffle chart visualizations in R")
    (description
     "This package creates square pie charts also known as waffle charts.
These can be used to communicate parts of a whole for categorical quantities.
To emulate the percentage view of a pie chart, a 10x10 grid should be used.
In this way each square is representing 1% of the total.  Waffle provides
tools to create charts as well as stitch them together.  Isotype pictograms
can be made by using glyphs.")
    (license license:gpl2+)))

(define-public r-waveslim
  (package
    (name "r-waveslim")
    (version "1.8.5")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "waveslim" version))
       (sha256
        (base32
         "0xd7006skrsvkwj4pkxqbfsbs58rfcpfcfk1lf0gsd2y0wisi60y"))))
    (build-system r-build-system)
    (propagated-inputs
     (list r-multitaper))
    (home-page "http://waveslim.blogspot.com")
    (synopsis "Basic wavelet routines for signal processing")
    (description
     "This package provides basic wavelet routines for time series (1D),
image (2D) and array (3D) analysis.  The code provided here is based on
wavelet methodology developed in Percival and Walden (2000); Gencay, Selcuk
and Whitcher (2001); the dual-tree complex wavelet transform (DTCWT) from
Kingsbury (1999, 2001) as implemented by Selesnick; and Hilbert wavelet
pairs (Selesnick 2001, 2002).")
    (license license:bsd-3)))

(define-public r-word2vec
  (package
    (name "r-word2vec")
    (version "0.4.0")
    (source (origin
              (method url-fetch)
              (uri (cran-uri "word2vec" version))
              (sha256
               (base32
                "14ba0cj430d02bd6fay3nl4ldwqyj77iwjm4gzgdc0f6sx597iiq"))))
    (properties `((upstream-name . "word2vec")))
    (build-system r-build-system)
    (propagated-inputs (list r-rcpp r-rcppprogress))
    (home-page "https://github.com/bnosac/word2vec")
    (synopsis "Distributed representations of words")
    (description
     "Learn vector representations of words by continuous bag of words and
skip-gram implementations of the word2vec algorithm.  The techniques are
detailed in the paper \"Distributed Representations of Words and Phrases and
their Compositionality\" by Mikolov et al. (2013), available at
<arXiv:1310.4546>.")
    (license license:asl2.0)))

(define-public r-wordcloud
  (package
    (name "r-wordcloud")
    (version "2.6")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "wordcloud" version))
       (sha256
        (base32
         "0j96yyvm6bcrrpbdx4w26piqx44a0vbsr3px9cb4zk8a8da6jwak"))))
    (build-system r-build-system)
    (propagated-inputs
     (list r-rcolorbrewer r-rcpp
           ;; The "tm" package is only "suggested" according to CRAN, but the
           ;; wordcloud package cannot be loaded without it.
           r-tm))
    (home-page "https://cran.r-project.org/web/packages/wordcloud")
    (synopsis "Word clouds")
    (description
     "This package provides functionality to create pretty word clouds,
visualize differences and similarity between documents, and avoid
over-plotting in scatter plots with text.")
    (license license:lgpl2.1)))

(define-public r-colorramps
  (package
    (name "r-colorramps")
    (version "2.3.4")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "colorRamps" version))
       (sha256
        (base32
         "1y4gn6v8wmwq3wcfgdnx1ah2qa53gayvbfa62kp286ga4c8k3prw"))))
    (properties `((upstream-name . "colorRamps")))
    (build-system r-build-system)
    (home-page "https://cran.r-project.org/web/packages/colorRamps")
    (synopsis "Build color tables")
    (description "This package provides features to build gradient color
maps.")
    ;; Any version of the GPL
    (license license:gpl3+)))

(define-public r-tidytree
  (package
    (name "r-tidytree")
    (version "0.4.6")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "tidytree" version))
       (sha256
        (base32 "14i2v6ryqw4cd74n8kz4qwwx730wzx4f0rssg5vgm0vjfsx0kafv"))))
    (build-system r-build-system)
    (propagated-inputs
     (list r-ape
           r-cli
           r-dplyr
           r-lazyeval
           r-magrittr
           r-pillar
           r-rlang
           r-tibble
           r-tidyr
           r-tidyselect
           r-yulab-utils))
    (native-inputs
     (list r-knitr r-testthat))
    (home-page "https://github.com/GuangchuangYu/tidytree")
    (synopsis "Tidy tool for phylogenetic tree data manipulation")
    (description
     "Phylogenetic trees generally contain multiple components including nodes,
edges, branches and associated data.  This package provides an approach to
convert tree objects to tidy data frames.  It also provides tidy interfaces to
manipulate tree data.")
    (license license:artistic2.0)))

(define-public r-rvcheck
  (package
    (name "r-rvcheck")
    (version "0.2.1")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "rvcheck" version))
       (sha256
        (base32 "09khjklvzbafd7r55496by01a9g3y291d87hpy43w44dmz9fzn9a"))))
    (build-system r-build-system)
    (propagated-inputs
     (list r-biocmanager r-yulab-utils))
    (home-page "https://cran.r-project.org/web/packages/rvcheck")
    (synopsis "R package version check")
    (description
     "This package provides tools to check the latest release version of R and
R packages (on CRAN, Bioconductor or Github).")
    (license license:artistic2.0)))

(define-public r-doc2vec
  (package
    (name "r-doc2vec")
    (version "0.2.0")
    (source (origin
              (method url-fetch)
              (uri (cran-uri "doc2vec" version))
              (sha256
               (base32
                "0249hm0103kxxsi4gks4h20wf6p00gbrk9jf8c148mbja1l56f6v"))))
    (properties `((upstream-name . "doc2vec")))
    (build-system r-build-system)
    (propagated-inputs (list r-rcpp))
    (home-page "https://github.com/bnosac/doc2vec")
    (synopsis "Distributed representations of sentences, documents and topics")
    (description
     "Learn vector representations of sentences, paragraphs or documents by
using the Paragraph Vector algorithms, namely the distributed bag of
words (PV-DBOW) and the distributed memory (PV-DM) model.  Top2vec finds
clusters in text documents by combining techniques to embed documents and
words and density-based clustering.  It does this by embedding documents in
the semantic space as defined by the doc2vec algorithm.  Next it maps these
document embeddings to a lower-dimensional space using the Uniform Manifold
Approximation and Projection (UMAP) clustering algorithm and finds dense areas
in that space using a Hierarchical Density-Based Clustering
technique (HDBSCAN).  These dense areas are the topic clusters which can be
represented by the corresponding topic vector which is an aggregate of the
document embeddings of the documents which are part of that topic cluster.  In
the same semantic space similar words can be found which are representative of
the topic.")
    (license license:expat)))

(define-public r-docopt
  (package
    (name "r-docopt")
    (version "0.7.2")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "docopt" version))
       (sha256
        (base32
         "05z90kkm3qwyhrm20p0f0kyhb2rjidz6zh8chv44q1s6fc8r4dkq"))))
    (build-system r-build-system)
    (native-inputs (list r-testthat))
    (home-page "https://github.com/docopt/docopt.R")
    (synopsis "Command-line interface specification language")
    (description
     "This package enables you to define a command-line interface by just
giving it a description in the specific format.")
    (license license:expat)))

(define-public r-spamm
  (package
    (name "r-spamm")
    (version "4.5.0")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "spaMM" version))
       (sha256
        (base32 "1nr44jg73gnbc3q1ip7zmzl1n5bggbcgjrdlh6fg81zp41ba3ydv"))))
    (properties
     '((upstream-name . "spaMM")
       (updater-extra-inputs . ("gsl"))
       ;; We don't need these for tests.
       (updater-ignored-native-inputs
        . ("r-blackbox" "r-infusion" "r-inla" "r-isorix"
           "r-kinship2" "r-multcomp" "r-pkg" "r-safebinaryregression"))))
    (build-system r-build-system)
    (inputs (list gsl))
    (propagated-inputs (list r-backports
                             r-boot
                             r-crayon
                             r-geometry
                             r-gmp
                             r-mass
                             r-matrix
                             r-minqa
                             r-nlme
                             r-nloptr
                             r-numderiv
                             r-pbapply
                             r-proxy
                             r-rcpp
                             r-rcppeigen
                             r-roi))
    (native-inputs (list r-aster
                         r-caic4
                         r-compoissonreg
                         r-devtools
                         r-lme4
                         r-lmertest
                         r-mgcv
                         r-pedigreemm
                         r-sp
                         r-testthat
                         r-usethis))
    (home-page "https://www.r-project.org")
    (synopsis "Mixed-Effect Models, with or without Spatial Random Effects")
    (description
     "Inference based on models with or without spatially-correlated random effects,
multivariate responses, or non-Gaussian random effects (e.g., Beta).  Variation
in residual variance (heteroscedasticity) can itself be represented by a
mixed-effect model.  Both classical geostatistical models (Rousset and Ferdy
2014 <doi:10.1111/ecog.00566>), and Markov random field models on irregular
grids (as considered in the INLA package, <https://www.r-inla.org>), can be
fitted, with distinct computational procedures exploiting the sparse matrix
representations for the latter case and other autoregressive models.  Laplace
approximations are used for likelihood or restricted likelihood.  Penalized
quasi-likelihood and other variants discussed in the h-likelihood literature
(Lee and Nelder 2001 <doi:10.1093/biomet/88.4.987>) are also implemented.")
    (license license:cecill)))

(define-public r-sparsesvd
  (package
    (name "r-sparsesvd")
    (version "0.2-2")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "sparsesvd" version))
       (sha256
        (base32
         "0dnqjqypjwac8aqdqsqdgcd70lyrfv6idz8q2kzjiv1sxrlwqh5v"))))
    (build-system r-build-system)
    (propagated-inputs (list r-matrix))
    (home-page "http://tedlab.mit.edu/~dr/SVDLIBC/")
    (synopsis "Sparse truncated singular value decomposition")
    (description
     "This package provides a Wrapper around the SVDLIBC library
for (truncated) singular value decomposition of a sparse matrix.  Currently,
only sparse real matrices in Matrix package format are supported.")
    ;; SVDLIBC is released under BSD-2.  The R interface is released under
    ;; BSD-3.
    (license (list license:bsd-3 license:bsd-2))))

(define-public r-sparsevctrs
  (package
    (name "r-sparsevctrs")
    (version "0.3.4")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "sparsevctrs" version))
       (sha256
        (base32 "0wpjxcyckx3wnxdky3slyacv1nwm4xqc9aib2qm268pd0ksgpik9"))))
    (properties `((upstream-name . "sparsevctrs")))
    (build-system r-build-system)
    (propagated-inputs (list r-cli r-rlang r-vctrs))
    (native-inputs (list r-knitr r-matrix r-testthat r-tibble r-withr))
    (home-page "https://github.com/r-lib/sparsevctrs")
    (synopsis "Sparse Vectors for use in data frames")
    (description
     "This package provides sparse vectors powered by ALTREP (Alternative
Representations for R Objects) that behave like regular vectors, and can thus
be used in data frames.  It also provides tools to convert between sparse
matrices and data frames with sparse columns and functions to interact with
sparse vectors.")
    (license license:expat)))

(define-public r-spatialreg
  (package
    (name "r-spatialreg")
    (version "1.3-6")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "spatialreg" version))
       (sha256
        (base32 "020jr120lapsrgyfsmfls4229spy1rn83096ipnhfp7pzdnfsib4"))))
    (properties `((upstream-name . "spatialreg")))
    (build-system r-build-system)
    (propagated-inputs (list r-boot
                             r-coda
                             r-learnbayes
                             r-mass
                             r-matrix
                             r-multcomp
                             r-nlme
                             r-sf
                             r-spdata
                             r-spdep))
    (native-inputs (list r-knitr r-tinytest))
    (home-page "https://github.com/r-spatial/spatialreg/")
    (synopsis "Spatial regression analysis")
    (description
     "This package provides a collection of all the estimation functions for
spatial cross-sectional models (on lattice/areal data using spatial weights
matrices) contained up to now in @code{spdep}.")
    (license license:gpl2)))

(define-public r-speedglm
  (package
    (name "r-speedglm")
    (version "0.3-5")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "speedglm" version))
       (sha256
        (base32
         "0jxvh9gbhip1hj7hzjs5fj8iw6ibvl6hc0llcg2j9wqgq5vkcrpq"))))
    (build-system r-build-system)
    (propagated-inputs
     (list r-biglm r-mass r-matrix))
    (home-page "https://cran.r-project.org/web/packages/speedglm")
    (synopsis "Fit linear and generalized linear models to large data sets")
    (description
     "This package provides tools for fitting linear models and generalized
linear models to large data sets by updating algorithms.")
    ;; Any version of the GPL
    (license license:gpl2+)))

(define-public r-densityclust
  (package
    (name "r-densityclust")
    (version "0.3.3")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "densityClust" version))
       (sha256
        (base32
         "0iiq2zal792741z1a23h7cy9jp4hsc7513dxain132526f1yrzsl"))))
    (properties `((upstream-name . "densityClust")))
    (build-system r-build-system)
    (propagated-inputs
     (list r-cpp11
           r-fnn
           r-ggplot2
           r-ggrepel
           r-gridextra
           r-rcolorbrewer
           r-rtsne))
    (native-inputs (list r-testthat))
    (home-page "https://cran.r-project.org/web/packages/densityClust")
    (synopsis "Clustering by fast search and find of density peaks")
    (description
     "This package provides an improved implementation (based on k-nearest
neighbors) of the density peak clustering algorithm, originally described by
Alex Rodriguez and Alessandro Laio (Science, 2014 vol. 344).  It can handle
large datasets (> 100,000 samples) very efficiently.")
    (license license:gpl2+)))

(define-public r-combinat
  (package
    (name "r-combinat")
    (version "0.0-8")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "combinat" version))
       (sha256
        (base32
         "1h9hr88gigihc4na7lb5i7rn4az1xa7sb34zvnznaj6pdrmwy4qm"))))
    (build-system r-build-system)
    (home-page "https://cran.r-project.org/web/packages/combinat")
    (synopsis "Combinatorics utilities")
    (description "This package provides assorted routines for combinatorics.")
    (license license:gpl2)))

(define-public r-qlcmatrix
  (package
    (name "r-qlcmatrix")
    (version "0.9.8")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "qlcMatrix" version))
       (sha256
        (base32
         "0d38jb653787s05g8syc9wgaljaifmkviijwz5rzcd881glgs8sv"))))
    (properties `((upstream-name . "qlcMatrix")))
    (build-system r-build-system)
    (propagated-inputs
     (list r-docopt r-matrix r-slam r-sparsesvd))
    (native-inputs (list r-knitr r-rmarkdown))
    (home-page "https://cran.r-project.org/web/packages/qlcMatrix")
    (synopsis "Sparse matrix functions for quantitative language comparison")
    (description
     "This package provides an extension of the functionality of the Matrix
package for using sparse matrices.  Some of the functions are very general,
while other are highly specific for the special data format used for
@dfn{quantitative language comparison} (QLC).")
    (license license:gpl3)))

(define-public r-qmri
  (package
    (name "r-qmri")
    (version "1.2.7.9")
    (source (origin
              (method url-fetch)
              (uri (cran-uri "qMRI" version))
              (sha256
               (base32
                "0alf4br92r4wb9vziw949qjxllkw5ikwa2lx7kvkxgvfy8xm27ff"))))
    (properties `((upstream-name . "qMRI")))
    (build-system r-build-system)
    (propagated-inputs (list r-adimpro r-aws r-awsmethods r-oro-nifti
                             r-stringr))
    (native-inputs (list gfortran r-knitr))
    (home-page "http://www.wias-berlin.de/research/ats/imaging/")
    (synopsis "Methods for quantitative magnetic resonance imaging (qMRI)")
    (description
     "This package provides implementation of methods for estimation of
quantitative maps from @dfn{Multi-Parameter Mapping} (MPM) acquisitions
including adaptive smoothing methods in the framework of the ESTATICS model.
The smoothing method is described in Mohammadi et
al. (2017). <doi:10.20347/WIAS.PREPRINT.2432>.  Usage of the package is also
described in Polzehl and Tabelow (2019), Magnetic Resonance Brain Imaging,
Chapter 6, Springer, Use R! Series. <doi:10.1007/978-3-030-29184-6_6>.")
    (license license:gpl2+)))

(define-public r-ddrtree
  (package
    (name "r-ddrtree")
    (version "0.1.5")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "DDRTree" version))
       (sha256
        (base32
         "16s5fjw7kwlxhrkzdny62sx32fvmg3rxjc3wrh6krd31jh1fqlfk"))))
    (properties `((upstream-name . "DDRTree")))
    (build-system r-build-system)
    (propagated-inputs
     (list r-bh r-irlba r-rcpp r-rcppeigen))
    (home-page "https://cran.r-project.org/web/packages/DDRTree")
    (synopsis "Learning principal graphs with DDRTree")
    (description
     "This package provides an implementation of the framework of
@dfn{reversed graph embedding} (RGE) which projects data into a reduced
dimensional space while constructs a principal tree which passes through the
middle of the data simultaneously.  DDRTree shows superiority to
alternatives (Wishbone, DPT) for inferring the ordering as well as the
intrinsic structure of single cell genomics data.  In general, it could be
used to reconstruct the temporal progression as well as the bifurcation
structure of any data type.")
    (license license:asl2.0)))

(define-public r-corpcor
  (package
    (name "r-corpcor")
    (version "1.6.10")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "corpcor" version))
       (sha256
        (base32
         "028fw61n61i79fhnaqx7gmdifdpbvp3yiaq9vvfrbv4k7i84r83i"))))
    (build-system r-build-system)
    (home-page "https://strimmerlab.org/software/corpcor/")
    (synopsis "Efficient estimation of covariance and (partial) correlation")
    (description
     "This package implements a James-Stein-type shrinkage estimator for the
covariance matrix, with separate shrinkage for variances and correlations.
Furthermore, functions are available for fast singular value decomposition,
for computing the pseudoinverse, and for checking the rank and positive
definiteness of a matrix.")
    (license license:gpl3+)))

(define-public r-rspectra
  (package
    (name "r-rspectra")
    (version "0.16-2")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "RSpectra" version))
       (sha256
        (base32
         "0zma49ah0sycjdx95m8mac21daa7p3gp9cg1mffygzhrjpblkwd2"))))
    (properties `((upstream-name . "RSpectra")))
    (build-system r-build-system)
    (propagated-inputs
     (list r-matrix r-rcpp r-rcppeigen))
    (native-inputs
     (list r-knitr r-rmarkdown))
    (home-page "https://github.com/yixuan/RSpectra")
    (synopsis "Solvers for large-scale Eigenvalue and SVD problems")
    (description
     "This package provides an R interface to the Spectra library for
large-scale eigenvalue and SVD problems.  It is typically used to compute a
few eigenvalues/vectors of an n by n matrix, e.g., the k largest eigenvalues,
which is usually more efficient than @code{eigen()} if k << n.")
    ;; MPL 2 or later.
    (license license:mpl2.0)))

(define-public r-vbsr
  (package
    (name "r-vbsr")
    (version "0.0.5")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "vbsr" version))
       (sha256
        (base32
         "1avskbxxyinjjdga4rnghcfvd4sypv4m39ysfaij5avvmi89bx3b"))))
    (build-system r-build-system)
    (home-page "https://cran.r-project.org/web/packages/vbsr")
    (synopsis "Variational Bayes spike regression regularized linear models")
    (description
     "This package provides an efficient algorithm for solving ultra-sparse
regularized regression models using a variational Bayes algorithm with a spike
prior.  The algorithm is solved on a path, with coordinate updates, and is
capable of generating very sparse models.  Very general model
diagnostics for controlling type-1 errors are also provided.")
    (license license:gpl2)))

(define-public r-flare
  (package
    (name "r-flare")
    (version "1.7.0.2")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "flare" version))
       (sha256
        (base32
         "1i3nyvi8av74v1jy85gqai73vf0hzlkk5rdpfnmvi8d7q4fa7xvg"))))
    (build-system r-build-system)
    (propagated-inputs
     (list r-igraph r-lattice r-mass r-matrix))
    (home-page "https://cran.r-project.org/web/packages/flare")
    (synopsis "Family of Lasso regression implementations")
    (description
     "This package provides implementations of a family of Lasso variants
including Dantzig Selector, LAD Lasso, SQRT Lasso, Lq Lasso for estimating
high dimensional sparse linear models.")
    (license license:gpl2)))

(define-public r-lassopv
  (package
    (name "r-lassopv")
    (version "0.2.0")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "lassopv" version))
       (sha256
        (base32
         "0yawnjw063jypk3riy9xab9cmliv6c9dnabi18670khd3gzb2r9z"))))
    (build-system r-build-system)
    (propagated-inputs (list r-lars))
    (home-page "https://github.com/lingfeiwang/lassopv")
    (synopsis "Non-parametric p-value estimation for predictors in Lasso")
    (description
     "This package enables you to estimate the p-values for predictors x
against target variable y in Lasso regression, using the regularization
strength when each predictor enters the active set of regularization path for
the first time as the statistic.")
    (license license:gpl3)))

(define-public r-splines2
  (package
    (name "r-splines2")
    (version "0.5.4")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "splines2" version))
       (sha256
        (base32 "0izjcpcwi35b7m4i9yp2frk1nfij9nw338w7z1fwpkw75c7ac4av"))))
    (properties `((upstream-name . "splines2")))
    (build-system r-build-system)
    (propagated-inputs (list r-rcpp r-rcpparmadillo))
    (native-inputs (list r-knitr r-tinytest))
    (home-page "https://wwenjie.org/splines2")
    (synopsis "Regression spline functions and classes")
    (description
     "This package constructs basis functions of B-splines, M-splines,
I-splines, convex splines (C-splines), periodic splines, natural cubic
splines, generalized Bernstein polynomials, their derivatives, and
integrals (except C-splines) by closed-form recursive formulas.  It also
contains a C++ head-only library integrated with Rcpp.")
    (license license:gpl3+)))

(define-public r-splitstackshape
  (package
    (name "r-splitstackshape")
    (version "1.4.8")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "splitstackshape" version))
       (sha256
        (base32
         "0mpyf2kkfdl69pdc6brl1r6101vyc6pgr7z17s55ppg3y71k4q35"))))
    (build-system r-build-system)
    (propagated-inputs
     (list r-data-table))
    (native-inputs (list r-testthat))
    (home-page "https://github.com/mrdwab/splitstackshape")
    (synopsis "Stack and reshape datasets after splitting concatenated values")
    (description
     "Online data collection tools like Google Forms often export
multiple-response questions with data concatenated in cells.  The
@code{concat.split} (cSplit) family of functions provided by this package
splits such data into separate cells.  This package also includes functions to
stack groups of columns and to reshape wide data, even when the data are
\"unbalanced\"---something which @code{reshape} (from base R) does not handle,
and which @code{melt} and @code{dcast} from @code{reshape2} do not easily
handle.")
    (license license:gpl3)))

(define-public r-tfmpvalue
  (package
    (name "r-tfmpvalue")
    (version "0.0.9")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "TFMPvalue" version))
       (sha256
        (base32
         "1rsxqvq1nkyhwmhm7mf7rd02rvh7xinnhqbqic6q9vicbvkmdnxr"))))
    (properties `((upstream-name . "TFMPvalue")))
    (build-system r-build-system)
    (propagated-inputs (list r-rcpp))
    (native-inputs (list r-testthat))
    (home-page "https://github.com/ge11232002/TFMPvalue")
    (synopsis "P-value computation for position weight matrices")
    (description
     "In putative @dfn{Transcription Factor Binding Sites} (TFBSs)
identification from sequence/alignments, we are interested in the significance
of certain match scores.  TFMPvalue provides the accurate calculation of a
p-value with a score threshold for position weight matrices, or the score with
a given p-value.  It is an interface to code originally made available by
Helene Touzet and Jean-Stephane Varre, 2007, Algorithms Mol Biol:2, 15.
Touzet and Varre (2007).")
    (license license:gpl2)))

(define-public r-rnaturalearth
  (package
    (name "r-rnaturalearth")
    (version "1.0.1")
    (source (origin
              (method url-fetch)
              (uri (cran-uri "rnaturalearth" version))
              (sha256
               (base32
                "1vfkn4bf77mr2n7dhmnl55ma4cvwy2nazhizmdqd98w2ydl13z3p"))))
    (properties `((upstream-name . "rnaturalearth")))
    (build-system r-build-system)
    (propagated-inputs (list r-httr r-jsonlite r-sf r-terra))
    (native-inputs (list r-knitr r-testthat))
    (home-page "https://cran.r-project.org/package=rnaturalearth")
    (synopsis "World map data from Natural Earth")
    (description
     "This package facilitates mapping by making natural earth map data from
@url{https://www.naturalearthdata.com/} more easily available to R users.")
    (license license:expat)))

(define-public r-rnaturalearthdata
  (package
    (name "r-rnaturalearthdata")
    (version "1.0.0")
    (source (origin
              (method url-fetch)
              (uri (cran-uri "rnaturalearthdata" version))
              (sha256
               (base32
                "0k8yzgpbf8d2jxxy9vzqfa3z3w4h3i9kp4rc811f4pspxbqzmzp1"))))
    (properties `((upstream-name . "rnaturalearthdata")))
    (build-system r-build-system)
    (native-inputs (list r-testthat))
    (home-page "https://github.com/ropenscilabs/rnaturalearthdata")
    (synopsis "World vector map data from Natural Earth")
    (description
     "This package provides vector map data from
@url{https://www.naturalearthdata.com/}.  Access functions are provided in the
accompanying package @code{rnaturalearth}.")
    (license license:cc0)))

(define-public r-rncl
  (package
    (name "r-rncl")
    (version "0.8.7")
    (source (origin
              (method url-fetch)
              (uri (cran-uri "rncl" version))
              (sha256
               (base32
                "0flrqz7pansy11ds23qv06bcmh6vxqljq0517v6292ibbx7nx1qx"))))
    (properties
     '((updater-extra-native-inputs . ("r-ape"))))
    (build-system r-build-system)
    (propagated-inputs
     (list r-progress r-rcpp))
    (native-inputs (list r-ape r-testthat))
    (home-page "https://github.com/fmichonneau/rncl")
    (synopsis "Interface to the Nexus class library")
    (description "This package provides an interface to the Nexus class
library which allows parsing of NEXUS, Newick and other phylogenetic tree
 file formats.  It provides elements of the file that can be used to build
 phylogenetic objects such as @code{ape}'s @code{phylo} or @code{phylobase}'s
@code{phylo4(d)}.  This functionality is demonstrated with
@code{read_newick_phylo()} and @code{read_nexus_phylo()}.")
    (license license:bsd-2)))

(define-public r-phylobase
  (package
    (name "r-phylobase")
    (version "0.8.12")
    (source (origin
              (method url-fetch)
              (uri (cran-uri "phylobase" version))
              (sha256
               (base32
                "084gfzq51acmvzbsfpkqv3kgghdbncnwr008f95yf5b2vihcm0cv"))))
    (build-system r-build-system)
    (propagated-inputs
     (list r-ade4 r-ape r-rcpp r-rncl r-rnexml))
    (native-inputs
     (list r-knitr r-testthat))
    (home-page "https://github.com/fmichonneau/phylobase")
    (synopsis "Base package for phylogenetic structures and comparative data")
    (description "This package provides a base @code{S4} class for comparative
methods, incorporating one or more trees and trait data.")
    (license license:gpl2+)))

(define-public r-phylotools
  (package
    (name "r-phylotools")
    (version "0.2.2")
    (source (origin
              (method url-fetch)
              (uri (cran-uri "phylotools" version))
              (sha256
               (base32
                "1dhk1ncp5zi4zl1xfnjz64v983dm7bq7iimfjin80j0bdcpps44w"))))
    (properties `((upstream-name . "phylotools")))
    (build-system r-build-system)
    (propagated-inputs (list r-ape))
    (home-page "https://github.com/helixcn/phylotools")
    (synopsis "Phylogenetic tools for eco-phylogenetics")
    (description
     "This package provides a collection of tools for building RAxML
supermatrix using PHYLIP or aligned FASTA files.  These functions will be
useful for building large phylogenies using multiple markers.")
    (license license:gpl2)))

(define-public r-rnetcdf
  (package
    (name "r-rnetcdf")
    (version "2.11-1")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "RNetCDF" version))
       (sha256
        (base32 "0n3zc7i59cr3qms2x2spn948wl9imd7yiajwwyn6mac0q0wrbb18"))))
    (properties `((upstream-name . "RNetCDF")))
    (build-system r-build-system)
    (inputs (list netcdf udunits))
    (native-inputs (list pkg-config))
    (home-page "https://cran.r-project.org/package=RNetCDF")
    (synopsis "Interface to NetCDF datasets")
    (description
     "This package provides an interface to the NetCDF file formats designed
by Unidata for efficient storage of array-oriented scientific data and
descriptions.  Most capabilities of NetCDF version 4 are supported.  Optional
conversions of time units are enabled by UDUNITS version 2, also from
Unidata.")
    (license license:gpl2+)))

(define-public r-rnexml
  (package
    (name "r-rnexml")
    (version "2.4.11")
    (source (origin
              (method url-fetch)
              (uri (cran-uri "RNeXML" version))
              (sha256
               (base32
                "0ipxdhfzccpqmnfrqdy8bizm80k2chhdlzg3p0dl05p8n35i6s94"))))
    (build-system r-build-system)
    (arguments
     (list
      #:phases
      '(modify-phases %standard-phases
         (add-after 'unpack 'disable-bad-tests
           (lambda _
             ;; This test requires Internet access.
             (delete-file "tests/testthat/test_nexml_read.R"))))))
    (propagated-inputs
     (list r-ape
           r-dplyr
           r-httr
           r-plyr
           r-reshape2
           r-rlang
           r-stringi
           r-stringr
           r-tidyr
           r-uuid
           r-xml
           r-xml2))
    (native-inputs
     (list r-knitr r-testthat))
    (home-page "https://docs.ropensci.org/RNeXML/")
    (synopsis "Semantically rich I/O for the NeXML Format")
    (description "This package provides access to phyloinformatic data in
NeXML format.  The package should add new functionality to R such as the
possibility to manipulate NeXML objects in more various and refined way
and compatibility with @code{ape} objects.")
    (license license:bsd-3)))

(define-public r-rnifti
  (package
    (name "r-rnifti")
    (version "1.8.0")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "RNifti" version))
       (sha256
        (base32
         "14hpg27jfsk35c2ds33z0bfv3kn17y9bsnzwddrav4wc5zzm2arj"))))
    (properties `((upstream-name . "RNifti")))
    (build-system r-build-system)
    (inputs (list zlib))
    (propagated-inputs (list r-rcpp))
    (home-page "https://github.com/jonclayden/RNifti")
    (synopsis "Fast R and C++ access to NIfTI images")
    (description
     "This package provides very fast read and write access to images stored
in the NIfTI-1 and ANALYZE-7.5 formats, with seamless synchronisation between
compiled C and interpreted R code.  It also provides a C/C++ API that can be
used by other packages.")
    (license license:gpl2)))

(define-public r-shades
  (package
    (name "r-shades")
    (version "1.4.0")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "shades" version))
       (sha256
        (base32
         "1zg95sjhrfvbdlfc387g9p0vnb8nb6agdk1mb3wq3kwkm2da0bqj"))))
    (build-system r-build-system)
    (native-inputs (list r-testthat))
    (home-page "https://github.com/jonclayden/shades")
    (synopsis "Simple color manipulation")
    (description
     "This package provides functions for easily manipulating colors,
creating color scales and calculating color distances.")
    (license license:bsd-3)))

(define-public r-ore
  (package
    (name "r-ore")
    (version "1.7.5.1")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "ore" version))
       (sha256
        (base32 "11b952icdjv2g3pfbap7kyphwvbl3dssyvd61f0wrv7prscl8pbz"))))
    (build-system r-build-system)
    (home-page "https://github.com/jonclayden/ore")
    (synopsis "R interface to the Onigmo regular expression library")
    (description
     "This package provides an alternative to R's built-in functionality for
handling regular expressions, based on the Onigmo library.  It offers
first-class compiled regex objects, partial matching and function-based
substitutions, amongst other features.")
    (license license:bsd-3)))

(define-public r-reportr
  (package
    (name "r-reportr")
    (version "1.3.1")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "reportr" version))
       (sha256
        (base32
         "01grnwhgz7ff796fra3320i0bpvwi8ja0hqsvl0s0jlbq9rxb9az"))))
    (build-system r-build-system)
    (propagated-inputs (list r-ore))
    (native-inputs (list r-tinytest))
    (home-page "https://github.com/jonclayden/reportr")
    (synopsis "General message and error reporting system")
    (description
     "This package provides a system for reporting messages, which offers
certain useful features over the standard R system, such as the incorporation
of output consolidation, message filtering, assertions, expression
substitution, automatic generation of stack traces for debugging, and
conditional reporting based on the current \"output level\".")
    (license license:gpl2)))

(define-public r-tractor-base
  (package
    (name "r-tractor-base")
    (version "3.4.2")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "tractor.base" version))
       (sha256
        (base32
         "12mp5x6c7c82a4z7p39cb478kwwf6lkrgbis6ak00yibsd3n6na3"))))
    (properties `((upstream-name . "tractor.base")))
    (build-system r-build-system)
    (propagated-inputs
     (list r-ore r-reportr r-rnifti r-shades))
    (home-page "https://www.tractor-mri.org.uk")
    (synopsis "Read, manipulate and visualize magnetic resonance images")
    (description
     "This package provides functions for working with magnetic resonance
images.  It supports reading and writing of popular file formats (DICOM,
Analyze, NIfTI-1, NIfTI-2, MGH); interactive and non-interactive
visualization; flexible image manipulation; metadata and sparse image
handling.")
    (license license:gpl2)))

(define-public r-gridpattern
  (package
    (name "r-gridpattern")
    (version "1.3.1")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "gridpattern" version))
       (sha256
        (base32 "19ffi9yvpk012mj7jc8gjwx505qrs0gqsdmw1zk4q6iq9rygyrrf"))))
    (properties `((upstream-name . "gridpattern")))
    (build-system r-build-system)
    (propagated-inputs
     (list r-glue
           r-memoise
           r-png
           r-rlang
           r-sf))
    (native-inputs (list r-knitr r-magick r-rmarkdown r-testthat r-vdiffr))
    (home-page "https://trevorldavis.com/R/gridpattern/")
    (synopsis "Grid pattern grobs")
    (description
     "This package provides grid grobs that fill in a user-defined area with
various patterns.  It includes enhanced versions of the geometric and
image-based patterns originally contained in the ggpattern package as well as
original @code{pch}, @code{polygon_tiling}, @code{regular_polygon},
@code{rose}, @code{text}, @code{wave}, and @code{weave} patterns plus support
for custom user-defined patterns.")
    (license license:expat)))

(define-public r-gridsvg
  (package
    (name "r-gridsvg")
    (version "1.7-5")
    (source (origin
              (method url-fetch)
              (uri (cran-uri "gridSVG" version))
              (sha256
               (base32
                "1p8qnx9q96bni39x44l40rgcdi9r440zbipdfvkbs2paysx6mkr5"))))
    (properties `((upstream-name . "gridSVG")))
    (build-system r-build-system)
    (propagated-inputs
     (list r-jsonlite r-xml))
    (native-inputs (list r-lattice))
    (home-page "https://cran.r-project.org/package=gridSVG")
    (synopsis "Export grid gaphics as SVG")
    (description
     "This package provides functions to export graphics drawn with package
grid to SVG format.  Extra functions provide access to SVG features that are
not available in standard R graphics, such as hyperlinks, animation, filters,
masks, clipping paths, and gradient and pattern fills.")
    ;; Any version of the GPL.
    (license (list license:gpl2 license:gpl3))))

(define-public r-grimport
  (package
    (name "r-grimport")
    (version "0.9-7")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "grImport" version))
       (sha256
        (base32
         "196h7i4y1gzkwlybml9iz78p5xsx7y22nk5pmzibryn5amdbdy05"))))
    (properties `((upstream-name . "grImport")))
    (build-system r-build-system)
    ;; Vignettes fail to find chessmod.txt
    (arguments (list #:test-types '(list "tests")))
    (inputs
     (list ghostscript))
    (propagated-inputs
     (list r-xml))
    (native-inputs (list r-lattice))
    (home-page "https://cran.r-project.org/web/packages/grImport")
    (synopsis "Convert, import, and draw PostScript pictures")
    (description
     "This package provides functions for converting, importing, and drawing
PostScript pictures in R plots.")
    (license license:gpl2+)))

(define-public r-grimport2
  (package
    (name "r-grimport2")
    (version "0.3-3")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "grImport2" version))
       (sha256
        (base32
         "11glz1yi76235x3di9r7nny0nfcisk12acc4xsm4m2d9ingjh4pn"))))
    (properties `((upstream-name . "grImport2")))
    (build-system r-build-system)
    (propagated-inputs
     (list r-base64enc r-jpeg r-png r-xml))
    (native-inputs (list r-gridsvg))
    (home-page "https://cran.r-project.org/web/packages/grImport2/")
    (synopsis "Import SVG graphics")
    (description
     "This package provides functions for importing external vector images and
drawing them as part of R plots.  This package is different from the
@code{grImport} package because, where that package imports PostScript format
images, this package imports SVG format images.  Furthermore, this package
imports a specific subset of SVG, so external images must be preprocessed
using a package like @code{rsvg} to produce SVG that this package can import.
SVG features that are not supported by R graphics, such as gradient fills, can
be imported and then exported via the @code{gridSVG} package.")
    (license license:gpl2+)))

(define-public r-kohonen
  (package
    (name "r-kohonen")
    (version "3.0.12")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "kohonen" version))
       (sha256
        (base32
         "188cxw2fvpfr3dyi8g52igcyc8d5jffyn6rhc84dja52da8lp520"))))
    (build-system r-build-system)
    (propagated-inputs
     (list r-rcpp))
    (home-page "https://cran.r-project.org/web/packages/kohonen")
    (synopsis "Supervised and unsupervised self-organising maps")
    (description
     "This package provides functions to train @dfn{self-organising
maps} (SOMs).  Also interrogation of the maps and prediction using trained
maps are supported.  The name of the package refers to Teuvo Kohonen, the
inventor of the SOM.")
    (license license:gpl2+)))

(define-public r-nnet
  (package
    (name "r-nnet")
    (version "7.3-20")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "nnet" version))
       (sha256
        (base32
         "0mdmnafhjas0cd5ac5c2pb6nzii3m9dqgr7y3fycyqdi1rzf2cwg"))))
    (build-system r-build-system)
    (home-page "https://www.stats.ox.ac.uk/pub/MASS4/")
    (synopsis "Feed-forward neural networks and multinomial log-linear models")
    (description
     "This package provides functions for feed-forward neural networks with a
single hidden layer, and for multinomial log-linear models.")
    (license (list license:gpl2+ license:gpl3+))))

(define-public r-nnls
  (package
    (name "r-nnls")
    (version "1.6")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "nnls" version))
       (sha256
        (base32
         "1nkz25rld4ia9l5zwf4dn9imd15mdi8lmi3ydx449dxsrxs62br7"))))
    (build-system r-build-system)
    (native-inputs (list gfortran))
    (home-page "https://cran.r-project.org/web/packages/nnls")
    (synopsis "Lawson-Hanson algorithm for non-negative least squares")
    (description
     "This package provides an R interface to the Lawson-Hanson implementation
of an algorithm for @dfn{non-negative least squares} (NNLS).  It also allows
the combination of non-negative and non-positive constraints.")
    (license license:gpl2+)))

(define-public r-iso
  (package
    (name "r-iso")
    (version "0.0-21")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "Iso" version))
       (sha256
        (base32
         "19lgwbfbca30mh3hhnarzab5cvnrwnr0pxam6fvfnadnqzhjm15n"))))
    (properties `((upstream-name . "Iso")))
    (build-system r-build-system)
    (native-inputs (list gfortran))
    (home-page "https://www.stat.auckland.ac.nz/~rolf/")
    (synopsis "Functions to perform isotonic regression")
    (description
     "This package provides support for linear order and unimodal
order (univariate) isotonic regression and bivariate isotonic regression with
linear order on both variables.")
    (license license:gpl2+)))

(define-public r-isorix
  (package
    (name "r-isorix")
    (version "0.9.3")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "IsoriX" version))
       (sha256
        (base32 "1z86qgl68l9mpyf0ym1szvwv416mx7gqkr15gs5i0jlw4zafc1jc"))))
    (properties `((upstream-name . "IsoriX")))
    (build-system r-build-system)
    (propagated-inputs (list r-lattice
                             r-latticeextra
                             r-numderiv
                             r-rastervis
                             r-spamm
                             r-terra
                             r-viridislite))
    (native-inputs (list r-devtools r-spelling r-testthat r-withr))
    (home-page "https://github.com/courtiol/IsoriX")
    (synopsis
     "Isoscape computation and inference of spatial origins using mixed models")
    (description
     "This package is for building isoscapes using mixed models and inferring
the geographic origin of samples based on their isotopic ratios.  This package
is essentially a simplified interface to several other packages which
implements a new statistical framework based on mixed models.  It uses
@code{spaMM} for fitting and predicting isoscapes, and assigning an organism's
origin depending on its isotopic ratio.  @code{IsoriX} also relies heavily on
the package @code{rasterVis} for plotting the maps produced with terra using
lattice'.")
    (license license:gpl2+)))

(define-public r-chemometrics
  (package
    (name "r-chemometrics")
    (version "1.4.4")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "chemometrics" version))
       (sha256
        (base32 "10d8g8sgck6v2cgkv988yiawv9vrziyqsrhagmkzf7rjpqgdn3px"))))
    (properties `((upstream-name . "chemometrics")))
    (build-system r-build-system)
    (propagated-inputs
     (list r-class
           r-e1071
           r-lars
           r-mass
           r-mclust
           r-nnet
           r-pcapp
           r-pls
           r-robustbase
           r-rpart
           r-som))
    (home-page "http://www.statistik.tuwien.ac.at/public/filz/")
    (synopsis "Multivariate statistical analysis in Chemometrics")
    (description
     "Multivariate data analysis is the simultaneous observation of more than
one characteristic.  In contrast to the analysis of univariate data, in this
approach not only a single variable or the relation between two variables can
be investigated, but the relations between many attributes can be considered.
For the statistical analysis of chemical data one has to take into account the
special structure of this type of data.  This package contains about 30
functions, mostly for regression, classification and model evaluation and
includes some data sets used in the R help examples.  It was designed as a R
companion to the book \"Introduction to Multivariate Statistical Analysis in
Chemometrics\" written by K. Varmuza and P. Filzmoser (2009).")
    (license license:gpl3+)))

(define-public r-chemometricswithr
  (package
    (name "r-chemometricswithr")
    (version "0.1.13")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "ChemometricsWithR" version))
       (sha256
        (base32
         "166va1g3m1wv21qkmw4wpz0bsrclh3jih8smxphdc13l9pqgclpq"))))
    (properties
     `((upstream-name . "ChemometricsWithR")))
    (build-system r-build-system)
    (propagated-inputs
     (list r-devtools r-kohonen r-mass r-pls))
    (home-page "https://github.com/rwehrens/CWR")
    (synopsis "Chemometrics with R")
    (description
     "This package provides functions and scripts used in the book
\"Chemometrics with R - Multivariate Data Analysis in the Natural Sciences and
Life Sciences\" by Ron Wehrens, Springer (2011).")
    (license license:gpl2+)))

(define-public r-als
  (package
    (name "r-als")
    (version "0.0.7")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "ALS" version))
       (sha256
        (base32
         "184d6xr4mgs78jvi7xa4njrq6p625i9sx69wak6mdn53qpl9b8ap"))))
    (properties `((upstream-name . "ALS")))
    (build-system r-build-system)
    (propagated-inputs
     (list r-iso r-nnls))
    (home-page "https://cran.r-project.org/web/packages/ALS")
    (synopsis "Multivariate curve resolution alternating least squares")
    (description
     "Alternating least squares is often used to resolve components
contributing to data with a bilinear structure; the basic technique may be
extended to alternating constrained least squares.  This package provides an
implementation of @dfn{multivariate curve resolution alternating least
squares} (MCR-ALS).

Commonly applied constraints include unimodality, non-negativity, and
normalization of components.  Several data matrices may be decomposed
simultaneously by assuming that one of the two matrices in the bilinear
decomposition is shared between datasets.")
    (license license:gpl2+)))

(define-public r-strucchange
  (package
    (name "r-strucchange")
    (version "1.5-4")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "strucchange" version))
       (sha256
        (base32
         "066pbldj1a0hdhrzszqp8ad71krj7w5dbqxmgp8kk5d76r6wd6vq"))))
    (build-system r-build-system)
    (propagated-inputs
     (list r-sandwich r-zoo))
    (home-page "https://cran.r-project.org/web/packages/strucchange")
    (synopsis "Testing, monitoring, and dating structural changes")
    (description
     "This package provides tools for testing, monitoring and dating
structural changes in (linear) regression models.  It features tests/methods
from the generalized fluctuation test framework as well as from the F
test (Chow test) framework.  This includes methods to fit, plot and test
fluctuation processes (e.g., CUSUM, MOSUM, recursive/moving estimates) and F
statistics, respectively.  It is possible to monitor incoming data online
using fluctuation processes.  Finally, the breakpoints in regression models
with structural changes can be estimated together with confidence intervals.
Emphasis is always given to methods for visualizing the data.")
    ;; Either of these two GPL versions
    (license (list license:gpl2 license:gpl3))))

(define-public r-pixmap
  (package
    (name "r-pixmap")
    (version "0.4-13")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "pixmap" version))
       (sha256
        (base32
         "04g74v8g9r0f3czzk4r3n0wxyg7ldgfdlh21bas7axa9l10wdnz3"))))
    (build-system r-build-system)
    (home-page "https://cran.r-project.org/web/packages/pixmap")
    (synopsis "Tools for bitmap images")
    (description
     "This package provides functions for importing, exporting, plotting and
other manipulations of bitmapped images.")
    (license license:gpl2)))

(define-public r-rapidjsonr
  (package
    (name "r-rapidjsonr")
    (version "1.2.0")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "rapidjsonr" version))
       (sha256
        (base32
         "07zdirhbzmvq3cp4xn8ngk1lgxbbabzays315zxbs3sxrz6lzjb2"))))
    (build-system r-build-system)
    (home-page "https://cran.r-project.org/web/packages/rapidjsonr")
    (synopsis "JSON parser")
    (description
     "This package provides JSON parsing capability through the Rapidjson
library.")
    (license license:expat)))

(define-public r-ontologyindex
  (package
    (name "r-ontologyindex")
    (version "2.12")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "ontologyIndex" version))
       (sha256
        (base32
         "0gf0z0vgc1f4f70f2zpwz9bka0gbgbj4w3fcxncv1b7lbrxddrd8"))))
    (properties `((upstream-name . "ontologyIndex")))
    (build-system r-build-system)
    (native-inputs
     (list r-knitr))
    (home-page "https://cran.r-project.org/web/packages/ontologyIndex")
    (synopsis "Functions for processing ontologies in R")
    (description
     "This package provides functions for reading ontologies into R as lists
and manipulating sets of ontological terms.")
    (license license:gpl2+)))

(define-public r-gargle
  (package
    (name "r-gargle")
    (version "1.5.2")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "gargle" version))
       (sha256
        (base32
         "00ch0ddysva3dbs6wsybgy76j3f2ib6iypdg9f5ic2mmdq2fnnsa"))))
    (build-system r-build-system)
    (propagated-inputs
     (list r-cli
           r-fs
           r-glue
           r-httr
           r-jsonlite
           r-lifecycle
           r-openssl
           r-rappdirs
           r-rlang
           r-withr))
    (native-inputs
     (list r-knitr r-testthat))
    (home-page "https://gargle.r-lib.org")
    (synopsis "Utilities for working with Google APIs")
    (description
     "This package provides utilities for working with Google APIs.  This
includes functions and classes for handling common credential types and for
preparing, executing, and processing HTTP requests.")
    (license license:expat)))

(define-public r-bigrquery
  (package
    (name "r-bigrquery")
    (version "1.5.1")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "bigrquery" version))
       (sha256
        (base32
         "0wkm9xka83skq1cnv830q4jnqvwm8rlmns2mj8n692h2y5qxlmna"))))
    (properties
     '((updater-extra-native-inputs . ("r-blob" "r-dbplyr"))))
    (build-system r-build-system)
    (propagated-inputs
     (list r-bit64
           r-brio
           r-cli
           r-clock
           r-cpp11
           r-curl
           r-dbi
           r-gargle
           r-httr
           r-jsonlite
           r-lifecycle
           r-prettyunits
           r-rapidjsonr
           r-rlang
           r-tibble))
    (native-inputs (list r-blob r-dbplyr r-testthat))
    (home-page "https://github.com/r-dbi/bigrquery")
    (synopsis "R interface to Google's BigQuery API")
    (description
     "This package provides an R interface to Google's BigQuery database.")
    (license license:gpl3)))

(define-public r-gmisc
  (package
    (name "r-gmisc")
    (version "3.0.3")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "Gmisc" version))
       (sha256
        (base32 "1s8gkqg54622xhsmhl7n5pff2b6xfij111m7h3i4inzfjfmziq43"))))
    (properties `((upstream-name . "Gmisc")))
    (build-system r-build-system)
    (propagated-inputs (list r-abind
                             r-checkmate
                             r-forestplot
                             r-glue
                             r-hmisc
                             r-htmltable
                             r-knitr
                             r-lattice
                             r-lubridate
                             r-magrittr
                             r-rcpp
                             r-rlang
                             r-rmarkdown
                             r-stringr
                             r-xml
                             r-yaml))
    (native-inputs (list r-dplyr r-knitr r-testthat))
    (home-page "https://gforge.se")
    (synopsis "Descriptive statistics, transition plots, and more")
    (description
     "This package provides tools for making the descriptive \"Table 1\" used
in medical articles, a transition plot for showing changes between
categories (also known as a Sankey diagram), flow charts by extending the grid
package, a method for variable selection based on the SVD, Bezier lines with
arrows complementing the ones in the grid package, and more.")
    (license license:gpl3+)))

(define-public r-gmp
  (package
    (name "r-gmp")
    (version "0.7-5")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "gmp" version))
       (sha256
        (base32
         "0y6f2fdpydjcf1iz75xnjln3gzwpc1njls0n9y923naczfdazkgm"))))
    (properties
     '((updater-extra-inputs . ("gmp"))))
    (build-system r-build-system)
    (inputs (list gmp))
    (home-page "https://cran.r-project.org/web/packages/gmp")
    (synopsis "Multiple precision arithmetic")
    (description
     "This package supports multiple precision arithmetic (big integers and
rationals, prime number tests, matrix computation), \"arithmetic without
limitations\" using the GNU Multiple Precision library.")
    ;; Any version of the GPL.
    (license license:gpl3+)))

(define-public r-rmpfr
  (package
    (name "r-rmpfr")
    (version "1.1-0")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "Rmpfr" version))
       (sha256
        (base32
         "07qlmyqj1jnzg4kzqd1zpr8vky68hn12nkzxh459c0zhqy6i8gmf"))))
    (properties
     `((upstream-name . "Rmpfr")
       ;; Avoid dependency cycle.
       (updater-ignored-native-inputs . ("r-hh"))))
    (build-system r-build-system)
    (inputs
     (list gmp mpfr))
    (propagated-inputs
     (list r-gmp))
    (native-inputs
     (list pkg-config r-mass r-sfsmisc))
    (home-page "https://rmpfr.r-forge.r-project.org/")
    (synopsis "R bindings to the MPFR library")
    (description
     "This package supports arithmetic (via S4 classes and methods) for
arbitrary precision floating point numbers, including transcendental
functions.  To this end, the package interfaces with the @dfn{Multiple
Precision Floating-Point Reliable} (MPFR) library.")
    (license license:gpl2+)))

(define-public r-rmutil
  (package
    (name "r-rmutil")
    (version "1.1.10")
    (source (origin
              (method url-fetch)
              (uri (cran-uri "rmutil" version))
              (sha256
               (base32
                "1yd5gkg4jg3rvqrfl8c5r07lcr37n1p9h1a7b6s45iswd77dg7w1"))))
    (properties `((upstream-name . "rmutil")))
    (build-system r-build-system)
    (native-inputs (list gfortran))
    (home-page "https://www.commanster.eu/rcode.html")
    (synopsis
     "Utilities for nonlinear regression and repeated measurements models")
    (description
     "This package provides a toolkit of functions for nonlinear regression
and repeated measurements.  It was designated to be imported by other packages
such as @code{gnlm}, @code{stable}, @code{growth}, @code{repeated}, and
@code{event}.")
    (license license:gpl2+)))

(define-public r-assertive-base
  (package
    (name "r-assertive-base")
    (version "0.0-9")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "assertive.base" version))
       (sha256
        (base32
         "07m0ddz092bgbl2fn1yk932h0iajdcqkri632477wl5a1q5r3w2b"))))
    (properties
     `((upstream-name . "assertive.base")))
    (build-system r-build-system)
    (native-inputs (list r-testthat))
    (home-page "https://bitbucket.org/richierocks/assertive.base")
    (synopsis "Core of the assertive package")
    (description
     "This package provides a minimal set of predicates and assertions used by
the assertive package.  This is mainly for use by other package developers who
want to include run-time testing features in their own packages.")
    (license license:gpl3+)))

(define-public r-assertive-properties
  (package
    (name "r-assertive-properties")
    (version "0.0-5")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "assertive.properties" version))
       (sha256
        (base32
         "1pgljbwwbvbl4kc5c8mcv0qbzq3k6fzi29k88811yml263sm92dn"))))
    (properties
     `((upstream-name . "assertive.properties")))
    (build-system r-build-system)
    (arguments
     (list
      #:phases
      '(modify-phases %standard-phases
         (add-after 'unpack 'delete-bad-tests
           (lambda _
             ;; One test fails
             (delete-file
              "tests/testthat/test-is-atomic-recursive-vector.R"))))))
    (propagated-inputs
     (list r-assertive-base))
    (native-inputs (list r-testthat))
    (home-page "https://bitbucket.org/richierocks/assertive.properties")
    (synopsis "Assertions to check properties of variables")
    (description
     "This package provides a set of predicates and assertions for checking
the properties of variables, such as length, names and attributes.  This is
mainly for use by other package developers who want to include run-time
testing features in their own packages.")
    (license license:gpl3+)))

(define-public r-assertive-numbers
  (package
    (name "r-assertive-numbers")
    (version "0.0-2")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "assertive.numbers" version))
       (sha256
        (base32
         "0jc3ss64j4m7bjydhagwwmka5n7c72vpw4kfcch0m5jvkq5qrqds"))))
    (properties
     `((upstream-name . "assertive.numbers")))
    (build-system r-build-system)
    (propagated-inputs
     (list r-assertive-base))
    (native-inputs (list r-testthat))
    (home-page "https://bitbucket.org/richierocks/assertive.numbers")
    (synopsis "Assertions to check properties of numbers")
    (description
     "This package provides a set of predicates and assertions for checking
the properties of numbers.  This is mainly for use by other package developers
who want to include run-time testing features in their own packages.")
    (license license:gpl3+)))

(define-public r-assertive-sets
  (package
    (name "r-assertive-sets")
    (version "0.0-3")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "assertive.sets" version))
       (sha256
        (base32
         "1cqvh2syvh5b6d85h601zjmsdbbf3h8q98ids4dfl4frdshpasc7"))))
    (properties
     `((upstream-name . "assertive.sets")))
    (build-system r-build-system)
    (propagated-inputs
     (list r-assertive-base))
    (native-inputs (list r-testthat))
    (home-page "https://bitbucket.org/richierocks/assertive.sets")
    (synopsis "Assertions to check properties of sets")
    (description
     "This package provides a set of predicates and assertions for checking
the properties of sets.  This is mainly for use by other package developers
who want to include run-time testing features in their own packages.")
    (license license:gpl3+)))

(define-public r-assertive-matrices
  (package
    (name "r-assertive-matrices")
    (version "0.0-2")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "assertive.matrices" version))
       (sha256
        (base32
         "16sykzcndv6y2d43x6v9n7m95kv76364h39kh10w4z0xw6ksfqil"))))
    (properties
     `((upstream-name . "assertive.matrices")))
    (build-system r-build-system)
    (propagated-inputs
     (list r-assertive-base))
    (native-inputs (list r-testthat))
    (home-page "https://bitbucket.org/richierocks/assertive.matrices")
    (synopsis "Assertions to check properties of matrices")
    (description
     "This package provides a set of predicates and assertions for checking
the properties of matrices.  This is mainly for use by other package
developers who want to include run-time testing features in their own
packages.")
    (license license:gpl3+)))

(define-public r-assertive-models
  (package
    (name "r-assertive-models")
    (version "0.0-2")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "assertive.models" version))
       (sha256
        (base32
         "0bn4j4v5qvb2d672cgri61p8d9v258pmz35y3lvm6b9mdxwdi9mr"))))
    (properties
     `((upstream-name . "assertive.models")))
    (build-system r-build-system)
    (propagated-inputs
     (list r-assertive-base))
    (native-inputs (list r-testthat))
    (home-page "https://bitbucket.org/richierocks/assertive.models")
    (synopsis "Assertions to check properties of models")
    (description
     "This package provides a set of predicates and assertions for checking
the properties of models.  This is mainly for use by other package developers
who want to include run-time testing features in their own packages.")
    (license license:gpl3+)))

(define-public r-assertive-reflection
  (package
    (name "r-assertive-reflection")
    (version "0.0-5")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "assertive.reflection" version))
       (sha256
        (base32
         "1g9lpwzy6r2xmyi2mlbcccnfgyzhzbmx5bsicf3vkffxrlkrpjn2"))))
    (properties
     `((upstream-name . "assertive.reflection")))
    (build-system r-build-system)
    (propagated-inputs
     (list r-assertive-base))
    (native-inputs (list r-testthat))
    (home-page "https://bitbucket.org/richierocks/assertive.reflection")
    (synopsis "Assertions for checking the state of R")
    (description
     "This package provides a set of predicates and assertions for checking
the state and capabilities of R, the operating system it is running on, and
the IDE being used.  This is mainly for use by other package developers who
want to include run-time testing features in their own packages.")
    (license license:gpl3+)))

(define-public r-assertive-types
  (package
    (name "r-assertive-types")
    (version "0.0-3")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "assertive.types" version))
       (sha256
        (base32
         "0zxq1jfrzgw95ll7alvm0xnk7aihjdksngq4ya2whyvfjbmv4vdb"))))
    (properties
     '((upstream-name . "assertive.types")
       (updater-extra-native-inputs . ("r-xml2"))))
    (build-system r-build-system)
    (propagated-inputs
     (list r-assertive-base r-assertive-properties r-codetools))
    (native-inputs (list r-testthat r-xml2))
    (home-page "https://bitbucket.org/richierocks/assertive.types")
    (synopsis "Assertions to check types of variables")
    (description
     "This package provides a set of predicates and assertions for checking
the types of variables.  This is mainly for use by other package developers
who want to include run-time testing features in their own packages.")
    (license license:gpl3+)))

(define-public r-assertive-files
  (package
    (name "r-assertive-files")
    (version "0.0-2")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "assertive.files" version))
       (sha256
        (base32
         "02pfz8j5vwcj5kl6zca46894li7lxwnlrr29j922f14ay6kdssmy"))))
    (properties
     `((upstream-name . "assertive.files")))
    (build-system r-build-system)
    (arguments
     (list
      #:phases
      '(modify-phases %standard-phases
         ;; Needed for one test.
         (add-before 'check 'set-HOME
           (lambda _ (setenv "HOME" "/tmp"))))))
    (propagated-inputs
     (list r-assertive-base r-assertive-numbers))
    (native-inputs (list r-testthat))
    (home-page "https://bitbucket.org/richierocks/assertive.files")
    (synopsis "Assertions to check properties of files")
    (description
     "This package provides a set of predicates and assertions for checking
the properties of files and connections.  This is mainly for use by other
package developers who want to include run-time testing features in their own
packages.")
    (license license:gpl3+)))

(define-public r-assertive-code
  (package
    (name "r-assertive-code")
    (version "0.0-4")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "assertive.code" version))
       (sha256
        (base32
         "11qkhbjyxw0njzhcszyc2452518yrn3jr5l4n9jnzq10xms090ig"))))
    (properties
     `((upstream-name . "assertive.code")))
    (build-system r-build-system)
    (propagated-inputs
     (list r-assertive-base r-assertive-properties r-assertive-types))
    (native-inputs (list r-testthat))
    (home-page "https://bitbucket.org/richierocks/assertive.code")
    (synopsis "Assertions to check properties of code")
    (description
     "This package provides a set of predicates and assertions for checking
the properties of code.  This is mainly for use by other package developers
who want to include run-time testing features in their own packages.")
    (license license:gpl3+)))

(define-public r-assertive-datetimes
  (package
    (name "r-assertive-datetimes")
    (version "0.0-3")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "assertive.datetimes" version))
       (sha256
        (base32
         "151d05z8n6dpl44pqsa1jfi0ijbigr3zfc43xlw53nd8ymi22kh1"))))
    (properties
     `((upstream-name . "assertive.datetimes")))
    (build-system r-build-system)
    (propagated-inputs
     (list r-assertive-base r-assertive-types))
    (native-inputs (list r-testthat))
    (home-page "https://bitbucket.org/richierocks/assertive.datetimes")
    (synopsis "Assertions to check properties of dates and times")
    (description
     "This package provides a set of predicates and assertions for checking
the properties of dates and times.  This is mainly for use by other package
developers who want to include run-time testing features in their own
packages.")
    (license license:gpl3+)))

(define-public r-assertive-strings
  (package
    (name "r-assertive-strings")
    (version "0.0-3")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "assertive.strings" version))
       (sha256
        (base32
         "0n6jrk88670g4ym0r8ii40a08a90z1xadj8wcryk8h0nl04dchfm"))))
    (properties
     `((upstream-name . "assertive.strings")))
    (build-system r-build-system)
    (propagated-inputs
     (list r-assertive-base r-assertive-types r-stringi))
    (native-inputs (list r-testthat))
    (home-page "https://bitbucket.org/richierocks/assertive.strings")
    (synopsis "Assertions to check properties of strings")
    (description
     "This package provides a set of predicates and assertions for checking
the properties of strings.  This is mainly for use by other package developers
who want to include run-time testing features in their own packages.")
    (license license:gpl3+)))

(define-public r-assertive-data-us
  (package
    (name "r-assertive-data-us")
    (version "0.0-2")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "assertive.data.us" version))
       (sha256
        (base32
         "1bgspn0sccmp9z7s7djvdvprgxlyc5vrxznp4zfjb79kwvgn83hq"))))
    (properties
     `((upstream-name . "assertive.data.us")))
    (build-system r-build-system)
    (propagated-inputs
     (list r-assertive-base r-assertive-strings))
    (native-inputs (list r-testthat))
    (home-page "https://bitbucket.org/richierocks/assertive.data.us")
    (synopsis "Assertions to check properties of strings")
    (description
     "This package provides a set of predicates and assertions for checking
the properties of US-specific complex data types.  This is mainly for use by
other package developers who want to include run-time testing features in
their own packages.")
    (license license:gpl3+)))

(define-public r-assertive-data-uk
  (package
    (name "r-assertive-data-uk")
    (version "0.0-2")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "assertive.data.uk" version))
       (sha256
        (base32
         "1fzjvhwp7mwkqqix29khvs6zcrc82n6j4czvzzb473vyjyvdlj5b"))))
    (properties
     `((upstream-name . "assertive.data.uk")))
    (build-system r-build-system)
    (propagated-inputs
     (list r-assertive-base r-assertive-strings))
    (native-inputs (list r-testthat))
    (home-page "https://bitbucket.org/richierocks/assertive.data.uk")
    (synopsis "Assertions to check properties of strings")
    (description
     "This package provides a set of predicates and assertions for checking
the properties of UK-specific complex data types.  This is mainly for use by
other package developers who want to include run-time testing features in
their own packages.")
    (license license:gpl3+)))

(define-public r-assertive-data
  (package
    (name "r-assertive-data")
    (version "0.0-3")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "assertive.data" version))
       (sha256
        (base32
         "00cvg2g36mdl8plrzx40m63qd55742mddqrchwy9n3c7mm4gn02s"))))
    (properties
     `((upstream-name . "assertive.data")))
    (build-system r-build-system)
    (propagated-inputs
     (list r-assertive-base r-assertive-strings))
    (native-inputs (list r-testthat))
    (home-page "https://bitbucket.org/richierocks/assertive.data")
    (synopsis "Assertions to check properties of data")
    (description
     "This package provides a set of predicates and assertions for checking
the properties of (country independent) complex data types.  This is mainly
for use by other package developers who want to include run-time testing
features in their own packages.")
    (license license:gpl3+)))

(define-public r-assertive
  (package
    (name "r-assertive")
    (version "0.3-6")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "assertive" version))
       (sha256
        (base32
         "02palil82idqhhshcdjsfsja9qkqnd0dczqzj5gbccy4hfg1c0y4"))))
    (build-system r-build-system)
    (propagated-inputs
     (list r-assertive-base
           r-assertive-code
           r-assertive-data
           r-assertive-data-uk
           r-assertive-data-us
           r-assertive-datetimes
           r-assertive-files
           r-assertive-matrices
           r-assertive-models
           r-assertive-numbers
           r-assertive-properties
           r-assertive-reflection
           r-assertive-sets
           r-assertive-strings
           r-assertive-types
           r-knitr))
    (native-inputs
     (list r-knitr r-testthat))
    (home-page "https://bitbucket.org/richierocks/assertive")
    (synopsis "Readable check functions to ensure code integrity")
    (description
     "This package provides lots of predicates (@code{is_*} functions) to
check the state of your variables, and assertions (@code{assert_*} functions)
to throw errors if they aren't in the right form.")
    (license license:gpl3+)))

(define-public r-dotcall64
  (package
    (name "r-dotcall64")
    (version "1.2")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "dotCall64" version))
       (sha256
        (base32
         "1ah88h77lc9zb68b3xyk97xpid2pilkywk25m68x3m1h3xbspmma"))))
    (properties `((upstream-name . "dotCall64")))
    (build-system r-build-system)
    (native-inputs (list gfortran r-rhpcblasctl r-testthat))
    (home-page "https://git.math.uzh.ch/reinhard.furrer/dotCall64")
    (synopsis "Enhanced foreign function interface supporting long vectors")
    (description
     "This package provides @code{.C64()}, an enhanced version of @code{.C()}
and @code{.Fortran()} from the R foreign function interface.  @code{.C64()}
supports long vectors, arguments of type 64-bit integer, and provides a
mechanism to avoid unnecessary copies of read-only and write-only arguments.
This makes it a convenient and fast interface to C/C++ and Fortran code.")
    (license license:gpl2+)))

(define-public r-spam
  (package
    (name "r-spam")
    (version "2.11-1")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "spam" version))
       (sha256
        (base32 "0rgq5wsmx5l2cvs89lrn54xzhjpa2hnk98blq6cd2qgah4xwak2w"))))
    (build-system r-build-system)
    (arguments
     (list
      #:phases
      '(modify-phases %standard-phases
         (add-after 'unpack 'delete-bad-tests
           (lambda _
             ;; One test fails with: could not find function "quilt.plot"
             (delete-file "tests/testthat/test-rmvnorm.R")))
         (add-before 'check 'set-HOME
           (lambda _
             ;; Needed for building vignettes.
             (setenv "HOME" "/tmp"))))))
    (propagated-inputs
     (list r-dotcall64 r-rcpp))
    (native-inputs
     (list gfortran
           r-knitr
           r-matrix
           r-microbenchmark
           r-r-rsp
           r-testthat
           r-truncdist))
    (home-page "https://www.math.uzh.ch/pages/spam/")
    (synopsis "Sparse matrix algebra")
    (description
     "This package provides a set of functions for sparse matrix algebra.
Differences with other sparse matrix packages are:

@enumerate
@item it only supports (essentially) one sparse matrix format;
@item it is based on transparent and simple structure(s);
@item it is tailored for MCMC calculations within G(M)RF;
@item and it is fast and scalable (with the extension package @code{spam64}).
@end enumerate\n")
    ;; Either of these licenses
    (license (list license:bsd-3 license:lgpl2.0))))

(define-public r-fields
  (package
    (name "r-fields")
    (version "16.3.1")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "fields" version))
       (sha256
        (base32 "0y7idq065sbqibs1d92rk3lq7pdqkh470f5wcz27fja4l0k05zaz"))))
    (build-system r-build-system)
    (propagated-inputs
     (list r-maps r-spam r-viridislite))
    (native-inputs
     (list gfortran))
    (home-page "https://www.image.ucar.edu/fields")
    (synopsis "Tools for spatial data")
    (description
     "This is a package for curve, surface and function fitting with an
emphasis on splines, spatial data and spatial statistics.  The major methods
include cubic, and thin plate splines, Kriging, and compactly supported
covariance functions for large data sets.")
    (license license:gpl2+)))

(define-public r-spatialextremes
  (package
    (name "r-spatialextremes")
    (version "2.1-0")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "SpatialExtremes" version))
       (sha256
        (base32
         "0z1swxp1syz8hdskarjxx4sdd7wx835kcnb783bwqm235yh991j3"))))
    (properties
     `((upstream-name . "SpatialExtremes")))
    (build-system r-build-system)
    (propagated-inputs
     (list r-fields r-maps))
    (home-page "https://spatialextremes.r-forge.r-project.org/")
    (synopsis "Modelling spatial extremes")
    (description
     "This package provides tools for the statistical modelling of spatial
extremes using max-stable processes, copula or Bayesian hierarchical models.
More precisely, this package allows (conditional) simulations from various
parametric max-stable models, analysis of the extremal spatial dependence, the
fitting of such processes using composite likelihoods or least square (simple
max-stable processes only), model checking and selection and prediction.")
    (license license:gpl2+)))

(define-public r-drc
  (package
    (name "r-drc")
    (version "3.0-1")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "drc" version))
       (sha256
        (base32
         "0c8xn8ripzq270hy8d16fcnx02l02alddznd7fqwk3jyi6113h1y"))))
    (build-system r-build-system)
    (propagated-inputs
     (list r-car
           r-gtools
           r-mass
           r-multcomp
           r-plotrix
           r-scales))
    (home-page "https://cran.r-project.org/web/packages/drc")
    (synopsis "Analysis of dose-response curves")
    (description
     "This package provides a suite of flexible and versatile model fitting
and after-fitting functions for the analysis of dose-response data.")
    (license license:gpl2+)))

(define-public r-rmeta
  (package
    (name "r-rmeta")
    (version "3.0")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "rmeta" version))
       (sha256
        (base32
         "0vkbnxp579v8zmcv1isdbzj5swpr6fq17zwparxcvzswjc2x9ydr"))))
    (build-system r-build-system)
    (home-page "https://cran.r-project.org/web/packages/rmeta")
    (synopsis "Tools for meta-analysis")
    (description
     "This package provides functions for simple fixed and random effects
meta-analysis for two-sample comparisons and cumulative meta-analyses.  It
draws standard summary plots, funnel plots, and computes summaries and tests
for association and heterogeneity.")
    (license license:gpl2)))

(define-public r-bootstrap
  (package
    (name "r-bootstrap")
    (version "2019.6")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "bootstrap" version))
       (sha256
        (base32
         "1546jqhhw5h177ii8jkdikyd26rv6gwkav816np1zks4p7zgsljj"))))
    (build-system r-build-system)
    (native-inputs (list gfortran))
    (home-page "https://cran.r-project.org/web/packages/bootstrap")
    (synopsis "Functions for the book \"An Introduction to the Bootstrap\"")
    (description
     "This package provides software and data for the book \"An Introduction
to the Bootstrap\" by B. Efron and R. Tibshirani, 1993, Chapman and Hall.
This package is primarily provided for projects already based on it, and for
support of the book.  New projects should preferentially use the recommended
package \"boot\".")
    (license license:bsd-3)))

(define-public r-survivalroc
  (package
    (name "r-survivalroc")
    (version "1.0.3.1")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "survivalROC" version))
       (sha256
        (base32
         "0p6irjs8a9xxgxwax0y9fzapcib237if3iy8g6lzv793mzmsyx41"))))
    (properties `((upstream-name . "survivalROC")))
    (build-system r-build-system)
    (home-page "https://cran.r-project.org/web/packages/survivalROC")
    (synopsis "Time-dependent ROC curve estimation from censored survival data")
    (description
     "Compute time-dependent ROC curve from censored survival data using
Kaplan-Meier (KM) or Nearest Neighbor Estimation (NNE) method of Heagerty,
Lumley & Pepe (Biometrics, Vol 56 No 2, 2000, PP 337-344)")
    (license license:gpl2+)))

(define-public r-locfdr
  (package
    (name "r-locfdr")
    (version "1.1-8")
    (source (origin
              (method url-fetch)
              (uri (cran-uri "locfdr" version))
              (sha256
               (base32
                "1falkbp2xz07am8jlhwlvyqvxnli4nwl188kd0g58vdfjcjy3mj2"))))
    (build-system r-build-system)
    (home-page "https://cran.r-project.org/web/packages/locfdr/")
    (synopsis "Computes local false discovery rates")
    (description "This package can be used to compute local false
discovery rates.")
    (license license:gpl2)))

(define-public r-logging
  (package
    (name "r-logging")
    (version "0.10-108")
    (source (origin
              (method url-fetch)
              (uri (cran-uri "logging" version))
              (sha256
               (base32
                "13gd40ygx586vs6xcp6clg69a92aj8zxlk1rn3xzkx8klfjimjc5"))))
    (properties `((upstream-name . "logging")))
    (build-system r-build-system)
    (native-inputs (list r-testthat))
    (home-page "https://github.com/WLOGSolutions/r-logging")
    (synopsis "R logging implementation of log4j")
    (description
     "This package implements the R version of the @code{log4j} package.  It offers
hierarchic loggers, multiple handlers per logger, level based filtering, space
handling in messages and custom formatting.")
    (license license:gpl3)))

(define-public r-logistf
  (package
    (name "r-logistf")
    (version "1.26.1")
    (source (origin
              (method url-fetch)
              (uri (cran-uri "logistf" version))
              (sha256
               (base32
                "14l5gvrya6pfhbbj70ibnw7v7nkhawzkm9dxkkigzh1jlby0y7im"))))
    (properties `((upstream-name . "logistf")))
    (build-system r-build-system)
    (propagated-inputs (list r-formula-tools r-matrix r-mgcv r-mice))
    (home-page
     "https://cemsiis.meduniwien.ac.at/en/kb/science-research\
/software/statistical-software/firth-correction/")
    (synopsis "Firth's bias-reduced logistic regression")
    (description
     "Fit a logistic regression model using Firth's bias reduction method,
equivalent to penalization of the log-likelihood by the Jeffreys prior.
Confidence intervals for regression coefficients can be computed by penalized
profile likelihood.  Firth's method was proposed as ideal solution to the
problem of separation in logistic regression, see Heinze and Schemper (2002)
<doi:10.1002/sim.1047>.  If needed, the bias reduction can be turned off such
that ordinary maximum likelihood logistic regression is obtained.  Two new
modifications of Firth's method, FLIC and FLAC, lead to unbiased predictions
and are now available in the package as well, see Puhr et al (2017)
<doi:10.1002/sim.7273>.")
    ;; Any version of the GPL
    (license license:gpl3+)))

(define-public r-longdat
  (package
    (name "r-longdat")
    (version "1.1.3")
    (source (origin
              (method url-fetch)
              (uri (cran-uri "LongDat" version))
              (sha256
               (base32
                "0jydzc50vfml06ykk34bx5681wp35m9yj8x67h9pqwhpyn0f36ca"))))
    (properties `((upstream-name . "LongDat")))
    (build-system r-build-system)
    (propagated-inputs (list r-bestnormalize
                             r-car
                             r-dplyr
                             r-effsize
                             r-emmeans
                             r-ggplot2
                             r-glmmtmb
                             r-lme4
                             r-magrittr
                             r-mass
                             r-patchwork
                             r-reshape2
                             r-rlang
                             r-rstatix
                             r-stringr
                             r-tibble
                             r-tidyr))
    (native-inputs (list r-knitr))
    (home-page "https://github.com/CCY-dev/LongDat")
    (synopsis
     "Tool for covariate-sensitive longitudinal analysis on omics data")
    (description
     "This tool takes longitudinal dataset as input and analyzes if there is
significant change of the features over time (a proxy for treatments), while
detects and controls for covariates simultaneously.  LongDat is able to take
in several data types as input, including count, proportion, binary, ordinal
and continuous data.  The output table contains p values, effect sizes and
covariates of each feature, making the downstream analysis easy.")
    (license license:gpl2)))

(define-public r-longitudinal
  (package
    (name "r-longitudinal")
    (version "1.1.13")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "longitudinal" version))
       (sha256
        (base32
         "046w3xbr535c5jyd68adv42a7limxp1mv57b5w6w673w707lmw2p"))))
    (build-system r-build-system)
    (propagated-inputs (list r-corpcor))
    (home-page "https://strimmerlab.org/software/longitudinal/")
    (synopsis "Analysis of multiple time course data")
    (description
     "This package contains general data structures and functions for
longitudinal data with multiple variables, repeated measurements, and
irregularly spaced time points.  It also implements a shrinkage estimator of
dynamical correlation and dynamical covariance.")
    (license license:gpl3+)))

(define-public r-genenet
  (package
    (name "r-genenet")
    (version "1.2.17")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "GeneNet" version))
       (sha256
        (base32
         "0pvws2savl0jdq4zz5p9j9pv86k5qwylcskybj2gf50rvs83f258"))))
    (properties `((upstream-name . "GeneNet")))
    (build-system r-build-system)
    (propagated-inputs
     (list r-corpcor r-fdrtool r-longitudinal))
    (home-page "https://strimmerlab.org/software/genenet/")
    (synopsis "Modeling and inferring gene networks")
    (description
     "This package analyzes gene expression (time series) data with focus on
the inference of gene networks.  In particular, GeneNet implements the methods
of Schaefer and Strimmer (2005a,b,c) and Opgen-Rhein and Strimmer (2006, 2007)
for learning large-scale gene association networks (including assignment of
putative directions).")
    (license license:gpl3+)))

(define-public r-rbamtools
  (package
    (name "r-rbamtools")
    (version "2.16.17")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "rbamtools" version))
       (sha256
        (base32
         "0qj37ljdva3v29s01dkrbg31mcfzy3bl145cp40d54v4h9xhcghc"))))
    (build-system r-build-system)
    ;; FIXME: Error in genomePartition(reader, ref) : pCoords: begin must be
    ;; <= end!
    (arguments (list #:tests? #false))
    (inputs (list zlib))
    (propagated-inputs
     (list r-refgenome))
    (home-page "https://cran.r-project.org/web/packages/rbamtools")
    (synopsis "Read and write BAM (binary alignment) files")
    (description
     "This package provides an R interface to functions of the SAMtools
library.")
    (license license:artistic2.0)))

(define-public r-profvis
  (package
    (name "r-profvis")
    (version "0.4.0")
    (source (origin
              (method url-fetch)
              (uri (cran-uri "profvis" version))
              (sha256
               (base32
                "1x2cpykcmq5a30c0mf22h2pnnanqij0yqjv3q33xzx11c07fpzfj"))
              (modules '((guix build utils)))
              (snippet
               '(with-directory-excursion "inst/htmlwidgets/lib"
                  (for-each delete-file
                            (list "highlight/highlight.min.js" ;version 11.10.0
                                  "jquery/jquery.min.js"       ;version 3.7.1
                                  "d3/d3.min.js"))))))         ;version 3.5.6
    (properties `((upstream-name . "profvis")))
    (build-system r-build-system)
    (arguments
     (list
      #:modules '((guix build r-build-system)
                  (guix build minify-build-system)
                  (guix build utils)
                  (ice-9 match))
      #:imported-modules `(,@%r-build-system-modules
                           (guix build minify-build-system))
      #:phases
      '(modify-phases (@ (guix build r-build-system) %standard-phases)
         (add-after 'unpack 'process-javascript
           (lambda* (#:key inputs #:allow-other-keys)
             (with-directory-excursion "inst/htmlwidgets/lib/"
               (copy-file
                (search-input-file
                 inputs "/site-library/rmarkdown/rmd/h/highlightjs/highlight.js")
                "highlight/highlight.min.js")
               (for-each (match-lambda
                           ((source . target)
                            (minify source #:target target)))
                         `((,(assoc-ref inputs "js-jquery")
                            . "jquery/jquery.min.js")
                           (,(assoc-ref inputs "js-d3")
                            . "d3/d3.min.js")))))))))
    (native-inputs
     `(("esbuild" ,esbuild)
       ("r-knitr" ,r-knitr)
       ("r-rmarkdown" ,r-rmarkdown)
       ("r-testthat" ,r-testthat)
       ("js-d3"
        ,(origin
           (method url-fetch)
           (uri "https://raw.githubusercontent.com/d3/d3/v3.5.6/d3.js")
           (sha256
            (base32
             "17qlbwn7vgx335gciq6zp2ib6zg1r9lfa6p1bd9g0ds0xbcsbvgd"))))
       ("js-jquery"
        ,(origin
           (method url-fetch)
           (uri "https://code.jquery.com/jquery-3.7.1.js")
           (sha256
            (base32
             "1zicjv44sx6n83vrkd2lwnlbf7qakzh3gcfjw0lhq48b5z55ma3q"))))))
    (propagated-inputs
     (list r-htmlwidgets r-rlang r-vctrs))
    (home-page "https://rstudio.github.io/profvis/")
    (synopsis "Interactive visualizations for profiling R code")
    (description "This package provides interactive visualizations for
profiling R code.")
    (license license:gpl3)))

(define-public r-prospectr
  (package
    (name "r-prospectr")
    (version "0.2.8")
    (source (origin
              (method url-fetch)
              (uri (cran-uri "prospectr" version))
              (sha256
               (base32
                "0hwiwlhz994mrhxr8billcrrpg79zl7b8hijfkxlb0sx2rvidy0l"))))
    (properties `((upstream-name . "prospectr")))
    (build-system r-build-system)
    (propagated-inputs
     (list r-foreach
           r-iterators
           r-lifecycle
           r-mathjaxr
           r-rcpp
           r-rcpparmadillo))
    (native-inputs
     (list r-knitr r-testthat))
    (home-page "https://github.com/l-ramirez-lopez/prospectr")
    (synopsis "Functions for processing and sample selection of spectroscopic data")
    (description
     "@code{prospectr} provides miscellaneous functions to preprocess
spectroscopic data and conduct representative sample selection, or calibration
sampling.")
    (license license:expat)))

(define-public r-protviz
  (package
    (name "r-protviz")
    (version "0.7.9")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "protViz" version))
       (sha256
        (base32
         "1wsjr4asjsknv8fkfv15xqnl67zfv8d2xmvw1i2l0wflxbps3af7"))))
    (properties `((upstream-name . "protViz")))
    (build-system r-build-system)
    ;; One vignette file fails with: parameter "i" in "mfg" is out of range
    (arguments (list #:test-types '(list "tests")))
    (propagated-inputs (list r-rcpp))
    (native-inputs (list r-lattice r-testthat r-xtable))
    (home-page "https://github.com/protViz/protViz/")
    (synopsis "Visualizing and analyzing mass spectrometry data in proteomics")
    (description
     "This package helps with quality checks, visualizations and analysis of
mass spectrometry data, coming from proteomics experiments.  The package is
developed, tested and used at the Functional Genomics Center Zurich, where it
is used mainly for prototyping, teaching, and having fun with proteomics data.
But it can also be used to do data analysis for small scale data sets.")
    (license license:gpl3)))

(define-public r-cmprsk
  (package
    (name "r-cmprsk")
    (version "2.2-12")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "cmprsk" version))
       (sha256
        (base32 "1p5c0i8prz88pgzb5dwpajlrxa0d72019sp9vysppb0fps9wngkp"))))
    (build-system r-build-system)
    (propagated-inputs
     (list r-survival))
    (native-inputs
     (list gfortran))
    (home-page "https://cran.r-project.org/web/packages/cmprsk")
    (synopsis "Subdistribution analysis of competing risks")
    (description
     "This package provides tool for estimation, testing and regression
modeling of subdistribution functions in competing risks, as described in
Gray (1988), A class of K-sample tests for comparing the cumulative incidence
of a competing risk, Ann. Stat. 16:1141-1154, and Fine JP and Gray RJ (1999),
A proportional hazards model for the subdistribution of a competing risk,
JASA, 94:496-509.")
    (license license:gpl2+)))

(define-public r-etm
  (package
    (name "r-etm")
    (version "1.1.2")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "etm" version))
       (sha256
        (base32
         "0rbd5acvqdn4704hzsndim11f98ippiscaxhrga1660zm9z8q9xj"))))
    (build-system r-build-system)
    (propagated-inputs
     (list r-data-table r-lattice r-rcpp r-rcpparmadillo r-survival))
    (home-page "https://cran.r-project.org/web/packages/etm")
    (synopsis "Empirical transition matrix")
    (description
     "The @dfn{empirical transition matrix} (etm) package estimates
the matrix of transition probabilities for any time-inhomogeneous multistate
model with finite state space using the Aalen-Johansen estimator.")
    (license license:expat)))

(define-public r-epi
  (package
    (name "r-epi")
    (version "2.59")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "Epi" version))
       (sha256
        (base32
         "0dvnjrw81mmmnbi6jdvd3c1942c4aqpd64nzs09nml0win831mh0"))))
    (properties `((upstream-name . "Epi")))
    (build-system r-build-system)
    (propagated-inputs
     (list r-cmprsk
           r-data-table
           r-dplyr
           r-etm
           r-magrittr
           r-mass
           r-matrix
           r-mgcv
           r-numderiv
           r-plyr
           r-survival
           r-zoo))
    (home-page "https://BendixCarstensen.com/Epi/")
    (synopsis "Statistical analysis in epidemiology")
    (description
     "This package provides functions for demographic and epidemiological
analysis in the Lexis diagram, i.e. register and cohort follow-up data, in
particular representation, manipulation and simulation of multistate data -
the Lexis suite of functions, which includes interfaces to the @code{mstate},
@code{etm} and @code{cmprsk} packages.  It also contains functions for
Age-Period-Cohort and Lee-Carter modeling and a function for interval censored
data and some useful functions for tabulation and plotting, as well as a
number of epidemiological data sets.")
    (license license:gpl2)))

(define-public r-ppls
  (package
    (name "r-ppls")
    (version "1.6-1.1")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "ppls" version))
       (sha256
        (base32
         "1zyrisy3c4cz896j1bjh61sf57wdl9p8ywdq268cl819szfq78mx"))))
    (build-system r-build-system)
    (propagated-inputs (list r-mass))
    (home-page "https://cran.r-project.org/web/packages/ppls")
    (synopsis "Penalized partial least squares")
    (description
     "This package contains linear and nonlinear regression methods based on
partial least squares and penalization techniques.  Model parameters are
selected via cross-validation, and confidence intervals ans tests for the
regression coefficients can be conducted via jackknifing.")
    (license license:gpl2+)))

(define-public r-huge
  (package
    (name "r-huge")
    (version "1.3.5")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "huge" version))
       (sha256
        (base32 "1sl457a1lndrx98y2j9a2smanawx2iqlhl82iand0g3p5xp8ch4j"))))
    (build-system r-build-system)
    (propagated-inputs
     (list r-igraph r-mass r-matrix r-rcpp r-rcppeigen))
    (home-page "https://cran.r-project.org/web/packages/huge")
    (synopsis "High-dimensional undirected graph estimation")
    (description
     "This package provides a general framework for high-dimensional
undirected graph estimation.  It integrates data preprocessing, neighborhood
screening, graph estimation, and model selection techniques into a pipeline.")
    (license license:gpl2)))

(define-public r-parcor
  (package
    (name "r-parcor")
    (version "0.2-6")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "parcor" version))
       (sha256
        (base32
         "0vgs6k92vdr0cmb8cwbv2ff6qavw30agskfd8bfh17hsskrisvx0"))))
    (build-system r-build-system)
    (propagated-inputs
     (list r-epi r-genenet r-glmnet r-mass r-ppls))
    (home-page "https://cran.r-project.org/web/packages/parcor")
    (synopsis "Regularized estimation of partial correlation matrices")
    (description
     "This package estimates the matrix of partial correlations based on
different regularized regression methods: lasso, adaptive lasso, PLS, and
Ridge Regression.  In addition, the package provides model selection for
lasso, adaptive lasso and Ridge regression based on cross-validation.")
    (license license:gpl2+)))

(define-public r-mcmc
  (package
    (name "r-mcmc")
    (version "0.9-8")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "mcmc" version))
       (sha256
        (base32
         "19vfh868lr4a491gc2x2b2xs83gldw294zbl4bqsgs2q9c6l81ka"))))
    (build-system r-build-system)
    ;; XXX On the build farm the vignettes time out.
    (arguments (list #:test-types '(list "tests")))
    (native-inputs (list r-iso r-xtable))
    (home-page "https://www.stat.umn.edu/geyer/mcmc/")
    (synopsis "Markov chain Monte Carlo")
    (description
     "This package simulates continuous distributions of random vectors using
@dfn{Markov chain Monte Carlo} (MCMC).  Users specify the distribution by an R
function that evaluates the log unnormalized density.  Algorithms are random
walk Metropolis algorithm (function @code{metrop}), simulated
tempering (function @code{temper}), and morphometric random walk
Metropolis (function @code{morph.metrop}), which achieves geometric ergodicity
by change of variable.")
    (license license:expat)))

(define-public r-listenv
  (package
    (name "r-listenv")
    (version "0.9.1")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "listenv" version))
       (sha256
        (base32
         "0fqwikd3z6n5mia55s3fn5wxnmf2vbw3cmf0hcmm3iligd4ayaj2"))))
    (build-system r-build-system)
    (arguments
     `(#:phases
       (modify-phases %standard-phases
         (add-after 'unpack 'set-HOME
           (lambda _ (setenv "HOME" "/tmp"))))))
    (native-inputs
     (list r-r-rsp)) ; vignette builder
    (home-page "https://github.com/HenrikBengtsson/listenv")
    (synopsis "Environments behaving (almost) as lists")
    (description
     "This package implements list environments.  List environments are
environments that have list-like properties.  For instance, the elements of a
list environment are ordered and can be accessed and iterated over using index
subsetting.")
    (license license:lgpl2.1+)))

(define-public r-globals
  (package
    (name "r-globals")
    (version "0.18.0")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "globals" version))
       (sha256
        (base32
         "1v4zxncggjbmzv30dv50z7c5x0jrhf7mq8z7z6bmkk1qzypvv8wg"))))
    (build-system r-build-system)
    (propagated-inputs
     (list r-codetools))
    (home-page "https://github.com/HenrikBengtsson/globals")
    (synopsis "Identify global objects in R expressions")
    (description
     "This package provides tools to identify global (\"unknown\" or \"free\")
objects in R expressions by code inspection using various strategies, e.g.
conservative or liberal.  The objective of this package is to make it as
simple as possible to identify global objects for the purpose of exporting
them in distributed compute environments.")
    (license license:lgpl2.1+)))

(define-public r-parallelly
  (package
    (name "r-parallelly")
    (version "1.44.0")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "parallelly" version))
       (sha256
        (base32
         "0nxbh86j75r2lyhvb95a51wfs9qbz6zcn25crkbjal774imvx0fh"))))
    (properties `((upstream-name . "parallelly")))
    (build-system r-build-system)
    (home-page "https://github.com/HenrikBengtsson/parallelly")
    (synopsis "Enhancements of the parallel package")
    (description
     "This package provides utility functions that enhance the @code{parallel}
package and support the built-in parallel backends of the @code{future}
package.  For example, @code{availableCores} gives the number of CPU cores
available to your R process as given by R options and environment variables,
including those set by job schedulers on high-performance compute clusters.
If none is set, it will fall back to @code{parallel::detectCores}.  Another
example is @code{makeClusterPSOCK}, which is backward compatible with
@code{parallel::makePSOCKcluster} while doing a better job in setting up
remote cluster workers without the need for configuring the firewall to do
port-forwarding to your local computer.")
    (license license:lgpl2.1+)))

(define-public r-future
  (package
    (name "r-future")
    (version "1.49.0")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "future" version))
       (sha256
        (base32
         "10hrgjsk0dlx7qwyqnn13hj560j1s76s0ri2zrwjdr5vmfndrh5b"))))
    (build-system r-build-system)
    (arguments
     `(#:phases
       (modify-phases %standard-phases
         (add-after 'unpack 'set-HOME
           (lambda _ (setenv "HOME" "/tmp"))))))
    (propagated-inputs
     (list r-digest r-globals r-listenv r-parallelly))
    (native-inputs
     (list r-r-rsp)) ; vignette builder
    (home-page "https://github.com/HenrikBengtsson/future")
    (synopsis "Unified parallel and distributed processing in R")
    (description
     "The purpose of this package is to provide a lightweight and unified
Future API for sequential and parallel processing of R expression via futures.
This package implements sequential, multicore, multisession, and cluster
futures.  With these, R expressions can be evaluated on the local machine, in
parallel a set of local machines, or distributed on a mix of local and remote
machines.  Extensions to this package implement additional backends for
processing futures via compute cluster schedulers etc.  Because of its unified
API, there is no need to modify any code in order to switch from sequential on
the local machine to, say, distributed processing on a remote compute cluster.")
    (license license:lgpl2.1+)))

(define-public r-future-apply
  (package
    (name "r-future-apply")
    (version "1.11.3")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "future.apply" version))
       (sha256
        (base32
         "1l45vc30fn4kr5v49nnh5bkixa9ff006cp9sh9qiss76162qbs76"))))
    (properties `((upstream-name . "future.apply")))
    (build-system r-build-system)
    (arguments
     `(#:phases
       (modify-phases %standard-phases
         (add-after 'unpack 'set-HOME
           (lambda _ (setenv "HOME" "/tmp"))))))
    (propagated-inputs
     (list r-future r-globals))
    (native-inputs
     (list r-r-rsp)) ; vignette builder
    (home-page "https://github.com/HenrikBengtsson/future.apply")
    (synopsis "Apply function to elements in parallel using futures")
    (description
     "This package provides implementations of @code{apply()},
@code{eapply()}, @code{lapply()}, @code{Map()}, @code{mapply()},
@code{replicate()}, @code{sapply()}, @code{tapply()}, and @code{vapply()} that
can be resolved using any future-supported backend, e.g. parallel on the local
machine or distributed on a compute cluster.")
    (license license:gpl2+)))

(define-public r-future-callr
  (package
    (name "r-future-callr")
    (version "0.8.2")
    (source (origin
              (method url-fetch)
              (uri (cran-uri "future.callr" version))
              (sha256
               (base32
                "14hq53cam65ff25l6y17zv37448ls90sa0w51f13199m1kffaaqb"))))
    (properties
     '((upstream-name . "future.callr")
       (updater-extra-native-inputs . ("r-markdown"))))
    (build-system r-build-system)
    ;; This is needed for the vignette builder R.rsp.
    (arguments
     (list
      #:phases
      #~(modify-phases %standard-phases
          (add-after 'unpack 'set-HOME
            (lambda _ (setenv "HOME" "/tmp"))))))
    (propagated-inputs (list r-callr r-future))
    (native-inputs (list r-markdown r-r-rsp))
    (home-page "https://future.callr.futureverse.org")
    (synopsis "Future API for Parallel Processing using 'callr'")
    (description
     "This is an implementation of the Future API on top of the callr package.
This allows you to process futures, as defined by the future package, in
parallel out of the box, on your local machine.  Contrary to backends relying
on the parallel package (e.g. @code{future::multisession}) and socket
connections, the callr backend provided here can run more than 125 parallel R
processes.")
    (license license:lgpl2.1+)))

(define-public r-rsvd
  (package
    (name "r-rsvd")
    (version "1.0.5")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "rsvd" version))
       (sha256
        (base32
         "07p2hjmpcwcsang8z9sjkpy94rydcin7m3hyvcgzgm5cd6w8c1p4"))))
    (build-system r-build-system)
    (propagated-inputs
     (list r-matrix))
    (native-inputs (list r-testthat))
    (home-page "https://github.com/erichson/rSVD")
    (synopsis "Randomized singular value decomposition")
    (description
     "Low-rank matrix decompositions are fundamental tools and widely used for
data analysis, dimension reduction, and data compression.  Classically, highly
accurate deterministic matrix algorithms are used for this task.  However, the
emergence of large-scale data has severely challenged our computational
ability to analyze big data.  The concept of randomness has been demonstrated
as an effective strategy to quickly produce approximate answers to familiar
problems such as the @dfn{singular value decomposition} (SVD).  This package
provides several randomized matrix algorithms such as the randomized singular
value decomposition (@code{rsvd}), randomized principal component
analysis (@code{rpca}), randomized robust principal component
analysis (@code{rrpca}), randomized interpolative decomposition (@code{rid}),
and the randomized CUR decomposition (@code{rcur}).  In addition several plot
functions are provided.")
    (license license:gpl3+)))

(define-public r-sloop
  (package
    (name "r-sloop")
    (version "1.0.1")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "sloop" version))
       (sha256
        (base32
         "00fk5fr5zsk2qxc1kfhmshhjxgnamm3401089sx8m2l529zd6r8j"))))
    (build-system r-build-system)
    (propagated-inputs
     (list r-codetools r-crayon r-purrr r-rlang r-tibble))
    (native-inputs (list r-testthat))
    (home-page "https://github.com/r-lib/sloop")
    (synopsis "Helpers for object-oriented programming in R")
    (description
     "This package provides a collection of helper functions designed to
help you to better understand object oriented programming in R, particularly
using @code{S3}.")
    (license license:gpl3)))

(define-public r-capushe
  (package
    (name "r-capushe")
    (version "1.1.2")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "capushe" version))
       (sha256
        (base32
         "1mazsfdiqmhy0ywahqw49qql899ph0l6jllriz2spyp1bs98q9b7"))))
    (build-system r-build-system)
    (propagated-inputs (list r-mass))
    (home-page "https://cran.r-project.org/web/packages/capushe/index.html")
    (synopsis "Calibrating penalties using slope heuristics")
    (description
     "This package provides tools for the calibration of penalized criteria
for model selection.  The calibration methods available are based on the slope
heuristics.")
    (license license:gpl2+)))

(define-public r-dorng
  (package
    (name "r-dorng")
    (version "1.8.6.2")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "doRNG" version))
       (sha256
        (base32
         "133ymnyjwjkpjbijf20h25wky2y6zq3fz58dc926m3yg23nbm0v6"))))
    (properties
     '((upstream-name . "doRNG")
       (updater-extra-native-inputs . ("r-doparallel"))))
    (build-system r-build-system)
    (propagated-inputs
     (list r-foreach r-iterators r-rngtools))
    (native-inputs
     (list r-doparallel r-testthat))
    (home-page "https://renozao.github.io/doRNG/")
    (synopsis "Generic reproducible parallel backend for foreach loops")
    (description
     "This package provides functions to perform reproducible parallel
@code{foreach} loops, using independent random streams as generated by
L'Ecuyer's combined multiple-recursive generator.  It enables to easily
convert standard @code{%dopar%} loops into fully reproducible loops,
independently of the number of workers, the task scheduling strategy, or the
chosen parallel environment and associated foreach backend.")
    (license license:gpl2+)))

(define-public r-blockmodeling
  (package
    (name "r-blockmodeling")
    (version "1.1.5")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "blockmodeling" version))
       (sha256
        (base32
         "00qmpf0jdc8vl76rzfg12z2mdr215q8qd9p3a4b816y2g0092vrv"))))
    (build-system r-build-system)
    (propagated-inputs
     (list r-matrix))
    (native-inputs (list gfortran))
    (home-page "https://cran.r-project.org/web/packages/blockmodeling")
    (synopsis "Generalized and classical blockmodeling of valued networks")
    (description
     "This package is primarily meant as an implementation of generalized
blockmodeling for valued networks.  In addition, measures of similarity or
dissimilarity based on structural equivalence and regular equivalence (REGE
algorithms) can be computed and partitioned matrices can be plotted.")
    (license license:gpl2+)))

(define-public r-upsetr
  (package
    (name "r-upsetr")
    (version "1.4.0")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "UpSetR" version))
       (sha256
        (base32
         "007i0njnjjy7vbrxabwav7a1kk2n0hn2mkvqsdzzfk10ckp5y7im"))))
    (properties `((upstream-name . "UpSetR")))
    (build-system r-build-system)
    (propagated-inputs
     (list r-ggplot2 r-gridextra r-plyr r-scales))
    (home-page "https://github.com/hms-dbmi/UpSetR")
    (synopsis "Visualize intersecting sets")
    (description
     "This package provides a more scalable alternative to Venn and Euler
diagrams for visualizing intersecting sets.  Create visualizations of
intersecting sets using a novel matrix design, along with visualizations of
several common set, element and attribute related tasks.")
    (license license:expat)))

(define-public r-shinycustomloader
  (package
    (name "r-shinycustomloader")
    (version "0.9.0")
    (source (origin
              (method url-fetch)
              (uri (cran-uri "shinycustomloader" version))
              (sha256
               (base32
                "1klx71vr26g0gjf6hbiia1qidqii5d467i1sdjvlrg1hxdcggqff"))))
    (properties `((upstream-name . "shinycustomloader")))
    (build-system r-build-system)
    (propagated-inputs
     (list r-glue
           r-shiny))
    (home-page "https://cran.r-project.org/package=shinycustomloader")
    (synopsis "Custom loader for Shiny outputs")
    (description
     "This package provides a custom @code{CSS/HTML} or @code{GIF/image} file
for the loading screen in R @code{Shiny}.  It also can use the marquee to have
a custom text loading screen.")
    (license license:gpl3)))

;; This package includes a JavaScript file, which is not minified.  When
;; upgrading please check that there are no new minified JavaScript files.
(define-public r-shinybs
  (package
    (name "r-shinybs")
    (version "0.61.1")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "shinyBS" version))
       (sha256
        (base32
         "0h51685a9qll4agayldjyryi60ih969219ibg071slv0613p5v8a"))))
    (properties `((upstream-name . "shinyBS")))
    (build-system r-build-system)
    ;; The tests spawn Shiny browser apps.  They cannot be run
    ;; non-interactively.
    (arguments '(#:tests? #f))
    (propagated-inputs
     (list r-htmltools r-shiny))
    (home-page "https://ebailey78.github.io/shinyBS/")
    (synopsis "Twitter Bootstrap components for Shiny")
    (description
     "This package adds additional Twitter Bootstrap components to Shiny.")
    (license license:gpl3)))

(define-public r-shinyjqui
  (package
    (name "r-shinyjqui")
    (version "0.4.1")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "shinyjqui" version))
       (sha256
        (base32
         "135gwz7syyb6pbn0lkvmq0v1c6r1zivavnqhi1rnzbbzlysi27v1"))
       (snippet
        '(for-each delete-file
                   (list "inst/www/shinyjqui.min.js"
                         "inst/www/jquery.ui.touch-punch.min.js")))))
    (properties `((upstream-name . "shinyjqui")))
    (build-system r-build-system)
    (arguments
     `(#:phases
       (modify-phases %standard-phases
         (add-after 'unpack 'process-javascript
           (lambda* (#:key inputs #:allow-other-keys)
             (with-directory-excursion "inst/www"
               (let ((mapping
                      `((,(string-append (assoc-ref inputs "js-jquery.ui.touch-punch")
                                         "/jquery.ui.touch-punch.js")
                         . "jquery.ui.touch-punch.min.js")
                        ("shinyjqui.js"
                         . "shinyjqui.min.js"))))
                 (for-each (lambda (source target)
                             (format #true "Processing ~a --> ~a~%"
                                     source target)
                             (invoke "esbuild" source "--minify"
                                     (string-append "--outfile=" target)))
                           (map car mapping)
                           (map cdr mapping)))))))))
    (propagated-inputs
     (list r-htmltools r-htmlwidgets r-jsonlite r-rlang r-shiny))
    (native-inputs
     `(("r-knitr" ,r-knitr)
       ("esbuild" ,esbuild)
       ("js-jquery.ui.touch-punch"
        ,(origin
           (method git-fetch)
           (uri (git-reference
                 (url "https://github.com/furf/jquery-ui-touch-punch")
                 (commit "8f7559b6e65cdc3ee3648d5fe76d38c653f87ff5")))
           (sha256
            (base32
             "1lzywp2q9hwx6d5fqjla95vp7ra2lahr5dam7lsqjmch9d98r48q"))))))
    (home-page "https://github.com/yang-tang/shinyjqui")
    (synopsis "jQuery UI interactions and effects for Shiny")
    (description
     "This is an extension to Shiny that brings interactions and animation
effects from the jQuery UI library.")
    (license license:expat)))

(define-public r-shinymanager
  (package
    (name "r-shinymanager")
    (version "1.0.410")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "shinymanager" version))
       (sha256
        (base32 "0nl672dgwj34wm4i3pxk28lv6qw9xsgg3hm0h78q3zdgk8a33kdn"))))
    (properties `((upstream-name . "shinymanager")))
    (build-system r-build-system)
    (propagated-inputs
     (list r-billboarder
           r-dbi
           r-dt
           r-htmltools
           r-openssl
           r-r-utils
           r-r6
           r-rsqlite
           r-scrypt
           r-shiny))
    (native-inputs (list r-knitr r-testthat))
    (home-page "https://github.com/datastorm-open/shinymanager")
    (synopsis "Authentication management for Shiny applications")
    (description
     "This package provides simple and secure authentication mechanism for
single Shiny applications.  Credentials are stored in an encrypted SQLite
database.")
    (license license:gpl3)))

(define-public r-outliers
  (package
    (name "r-outliers")
    (version "0.15")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "outliers" version))
       (sha256
        (base32
         "1yrmwvjjb0a6sbx940k9svf23cykcxz8rrwcgyic7lpgzbrdfcfc"))))
    (build-system r-build-system)
    (home-page "https://cran.r-project.org/web/packages/outliers/index.html")
    (synopsis "Tests for outliers")
    (description
     "This package provides a collection of some tests commonly used for
identifying outliers.")
    (license license:gpl2+)))

(define-public r-bayesm
  (package
    (name "r-bayesm")
    (version "3.1-6")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "bayesm" version))
       (sha256
        (base32 "1d9wp7yr5hadyv48f51xqa5yzfnhh01n813sivwla209vjf2pmqp"))))
    (build-system r-build-system)
    (propagated-inputs
     (list r-rcpp r-rcpparmadillo))
    (native-inputs (list r-knitr))
    (home-page "https://www.perossi.org/home/bsm-1")
    (synopsis "Bayesian inference for marketing/micro-econometrics")
    (description
     "This package covers many important models used in marketing and
micro-econometrics applications, including Bayes Regression (univariate or
multivariate dep var), Bayes Seemingly Unrelated Regression (SUR), Binary and
Ordinal Probit, Multinomial Logit (MNL) and Multinomial Probit (MNP),
Multivariate Probit, Negative Binomial (Poisson) Regression, Multivariate
Mixtures of Normals (including clustering), Dirichlet Process Prior Density
Estimation with normal base, Hierarchical Linear Models with normal prior and
covariates, Hierarchical Linear Models with a mixture of normals prior and
covariates, Hierarchical Multinomial Logits with a mixture of normals prior
and covariates, Hierarchical Multinomial Logits with a Dirichlet Process prior
and covariates, Hierarchical Negative Binomial Regression Models, Bayesian
analysis of choice-based conjoint data, Bayesian treatment of linear
instrumental variables models, Analysis of Multivariate Ordinal survey data
with scale usage heterogeneity, and Bayesian Analysis of Aggregate Random
Coefficient Logit Models.")
    (license license:gpl2+)))

(define-public r-tensora
  (package
    (name "r-tensora")
    (version "0.36.2.1")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "tensorA" version))
       (sha256
        (base32
         "1dvxc4d5c8k3mqkx6bjgfmnb98rrdd1rsazyva76mzvxzrhq4n06"))))
    (properties `((upstream-name . "tensorA")))
    (build-system r-build-system)
    (home-page "http://www.stat.boogaart.de/tensorA")
    (synopsis "Advanced tensor arithmetic with named indices")
    (description
     "This package provides convenience functions for advanced linear algebra
with tensors and computation with datasets of tensors on a higher level
abstraction.  It includes Einstein and Riemann summing conventions, dragging,
co- and contravariate indices, and parallel computations on sequences of
tensors.")
    (license license:gpl2+)))

(define-public r-tester
  (package
    (name "r-tester")
    (version "0.2.0")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "tester" version))
       (sha256
        (base32 "02q2l0c38ddzlh2jwbzkcyhh2k5a4gnfm8khl8cqvjkjhldi9j5y"))))
    (properties `((upstream-name . "tester")))
    (build-system r-build-system)
    ;; FIXME Tests fail with: could not find function "context"
    (arguments (list #:tests? #false))
    (native-inputs (list r-knitr r-testthat))
    (home-page "https://fbertran.github.io/tester/")
    (synopsis "Tests and checks characteristics of R objects")
    (description "This package allows users to test characteristics of common
R objects.")
    (license license:gpl3)))

(define-public r-testit
  (package
    (name "r-testit")
    (version "0.13")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "testit" version))
       (sha256
        (base32 "104dcxdmzgj340mwk4lpw1y6j1xc4rv4a2v09ckx3nvbmdl73m4h"))))
    (properties `((upstream-name . "testit")))
    (build-system r-build-system)
    (arguments
     (list
      #:phases
      '(modify-phases %standard-phases
         ;; Tests need it.
         (add-after 'unpack 'set-HOME
           (lambda _ (setenv "HOME" "/tmp"))))))
    (home-page "https://github.com/yihui/testit")
    (synopsis "Simple package for testing R packages")
    (description
     "This package provides two convenience functions @code{assert()} and
@code{test_pkg()} to facilitate testing R packages.")
    (license license:gpl3)))

(define-public r-rarpack
  (package
    (name "r-rarpack")
    (version "0.11-0")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "rARPACK" version))
       (sha256
        (base32
         "12h2y46xcfldhjdmm960swgn9b23zvkj5vg2bi42s9qxwgi02d63"))))
    (properties `((upstream-name . "rARPACK")))
    (build-system r-build-system)
    (propagated-inputs (list r-rspectra))
    (home-page "https://github.com/yixuan/rARPACK")
    (synopsis "Solvers for large scale eigenvalue and SVD problems")
    (description
     "This package was previously an R wrapper of the ARPACK library, and now
a shell of the R package RSpectra, an R interface to the Spectra library for
solving large scale eigenvalue/vector problems.  The current version of
rARPACK simply imports and exports the functions provided by RSpectra.  New
users of rARPACK are advised to switch to the RSpectra package.")
    (license license:bsd-3)))

(define-public r-compositions
  (package
    (name "r-compositions")
    (version "2.0-8")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "compositions" version))
       (sha256
        (base32
         "147j3sbqcy3hfja1zs8s8p9zzp9a68vk52s545c2p6anyj4381n5"))))
    (build-system r-build-system)
    (propagated-inputs
     (list r-bayesm r-mass r-robustbase r-tensora))
    (native-inputs
     (list r-knitr))
    (home-page "http://www.stat.boogaart.de/compositions")
    (synopsis "Compositional data analysis")
    (description
     "This package provides functions for the consistent analysis of
compositional data (e.g. portions of substances) and positive
numbers (e.g. concentrations).")
    (license license:gpl2+)))

(define-public r-cobs
  (package
    (name "r-cobs")
    (version "1.3-9")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "cobs" version))
       (sha256
        (base32
         "1czrnwd8qamznl2vxrj9p37azz7pgqg7ygrhwr4rmhwg5d2k9nrg"))))
    (build-system r-build-system)
    (propagated-inputs
     (list r-quantreg r-sparsem))
    (home-page "https://cran.r-project.org/web/packages/cobs")
    (synopsis "Constrained B-Splines (sparse matrix based)")
    (description
     "This package provides qualitatively constrained (regression) smoothing
splines via linear programming and sparse matrices.")
    (license license:gpl2+)))

(define-public r-drimpute
  (package
    (name "r-drimpute")
    (version "1.0")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "DrImpute" version))
       (sha256
        (base32
         "1adzarrwqb282pqgx2yqswp9rpwd1naxsmar54kddr6qyd6b923b"))))
    (properties `((upstream-name . "DrImpute")))
    (build-system r-build-system)
    (propagated-inputs
     (list r-rcpp r-rcpparmadillo))
    (home-page "https://github.com/ikwak2/DrImpute")
    (synopsis "Imputing dropout events in single-cell RNA-Seq data")
    (description
     "This is an R package for imputing dropout events.  Many statistical
methods in cell type identification, visualization and lineage reconstruction
do not account for dropout events.  DrImpute can improve the performance of
such software by imputing dropout events.")
    (license license:gpl3)))

(define-public r-gamlss-dist
  (package
    (name "r-gamlss-dist")
    (version "6.1-1")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "gamlss.dist" version))
       (sha256
        (base32 "0sch2bh1mchl7kfdy4wcmwzzgx7cldswn65a2br2x73rb1v3mnyj"))))
    (properties `((upstream-name . "gamlss.dist")))
    (build-system r-build-system)
    (propagated-inputs (list r-mass))
    (home-page "http://www.gamlss.org/")
    (synopsis "Distributions for Generalized Additive Models for location scale and shape")
    (description
     "This package provides a set of distributions which can be used for
modelling the response variables in Generalized Additive Models for Location
Scale and Shape.  The distributions can be continuous, discrete or mixed
distributions.  Extra distributions can be created, by transforming, any
continuous distribution defined on the real line, to a distribution defined on
ranges 0 to infinity or 0 to 1, by using a @code{log} or a @code{logit}
transformation, respectively.")
    ;; Either version of the GPL.
    (license (list license:gpl2 license:gpl3))))

;; This package includes JavaScript files, which are not minified.  When
;; upgrading please check that there are no new minified JavaScript files.
(define-public r-shinyjs
  (package
    (name "r-shinyjs")
    (version "2.1.0")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "shinyjs" version))
       (sha256
        (base32
         "1id9gsrkr28xl80a8794in17rxmmz06zqvd5hlns7mqz3fzhrhky"))))
    (build-system r-build-system)
    (propagated-inputs
     (list r-digest r-jsonlite r-shiny))
    (native-inputs
     (list r-knitr r-testthat))
    (home-page "https://deanattali.com/shinyjs")
    (synopsis "Improve the user experience of your Shiny apps")
    (description
     "Perform common useful JavaScript operations in Shiny apps that will
greatly improve your apps without having to know any JavaScript.  Examples
include: hiding an element, disabling an input, resetting an input back to its
original value, delaying code execution by a few seconds, and many more useful
functions for both the end user and the developer.  Shinyjs can also be used
to easily call your own custom JavaScript functions from R.")
    (license license:agpl3+)))

;; This package includes minified JavaScript files.  When upgrading please
;; check that there are no new minified JavaScript files.
(define-public r-colourpicker
  (package
    (name "r-colourpicker")
    (version "1.3.0")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "colourpicker" version))
       (sha256
        (base32
         "0415238r7a8xrp3kvq8lczzxz534irj2q1zfbb0pl7xfs6663wn7"))
       (snippet
        '(for-each delete-file
                   (list "inst/examples/colourInput/www/salvattore.min.js"
                         "inst/htmlwidgets/lib/jquery/jquery.min.js"
                         "inst/www/shared/colourpicker/js/colourpicker.min.js")))))
    (build-system r-build-system)
    (arguments
     (list
      #:phases
      '(modify-phases %standard-phases
         (add-after 'unpack 'process-javascript
           (lambda* (#:key inputs #:allow-other-keys)
             (with-directory-excursion "inst"
               (let ((mapping
                      `((,(assoc-ref inputs "js-salvattore")
                         . "examples/colourInput/www/salvattore.min.js")
                        (,(assoc-ref inputs "js-jquery")
                         . "htmlwidgets/lib/jquery/jquery.min.js")
                        ("www/shared/colourpicker/js/colourpicker.js"
                         . "www/shared/colourpicker/js/colourpicker.min.js"))))
                 (for-each (lambda (source target)
                             (format #true "Processing ~a --> ~a~%"
                                     source target)
                             (invoke "esbuild" source "--minify"
                                     (string-append "--outfile=" target)))
                           (map car mapping)
                           (map cdr mapping)))))))))
    (propagated-inputs
     (list r-ggplot2
           r-htmltools
           r-htmlwidgets
           r-jsonlite
           r-miniui
           r-shiny
           r-shinyjs))
    (native-inputs
     `(("esbuild" ,esbuild)
       ("js-jquery"
        ,(origin
           (method url-fetch)
           (uri "https://code.jquery.com/jquery-3.6.1.js")
           (sha256
            (base32
             "1lm4zcpvqdi7qi2s7bgci2z74wazq0z0bdvjmlrqbhmfrpk42ffz"))))
       ("js-salvattore"
        ,(origin
           (method url-fetch)
           (uri "https://raw.githubusercontent.com/rnmp/salvattore/v1.0.9/dist/salvattore.js")
           (sha256
            (base32
             "0lfrbx7l9w5x89jpc6njmd0pk7h8fpvg537vklai2vf7b1r2nnk5"))))))
    (home-page "https://github.com/daattali/colourpicker")
    (synopsis "Color picker tool for Shiny and for selecting colors in plots")
    (description
     "This package provides a color picker that can be used as an input in
Shiny apps or Rmarkdown documents.  The color picker supports alpha opacity,
custom color palettes, and many more options.  A plot color helper tool is
available as an RStudio Addin, which helps you pick colors to use in your
plots.  A more generic color picker RStudio Addin is also provided to let you
select colors to use in your R code.")
    (license license:expat)))

(define-public r-ggextra
  (package
    (name "r-ggextra")
    (version "0.10.1")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "ggExtra" version))
       (sha256
        (base32
         "0b78bnkhjlfa2h3f5iib0hqas8r289vqglfbk71a419rivzfsyb8"))))
    (properties `((upstream-name . "ggExtra")))
    (build-system r-build-system)
    (propagated-inputs
     (list r-colourpicker
           r-ggplot2
           r-gtable
           r-miniui
           r-r6
           r-scales
           r-shiny
           r-shinyjs))
    (native-inputs
     (list r-knitr r-testthat))
    (home-page "https://github.com/daattali/ggExtra")
    (synopsis "Marginal histograms for ggplot2 and other enhancements")
    (description
     "This package is a collection of functions and layers to enhance ggplot2.
The flagship function is @code{ggMarginal()}, which can be used to add
marginal histograms/boxplots/density plots to ggplot2 scatterplots.")
    (license license:expat)))

(define-public r-ggpattern
  (package
    (name "r-ggpattern")
    (version "1.1.4")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "ggpattern" version))
       (sha256
        (base32 "1rbr6sjayy4a2pwpp25c5lj2g55zyi27a2rqpi4yrdb229yanf0q"))))
    (properties `((upstream-name . "ggpattern")))
    (build-system r-build-system)
    (propagated-inputs
     (list r-cli
           r-ggplot2
           r-glue
           r-gridpattern
           r-lifecycle
           r-rlang
           r-scales
           r-vctrs))
    (native-inputs (list r-knitr r-ragg r-rmarkdown))
    (home-page "https://github.com/coolbutuseless/ggpattern")
    (synopsis "Ggplot2 pattern geoms")
    (description
     "This package provides ggplot2 geoms filled with various patterns.
It includes a patterned version of every ggplot2 geom that has a region that
can be filled with a pattern.  It provides a suite of ggplot2 aesthetics and
scales for controlling pattern appearances.  It supports over a dozen builtin
patterns (every pattern implemented by gridpattern) as well as allowing custom
user-defined patterns.")
    (license license:expat)))

(define-public r-minpack-lm
  (package
    (name "r-minpack-lm")
    (version "1.2-4")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "minpack.lm" version))
       (sha256
        (base32
         "0cg7arnmb7x6v5x487gkc2k4i5gchgdwblrrd0k0vw1w6pza83z3"))))
    (properties `((upstream-name . "minpack.lm")))
    (build-system r-build-system)
    (native-inputs (list gfortran))
    (home-page "https://cran.r-project.org/web/packages/minpack.lm")
    (synopsis "Levenberg-Marquardt Nonlinear Least-Squares algorithm")
    (description
     "The @code{nls.lm} function provides an R interface to @code{lmder} and
@code{lmdif} from the MINPACK library, for solving nonlinear least-squares
problems by a modification of the Levenberg-Marquardt algorithm, with support
for lower and upper parameter bounds.  The implementation can be used via
@code{nls}-like calls using the @code{nlsLM} function.")
    (license license:gpl3)))

(define-public r-moments
  (package
    (name "r-moments")
    (version "0.14.1")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "moments" version))
       (sha256
        (base32
         "0r6qf3i1rzh2822bx1p0h8mh91gsbgg6asl2rzh2l4ys094bilif"))))
    (build-system r-build-system)
    (home-page "https://cran.r-project.org/web/packages/moments")
    (synopsis "Moments, cumulants, skewness, kurtosis and related tests")
    (description
     "This package provides functions to calculate: moments, Pearson's
kurtosis, Geary's kurtosis and skewness; it also includes tests related to
them (Anscombe-Glynn, D'Agostino, Bonett-Seier).")
    (license license:gpl2+)))

(define-public r-msir
  (package
    (name "r-msir")
    (version "1.3.3")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "msir" version))
       (sha256
        (base32
         "1wm83m3cqd6llxb9p2jwim0wb81v84pgdmgcznygzaaq6kbn3n84"))))
    (build-system r-build-system)
    (propagated-inputs
     (list r-mclust))
    (native-inputs
     (list r-knitr))
    (home-page "https://cran.r-project.org/web/packages/msir")
    (synopsis "Model-based sliced inverse regression")
    (description
     "This is an R package for dimension reduction based on finite Gaussian
mixture modeling of inverse regression.")
    (license license:gpl2+)))

(define-public r-pbivnorm
  (package
    (name "r-pbivnorm")
    (version "0.6.0")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "pbivnorm" version))
       (sha256
        (base32
         "05jzrjqxzbcf6z245hlk7sjxiszv9paadaaimvcx5y5qgi87vhq7"))))
    (build-system r-build-system)
    (native-inputs (list gfortran))
    (home-page "https://github.com/brentonk/pbivnorm")
    (synopsis "Vectorized bivariate normal CDF")
    (description
     "This package provides a vectorized R function for calculating
probabilities from a standard bivariate normal CDF.")
    (license license:gpl2+)))

(define-public r-lavaan
  (package
    (name "r-lavaan")
    (version "0.6-19")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "lavaan" version))
       (sha256
        (base32
         "11dpx1bmlx5120fp214bzadqvk2p46l5vgcq6r1kmlv4q7ikgca7"))))
    (build-system r-build-system)
    (propagated-inputs
     (list r-mass r-mnormt r-numderiv r-pbivnorm r-quadprog))
    (home-page "https://lavaan.ugent.be")
    (synopsis "Latent variable analysis")
    (description
     "This package provides tools to fit a variety of latent variable models,
including confirmatory factor analysis, structural equation modeling and
latent growth curve models.")
    (license license:gpl2+)))

(define-public r-nonnest2
  (package
    (name "r-nonnest2")
    (version "0.5-8")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "nonnest2" version))
       (sha256
        (base32
         "10nw8b0qcppbwc4lvvpyxpxvg583bl3fy916yx74xcm563aar98r"))))
    (build-system r-build-system)
    (propagated-inputs
     (list r-compquadform r-lavaan r-mvtnorm r-sandwich))
    (native-inputs
     (list r-knitr r-testthat))
    (home-page "https://cran.r-project.org/web/packages/nonnest2/")
    (synopsis "Tests of non-nested models")
    (description
     "This package allows for testing of non-nested models.  It includes tests
of model distinguishability and of model fit that can be applied to both
nested and non-nested models.  The package also includes functionality to
obtain confidence intervals associated with AIC and BIC.")
    ;; Either version of the GPL.
    (license (list license:gpl2 license:gpl3))))

(define-public r-penalized
  (package
    (name "r-penalized")
    (version "0.9-52")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "penalized" version))
       (sha256
        (base32
         "08badmgygppbqzay20qijyww028yw6s8dyd8ijcp8g4r9rn8xqyq"))))
    (build-system r-build-system)
    (propagated-inputs
     (list r-rcpp r-rcpparmadillo r-survival))
    (home-page "https://cran.r-project.org/web/packages/penalized/")
    (synopsis "Penalized estimation in GLMs and in the Cox model")
    (description
     "This package provides tools for fitting possibly high dimensional
penalized regression models.  The penalty structure can be any combination of
an L1 penalty (lasso and fused lasso), an L2 penalty (ridge) and a positivity
constraint on the regression coefficients.  The supported regression models
are linear, logistic and Poisson regression and the Cox Proportional Hazards
model.  Cross-validation routines allow optimization of the tuning
parameters.")
    (license license:gpl2+)))

(define-public r-zim
  (package
    (name "r-zim")
    (version "1.1.0")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "ZIM" version))
       (sha256
        (base32
         "0scyfjn4ilsvha3x41c3b8bcfi31hlhwm77wn2a8hj5dsvnnmzig"))))
    (properties `((upstream-name . "ZIM")))
    (build-system r-build-system)
    (propagated-inputs (list r-mass))
    (home-page "https://github.com/biostatstudio/ZIM")
    (synopsis "Zero-inflated models (ZIM) for count time series with excess zeros")
    (description
     "Analyze count time series with excess zeros.  Two types of statistical
models are supported: Markov regression and state-space models.  They are also
known as observation-driven and parameter-driven models respectively in the
time series literature.  The functions used for Markov regression or
observation-driven models can also be used to fit ordinary regression models
with independent data under the zero-inflated Poisson (ZIP) or zero-inflated
negative binomial (ZINB) assumption.  The package also contains miscellaneous
functions to compute density, distribution, quantile, and generate random
numbers from ZIP and ZINB distributions.")
    (license license:gpl3)))

(define-public r-nor1mix
  (package
    (name "r-nor1mix")
    (version "1.3-3")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "nor1mix" version))
       (sha256
        (base32
         "0vh7vlvijska09rm0cb2lakwhjm38mc4daksc2zniyj7r3wd1gwp"))))
    (build-system r-build-system)
    (home-page "https://cran.r-project.org/web/packages/nor1mix/")
    (synopsis "Normal (1-d) mixture models")
    (description
     "This package provides S3 classes and methods for one-dimensional normal
mixture models, for, e.g., density estimation or clustering algorithms
research and teaching; it provides the widely used Marron-Wand densities.  It
also provides tools for efficient random number generation and graphics.")
    (license license:gpl2+)))

(define-public r-beanplot
  (package
    (name "r-beanplot")
    (version "1.3.1")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "beanplot" version))
       (sha256
        (base32
         "1b8mvlcsv5l9g08ag92hndsvk8jmgxvznhzgazc8y4296kp8l5a9"))))
    (build-system r-build-system)
    (home-page "https://cran.r-project.org/web/packages/beanplot/")
    (synopsis "Visualization via beanplots")
    (description
     "This package provides beanplots, an alternative to
boxplot/stripchart/violin plots.  It can be used to plot univariate comparison
graphs.")
    (license license:gpl2)))

(define-public r-pbdzmq
  (package
    (name "r-pbdzmq")
    (version "0.3-14")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "pbdZMQ" version))
       (sha256
        (base32
         "08rjnbp7wg00ffyc3am907c6pb3l5vhc5j1rgifnay4kvdk4y5b0"))))
    (properties
     `((upstream-name . "pbdZMQ")
       (updater-extra-inputs . ("zeromq"))))
    (build-system r-build-system)
    (inputs
     (list zeromq zlib))
    (native-inputs
     (list pkg-config))
    (home-page "https://pbdr.org/")
    (synopsis "R interface to ZeroMQ")
    (description
     "ZeroMQ is a well-known library for high-performance asynchronous
messaging in scalable, distributed applications.  This package provides high
level R wrapper functions to easily utilize ZeroMQ.  The main focus is on
interactive client/server programming frameworks.  A few wrapper functions
compatible with @code{rzmq} are also provided.")
    (license license:gpl3)))

(define-public r-repr
  (package
    (name "r-repr")
    (version "1.1.7")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "repr" version))
       (sha256
        (base32
         "06q2xmg27w1hhapcf320zz92f5arwrf2sf0y1mp0j4a29mmnkgbk"))))
    (build-system r-build-system)
    (propagated-inputs
     (list r-base64enc r-htmltools r-jsonlite r-pillar))
    (native-inputs (list r-testthat))
    (home-page "https://cran.r-project.org/web/packages/repr/")
    (synopsis "Serializable representations")
    (description
     "This package provides string and binary representations of objects for
several formats and MIME types.")
    (license license:gpl3)))

(define-public r-irace
  (package
    (name "r-irace")
    (version "4.2.0")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "irace" version))
       (sha256
        (base32 "1cd7wjpshl2fvmqrla1nbahzryhz0q4yfmqm85wim621f54fdksq"))))
    (properties `((upstream-name . "irace")))
    (build-system r-build-system)
    (propagated-inputs (list r-codetools
                             r-data-table
                             r-fs
                             r-matrixstats
                             r-r6
                             r-spacefillr
                             r-withr))
    (native-inputs (list r-knitr r-rmpi r-testthat))
    (home-page "https://mlopez-ibanez.github.io/irace/")
    (synopsis "Iterated racing for automatic algorithm configuration")
    (description
     "Iterated race is an extension of the Iterated F-race method for the
automatic configuration of optimization algorithms, that is, (offline) tuning
their parameters by finding the most appropriate settings given a set of
instances of an optimization problem.")
    (license license:gpl2+)))

(define-public r-irdisplay
  (package
    (name "r-irdisplay")
    (version "1.1")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "IRdisplay" version))
       (sha256
        (base32
         "0awdiv4rr93y8jb1d64sm1iy37ywyniqm7w98yv6qm0zz47h7sw3"))))
    (properties `((upstream-name . "IRdisplay")))
    (build-system r-build-system)
    (propagated-inputs
     (list r-repr))
    (native-inputs (list r-testthat))
    (home-page "https://cran.r-project.org/web/packages/IRdisplay/")
    (synopsis "Jupyter display machinery")
    (description
     "This package provides an interface to the rich display capabilities of
Jupyter front-ends (e.g. Jupyter Notebook).  It is designed to be used from a
running IRkernel session.")
    (license license:expat)))

;; XXX: Maybe move to jupyter module.
(define-public r-irkernel
  (package
    (name "r-irkernel")
    (version "1.3.2")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "IRkernel" version))
       (sha256
        (base32
         "19i4wj5cb62n6j83nxgv500dcdzrf6rzwdy5v6fh7r93vjyxiip1"))))
    (properties `((upstream-name . "IRkernel")))
    (build-system r-build-system)
    (arguments
     `(#:phases
       (modify-phases %standard-phases
         (add-after 'install 'install-kernelspec
           (lambda* (#:key outputs #:allow-other-keys)
             (let ((out (assoc-ref outputs "out")))
               (setenv "HOME" "/tmp")
               (invoke "jupyter" "kernelspec" "install"
                       "--name" "ir"
                       "--prefix" out
                       (string-append out "/site-library/IRkernel/kernelspec"))
               ;; Record the absolute file name of the 'R' executable in
               ;; 'kernel.json'.
               (substitute* (string-append out "/share/jupyter"
                                           "/kernels/ir/kernel.json")
                 (("\\[\"R\",")
                  (string-append "[\"" (which "R") "\",")))
               #t))))))
    (inputs
     (list jupyter))
    (propagated-inputs
     (list r-crayon
           r-digest
           r-evaluate
           r-irdisplay
           r-jsonlite
           ;; sets R_LIBS_SITE, so R can actually find this package (IRkernel)
           r-minimal
           r-pbdzmq
           r-repr
           r-uuid))
    (native-inputs (list r-testthat))
    (home-page "https://cran.r-project.org/web/packages/IRkernel/")
    (synopsis "Native R kernel for Jupyter")
    (description
     "The R kernel for the Jupyter environment executes R code which the
front-end (Jupyter Notebook or other front-ends) submits to the kernel via the
network.")
    (license license:expat)))

(define-public r-gmodels
  (package
    (name "r-gmodels")
    (version "2.19.1")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "gmodels" version))
       (sha256
        (base32
         "13c8x7iwyz36qir3ikbvjb5dl6gdh4fh82qdxcpcdinwfhrbhmxv"))))
    (build-system r-build-system)
    (propagated-inputs
     (list r-gdata r-mass))
    (home-page "https://cran.r-project.org/web/packages/gmodels/")
    (synopsis "Various R programming tools for model fitting")
    (description
     "This package provides various R programming tools for model fitting.")
    (license license:gpl2)))

(define-public r-apcluster
  (package
    (name "r-apcluster")
    (version "1.4.13")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "apcluster" version))
       (sha256
        (base32
         "19x1sma5pli5jl0v92c6x7jbqkigz7waaghaxi29kvvx8am5p5sy"))))
    (build-system r-build-system)
    (propagated-inputs
     (list r-matrix r-rcpp))
    (native-inputs (list r-knitr))
    (home-page "https://cran.r-project.org/web/packages/apcluster/")
    (synopsis "Affinity propagation clustering")
    (description
     "This package implements affinity propagation clustering introduced by
Frey and Dueck (2007).  The package further provides leveraged affinity
propagation and an algorithm for exemplar-based agglomerative clustering that
can also be used to join clusters obtained from affinity propagation.  Various
plotting functions are available for analyzing clustering results.")
    (license license:gpl2+)))

(define-public r-remacor
  (package
    (name "r-remacor")
    (version "0.0.18")
    (source (origin
              (method url-fetch)
              (uri (cran-uri "remaCor" version))
              (sha256
               (base32
                "0c8n2zj84m2z0vznx81qrspnyyj38imb73di4l2k0brr8jxgzr2p"))))
    (properties `((upstream-name . "remaCor")))
    (build-system r-build-system)
    (propagated-inputs
     (list r-envstats
           r-ggplot2
           r-mvtnorm
           r-rcpp
           r-rcpparmadillo
           r-rdpack
           r-reshape2))
    (native-inputs (list r-knitr r-runit))
    (home-page "https://diseaseneurogenomics.github.io/remaCor/")
    (synopsis "Random effects meta-analysis for correlated test statistics")
    (description
     "Meta-analysis is widely used to summarize estimated effects sizes across
multiple statistical tests.  Standard fixed and random effect meta-analysis
methods assume that the estimated of the effect sizes are statistically
independent.  Here we relax this assumption and enable meta-analysis when the
correlation matrix between effect size estimates is known.")
    (license license:artistic2.0)))

(define-public r-rematch2
  (package
    (name "r-rematch2")
    (version "2.1.2")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "rematch2" version))
       (sha256
        (base32
         "1fzpz8vhghw8ygwg6rsvfy3783pqk7ch029i5851lwypkplvz77y"))))
    (build-system r-build-system)
    (propagated-inputs
     (list r-tibble))
    (native-inputs (list r-testthat))
    (home-page "https://github.com/r-lib/rematch2")
    (synopsis "Tidy output from regular expression matching")
    (description
     "This package provides wrappers on @code{regexpr} and @code{gregexpr} to
return the match results in tidy data frames.")
    (license license:expat)))

(define-public r-picante
  (package
    (name "r-picante")
    (version "1.8.2")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "picante" version))
       (sha256
        (base32
         "19savjzj44b7ifdxcp02ynj22z4n4ikq2aipc74ljzy3yykmqmjn"))))
    (build-system r-build-system)
    (propagated-inputs
     (list r-ape r-nlme r-vegan))
    (home-page "https://cran.r-project.org/web/packages/picante/")
    (synopsis "Integrating phylogenies and ecology")
    (description
     "This package provides functions for phylocom integration, community
analyses, null-models, traits and evolution.  It implements numerous
ecophylogenetic approaches including measures of community phylogenetic and
trait diversity, phylogenetic signal, estimation of trait values for
unobserved taxa, null models for community and phylogeny randomizations, and
utility functions for data input/output and phylogeny plotting.  A full
description of package functionality and methods are provided by Kembel et
al. (2010).")
    (license license:gpl2)))

(define-public r-reinforcelearn
  (package
    (name "r-reinforcelearn")
    (version "0.2.1")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "reinforcelearn" version))
       (sha256
        (base32
         "176z2q69p24i29a8sh19xxn2zl3h1z2ixdssr5i6m4yvkvdrvv3b"))))
    (build-system r-build-system)
    (propagated-inputs
     (list r-checkmate r-nnet r-purrr r-r6))
    (native-inputs (list r-knitr r-testthat))
    (home-page "https://markusdumke.github.io/reinforcelearn")
    (synopsis "Reinforcement learning")
    (description
     "This package implements reinforcement learning environments and
algorithms as described in Sutton & Barto (1998).  The Q-Learning algorithm
can be used with function approximation, eligibility traces (Singh & Sutton,
1996) and experience replay (Mnih et al., 2013).")
    (license license:expat)))

(define-public r-lemon
  (package
    (name "r-lemon")
    (version "0.5.0")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "lemon" version))
       (sha256
        (base32
         "0d0x9mds241hm6armdb32zg4wkkvyy23q2cwk550lmxx2x6bb71w"))))
    (build-system r-build-system)
    (propagated-inputs
     (list r-ggplot2
           r-gridextra
           r-gtable
           r-knitr
           r-lattice
           r-plyr
           r-scales))
    (native-inputs
     (list r-knitr r-testthat r-vdiffr))
    (home-page "https://github.com/stefanedwards/lemon")
    (synopsis "Freshen up your ggplot2 plots")
    (description
     "This package provides functions for working with legends and axis lines
of ggplot2, facets that repeat axis lines on all panels, and some knitr
extensions.")
    (license license:gpl3)))

(define-public r-wgaim
  (package
    (name "r-wgaim")
    (version "2.0-6")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "wgaim" version))
       (sha256
        (base32 "0i13ngp0z0l72jbzdpydp3pigggmp4bn9jfyzjkbzj2fhfixsqf0"))))
    (build-system r-build-system)
    (propagated-inputs
     (list r-ggplot2 r-qtl))
    (home-page "https://cran.r-project.org/web/packages/wgaim")
    (synopsis "Whole genome average interval mapping for QTL detection")
    (description
     "This package integrates sophisticated mixed modelling methods with a
whole genome approach to detecting significant QTL in linkage maps.")
    (license license:gpl2+)))

(define-public r-bedr
  (package
    (name "r-bedr")
    (version "1.1.3")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "bedr" version))
       (sha256
        (base32
         "1mxscr02n81jcwmw4rzmixwvcipjv018gdaqigyvis0p7y0iras7"))))
    (build-system r-build-system)
    ;; FIXME Tests fail with: could not find function "context"
    (arguments (list #:tests? #false))
    (propagated-inputs
     (list r-data-table
           r-r-utils
           r-testthat
           r-venndiagram
           r-yaml
           bedops
           bedtools
           htslib)) ;for tabix
    (native-inputs
     (list r-testthat r-knitr))
    (home-page "https://cran.r-project.org/web/packages/bedr")
    (synopsis "Genomic region processing")
    (description
     "This package is for genomic regions processing using command line tools
such as BEDTools, BEDOPS and Tabix.  These tools offer scalable and efficient
utilities to perform genome arithmetic e.g indexing, formatting and merging.
The bedr package's API enhances access to these tools as well as offers
additional utilities for genomic regions processing.")
    (license license:gpl2)))

(define-public r-setrng
  (package
    (name "r-setrng")
    (version "2024.2-1")
    (source (origin
              (method url-fetch)
              (uri (cran-uri "setRNG" version))
              (sha256
               (base32
                "0h2wbpsi07c48h72zjglvp9b58hq3j77289sah32qg6vnw41pcp3"))))
    (properties `((upstream-name . "setRNG")))
    (build-system r-build-system)
    (home-page "https://distr.r-forge.r-project.org/")
    (synopsis "Set (normal) random number generator and seed")
    (description
     "This package provides utilities to help set and record the setting of
the seed and the uniform and normal generators used when a random experiment
is run.  The utilities can be used in other functions that do random
experiments to simplify recording and/or setting all the necessary information
for reproducibility.  See the vignette and reference manual for examples.")
    (license license:gpl2)))

(define-public r-sets
  (package
    (name "r-sets")
    (version "1.0-25")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "sets" version))
       (sha256
        (base32
         "1x14q29jjmrs5ldbjc7pxp5pr52j3dw6zr9k5qvz4ycniwhnk92w"))))
    (properties `((upstream-name . "sets")))
    (build-system r-build-system)
    (home-page "https://cran.r-project.org/web/packages/sets")
    (synopsis "Sets, generalized sets, customizable sets and intervals")
    (description
     "This package provides data structures and basic operations for ordinary
sets, generalizations such as fuzzy sets, multisets, and fuzzy multisets,
customizable sets, and intervals.")
    (license license:gpl2)))

(define-public r-partitions
  (package
    (name "r-partitions")
    (version "1.10-9")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "partitions" version))
       (sha256
        (base32
         "088wmm14lih7gs85rmcd2bggs8fdd8xj7m9q469hh9arcbnwsb8s"))))
    (build-system r-build-system)
    ;; Vignettes fail because of a missing file.
    (arguments (list #:test-types '(list "tests")))
    (propagated-inputs
     (list r-gmp r-polynom r-rdpack r-sets))
    (native-inputs (list r-testthat))
    (home-page "https://cran.r-project.org/web/packages/partitions")
    (synopsis "Additive partitions of integers")
    (description
     "This package provides tools to enumerates the partitions, unequal
partitions, and restricted partitions of an integer; the three corresponding
partition functions are also given.")
    ;; Any version of the GPL
    (license license:gpl2+)))

(define-public r-brobdingnag
  (package
    (name "r-brobdingnag")
    (version "1.2-9")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "Brobdingnag" version))
       (sha256
        (base32
         "07p9416rdzfyiigbglxjpbcg7pfly9nw19yn2mwg98621cjjs0gr"))))
    (properties `((upstream-name . "Brobdingnag")))
    (build-system r-build-system)
    (propagated-inputs (list r-matrix))
    (native-inputs (list r-testthat))
    (home-page "https://github.com/RobinHankin/Brobdingnag.git")
    (synopsis "Very large numbers in R")
    (description
     "This package handles very large numbers in R.  Real numbers are held
using their natural logarithms, plus a logical flag indicating sign.  The
package includes a vignette that gives a step-by-step introduction to using S4
methods.")
    ;; Any version of the GPL
    (license license:gpl2+)))

(define-public r-unglue
  (package
    (name "r-unglue")
    (version "0.1.0")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "unglue" version))
       (sha256
        (base32 "0w8ld4xllx0lj1jz8i2sj92f8136hlwri1d8ldpg1ymxj7aw93vg"))))
    (properties `((upstream-name . "unglue")))
    (build-system r-build-system)
    (native-inputs (list r-testthat))
    (home-page "https://cran.r-project.org/package=unglue")
    (synopsis "Extract matched substrings using a pattern")
    (description
     "This package lets you use syntax inspired by the package @code{glue} to
extract matched substrings in a more intuitive and compact way than by using
standard regular expressions.")
    (license license:gpl3)))

(define-public r-untb
  (package
    (name "r-untb")
    (version "1.7-7-1")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "untb" version))
       (sha256
        (base32
         "1v0c43shqn7nmzzrf3yx740xjwrn4djll438p5gf31ny0q0hlgzb"))))
    (build-system r-build-system)
    ;; Disable vignettes because of missing files.
    (arguments (list #:test-types '(list "tests")))
    (propagated-inputs
     (list r-brobdingnag r-partitions r-polynom))
    (native-inputs (list r-testthat r-vdiffr))
    (home-page "https://github.com/RobinHankin/untb.git")
    (synopsis "Ecological drift under the UNTB")
    (description
     "This package provides numerical simulations, and visualizations, of
Hubbell's @dfn{Unified Neutral Theory of Biodiversity} (UNTB).")
    (license license:gpl2+)))

(define-public r-stepwise
  (package
    (name "r-stepwise")
    (version "0.3")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "stepwise" version))
       (sha256
        (base32
         "1lbx1bxwkf9dw6q46w40pp7h5nkxgghmx8rkpaymm6iybc7gyir2"))))
    (build-system r-build-system)
    (home-page "https://stat.sfu.ca/statgen/research/stepwise.html")
    (synopsis "Stepwise detection of recombination breakpoints")
    (description
     "This package provides a stepwise approach to identifying recombination
breakpoints in a genomic sequence alignment.")
    (license license:gpl2+)))

(define-public r-snpmaxsel
  (package
    (name "r-snpmaxsel")
    (version "1.0-3")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "SNPmaxsel" version))
       (sha256
        (base32
         "0pjvixwqzjd3jwccc8yqq9c76afvbmfq0z1w0cwyj8bblrjpx13z"))))
    (properties `((upstream-name . "SNPmaxsel")))
    (build-system r-build-system)
    (propagated-inputs
     (list r-combinat r-mvtnorm))
    (home-page "https://cran.r-project.org/web/packages/SNPmaxsel/index.html")
    (synopsis "Maximally selected statistics for SNP data")
    (description
     "This package implements asymptotic methods related to maximally selected
statistics, with applications to @dfn{single-nucleotide polymorphism} (SNP)
data.")
    (license license:gpl2+)))

(define-public r-acsnminer
  (package
    (name "r-acsnminer")
    (version "0.16.8.25")
    (source (origin
              (method url-fetch)
              (uri (cran-uri "ACSNMineR" version))
              (sha256
               (base32
                "0gh604s8qall6zfjlwcg2ilxjvz08dplf9k5g47idhv43scm748l"))))
    (properties `((upstream-name . "ACSNMineR")))
    (build-system r-build-system)
    (propagated-inputs
     (list r-ggplot2 r-gridextra))
    (home-page "https://cran.r-project.org/web/packages/ACSNMineR")
    (synopsis "Gene enrichment analysis")
    (description
     "This package provides tools to compute and represent gene set enrichment
or depletion from your data based on pre-saved maps from the @dfn{Atlas of
Cancer Signalling Networks} (ACSN) or user imported maps.  The gene set
enrichment can be run with hypergeometric test or Fisher exact test, and can
use multiple corrections.  Visualization of data can be done either by
barplots or heatmaps.")
    (license license:gpl2+)))

(define-public r-seqinr
  (package
    (name "r-seqinr")
    (version "4.2-36")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "seqinr" version))
       (sha256
        (base32
         "09dj2k5mi6xylsihnwbmdd8f4qg855gyh7yvz9gamam7j6h646lk"))))
    (build-system r-build-system)
    (propagated-inputs
     (list r-ade4 r-segmented))
    (inputs
     (list zlib))
    (home-page "https://seqinr.r-forge.r-project.org/")
    (synopsis "Biological sequences retrieval and analysis")
    (description
     "This package provides tools for exploratory data analysis and data
visualization of biological sequence (DNA and protein) data.  It also includes
utilities for sequence data management under the ACNUC system.")
    (license license:gpl2+)))

(define-public r-unigd
  (package
    (name "r-unigd")
    (version "0.1.3")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "unigd" version))
       (sha256
        (base32 "1cqa7gvxmf78hwwqbxk1p2jkksajnfzal9wf3jzlrax35ys6mxqx"))))
    (properties
     '((upstream-name . "unigd")))
    (build-system r-build-system)
    (inputs (list cairo fontconfig freetype libpng zlib))
    (propagated-inputs (list r-cpp11 r-systemfonts))
    (native-inputs (list pkg-config
                         r-fontquiver
                         r-knitr
                         r-svglite
                         r-testthat
                         r-xml2))
    (home-page "https://github.com/nx10/unigd")
    (synopsis "Universal graphics device")
    (description
     "This package provides a unified R graphics backend.  Render R graphics
fast and easy to many common file formats.  It provides a thread safe C
interface for asynchronous rendering of R graphics.")
    (license license:gpl2+)))

(define-public r-units
  (package
    (name "r-units")
    (version "0.8-7")
    (source
      (origin
        (method url-fetch)
        (uri (cran-uri "units" version))
        (sha256
          (base32
            "0r3vja9f031ij3k0rjp5j4zw1zmkfnh0s9mhi4amwfjr1dnxpg9q"))))
    (build-system r-build-system)
    (inputs
     (list udunits))
    (propagated-inputs
     (list r-rcpp))
    (native-inputs
     (list r-dplyr
           r-ggplot2
           r-knitr
           r-magrittr
           r-pillar
           r-testthat
           r-vctrs
           r-vdiffr))
    (home-page "https://github.com/r-quantities/units/")
    (synopsis "Measurement Units for R Vectors")
    (description
      "This package provides support for measurement units in R vectors,
matrices and arrays: automatic propagation, conversion, derivation and
simplification of units; raising errors in case of unit incompatibility.  It
is compatible with the @code{POSIXct}, @code{Date} and @code{difftime}
classes.")
    (license license:gpl2)))

(define-public r-udunits2
  (package
    (name "r-udunits2")
    (version "0.13.2.1")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "udunits2" version))
       (sha256
        (base32
         "00prsy8m41v1camcsz94d7gm8qab2mdnwl3x0dyhz4r49b02jm4z"))))
    (properties `((upstream-name . "udunits2")))
    (build-system r-build-system)
    (inputs
     (list udunits))
    (home-page "https://cran.r-project.org/package=udunits2")
    (synopsis "Udunits-2 bindings for R")
    (description
     "This package provides simple bindings to Unidata's udunits library.")
    (license license:gpl2)))

(define-public r-clarabel
  (package
    (name "r-clarabel")
    (version "0.10.1")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "clarabel" version))
       (sha256
        (base32 "075xzmalrfihrc8sd8clvym9skf2m694ki9d0cn8sf5ly44dim14"))))
    (properties
     '((upstream-name . "clarabel")
       (updater-extra-native-inputs . ("r-matrix" "rust"))))
    (build-system r-build-system)
    (arguments
     (list
      #:phases
      #~(modify-phases %standard-phases
          (add-after 'unpack 'set-variables-for-rust
            (lambda _
              (setenv "CC" #$(cc-for-target)))))))
    (native-inputs (list r-knitr r-matrix r-tinytest
                         rust `(,rust "cargo")))
    (home-page "https://oxfordcontrol.github.io/clarabel-r/")
    (synopsis "Interior point conic optimization solver")
    (description
     "This package provides a versatile interior point solver that solves
@dfn{linear programs} (LPs), @dfn{quadratic programs} (QPs), @dfn{second-order
cone programs} (SOCPs), @dfn{semidefinite programs} (SDPs), and problems with
exponential and power cone constraints (@url{https://clarabel.org/stable/}).
For quadratic objectives, unlike interior point solvers based on the standard
@dfn{homogeneous self-dual embedding} (HSDE) model, Clarabel handles quadratic
objective without requiring any epigraphical reformulation of its objective
function.  It can therefore be significantly faster than other HSDE-based
solvers for problems with quadratic objective functions.  Infeasible problems
are detected using using a homogeneous embedding technique.")
    (license license:asl2.0)))

(define-public r-classint
  (package
    (name "r-classint")
    (version "0.4-11")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "classInt" version))
       (sha256
        (base32
         "19nhqmlxirq8h87wj7wxrw8krg0fyp6c68slnv2ir5bzrx26hdld"))))
    (properties `((upstream-name . "classInt")))
    (build-system r-build-system)
    (propagated-inputs
     (list r-class r-e1071 r-kernsmooth))
    (native-inputs
     (list gfortran r-knitr r-tinytest))
    (home-page "https://github.com/r-spatial/classInt/")
    (synopsis "Choose univariate class intervals")
    (description
     "This package provides selected commonly used methods for choosing
univariate class intervals for mapping or other graphics purposes.")
    (license license:gpl2+)))

(define-public r-spdata
  (package
    (name "r-spdata")
    (version "2.3.4")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "spData" version))
       (sha256
        (base32
         "0czsg358127c391fr84pibscvw6q8a7mrvrdf6c0rw718y73353h"))))
    (properties `((upstream-name . "spData")))
    (build-system r-build-system)
    (propagated-inputs
     (list r-sp))
    (home-page "https://github.com/Nowosad/spData")
    (synopsis "Datasets for spatial analysis")
    (description
     "This a package containing diverse spatial datasets for demonstrating,
benchmarking and teaching spatial data analysis.  It includes R data of class
@code{sf}, @code{Spatial}, and @code{nb}.  It also contains data stored in a
range of file formats including GeoJSON, ESRI Shapefile and GeoPackage.  Some
of the datasets are designed to illustrate specific analysis techniques.
@code{cycle_hire()} and @code{cycle_hire_osm()}, for example, are designed to
illustrate point pattern analysis techniques.")
    (license license:cc0)))

(define-public r-learnbayes
  (package
    (name "r-learnbayes")
    (version "2.15.1")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "LearnBayes" version))
       (sha256
        (base32
         "0ch54v2zz2yyyk0lvn5rfikdmyz1qh9j1wk3585wl8v58mc0h4cv"))))
    (properties `((upstream-name . "LearnBayes")))
    (build-system r-build-system)
    (home-page "https://cran.r-project.org/web/packages/LearnBayes")
    (synopsis "Functions for learning Bayesian inference")
    (description
     "This package provides a collection of functions helpful in learning the
basic tenets of Bayesian statistical inference.  It contains functions for
summarizing basic one and two parameter posterior distributions and predictive
distributions.  It contains MCMC algorithms for summarizing posterior
distributions defined by the user.  It also contains functions for regression
models, hierarchical models, Bayesian tests, and illustrations of Gibbs
sampling.")
    (license license:gpl2+)))

(define-public r-deldir
  (package
    (name "r-deldir")
    (version "2.0-4")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "deldir" version))
       (sha256
        (base32
         "0ls69b9yynvsiy6madvzafcb0jdvxw66sin7cinpnw63israq66l"))))
    (build-system r-build-system)
    (native-inputs (list gfortran))
    (home-page "https://cran.r-project.org/web/packages/deldir")
    (synopsis "Delaunay triangulation and Dirichlet (Voronoi) tessellation")
    (description
     "This package provides tools for calculating the Delaunay triangulation
and the Dirichlet or Voronoi tessellation (with respect to the entire plane)
of a planar point set.  It plots triangulations and tessellations in various
ways, clips tessellations to sub-windows, calculates perimeters of
tessellations, and summarizes information about the tiles of the
tessellation.")
    (license license:gpl2+)))

(define-public r-wk
  (package
    (name "r-wk")
    (version "0.9.4")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "wk" version))
       (sha256
        (base32
         "12rlkspg0zavda6jfwcah7gm9fh4x13720m4gvy4xndfm5gxswxr"))))
    (properties
     '((upstream-name . "wk")
       (updater-extra-native-inputs . ("r-tibble" "r-vctrs"))))
    (build-system r-build-system)
    (native-inputs (list r-testthat r-tibble r-vctrs))
    (home-page "https://paleolimbot.github.io/wk/")
    (synopsis "Lightweight well-known geometry parsing")
    (description
     "This package provides a minimal R and C++ API for parsing well-known
binary and well-known text representation of geometries to and from R-native
formats.  Well-known binary is compact and fast to parse; well-known text is
human-readable and is useful for writing tests.  These formats are only useful
in R if the information they contain can be accessed in R, for which
high-performance functions are provided here.")
    (license license:expat)))

(define-public r-s2
  (package
    (name "r-s2")
    (version "1.1.9")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "s2" version))
       (sha256
        (base32
         "0mcvm72p42ksk34hslxl2ksy0972nsn2kvazjadsircbfgzjpkad"))))
    (properties
     '((upstream-name . "s2")
       (updater-extra-inputs . ("abseil-cpp"))
       ;; Avoid a dependency cycle by ignoring r-sf.  As for rgeography, I
       ;; haven't found it on CRAN or Bioconductor.
       (updater-ignored-native-inputs . ("r-sf" "r-rgeography"))))
    (build-system r-build-system)
    (arguments
     (list
      #:phases
      `(modify-phases %standard-phases
         ;; We don't want to convert -lssl to -l:libssl.so.1.1; there is only
         ;; one libssl.so anyway and the -l:* thing breaks linking.
         (add-after 'unpack 'undo-library-versioning
           (lambda _
             (substitute* "configure"
               (("PKG_LIBS_VERSIONED=.*")
                "PKG_LIBS_VERSIONED=\"${PKG_LIBS}\"\n")))))))
    (propagated-inputs
     (list r-rcpp r-wk))
    (inputs
     (list abseil-cpp openssl zlib))
    (native-inputs
     (list pkg-config
           r-bit64
           r-geos
           r-testthat
           r-vctrs))
    (home-page "https://r-spatial.github.io/s2/")
    (synopsis "Spherical geometry operators using the S2 geometry library")
    (description
     "This package provides R bindings for Google's s2 library for geometric
calculations on the sphere.  High-performance constructors and exporters
provide high compatibility with existing spatial packages, transformers
construct new geometries from existing geometries, predicates provide a means
to select geometries based on spatial relationships, and accessors extract
information about geometries.")
    (license license:asl2.0)))

(define-public r-sf
  (package
    (name "r-sf")
    (version "1.0-21")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "sf" version))
       (sha256
        (base32
         "16bf43hdn87r9p488s8fxiczpxlr56scnj0d4xgnp9c7cf18mhkh"))))
    (properties
     ;; We don't have this package
     '((updater-ignored-native-inputs . ("r-geom"))))
    (build-system r-build-system)
    (inputs
     (list curl
           gdal
           geos
           openssh
           openssl
           pcre2
           proj
           sqlite
           zlib))
    (propagated-inputs
     (list r-classint
           r-dbi
           r-magrittr
           r-rcpp
           r-s2
           r-units))
    (native-inputs
     (list pkg-config
           r-blob
           r-dplyr
           r-knitr
           r-maps
           r-raster
           r-rpostgres
           r-rpostgresql
           r-sp
           r-testthat
           r-tibble
           r-tidyr
           r-vctrs))
    (home-page "https://github.com/r-spatial/sf/")
    (synopsis "Simple features for R")
    (description
     "This package provides support for simple features, a standardized way to
encode spatial vector data.  It binds to GDAL for reading and writing data, to
GEOS for geometrical operations, and to PROJ for projection conversions and
datum transformations.")
    ;; Either of these licenses
    (license (list license:gpl2 license:expat))))

(define-public r-sfd
  (package
    (name "r-sfd")
    (version "0.1.0")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "sfd" version))
       (sha256
        (base32 "0zffbjzdzgvz7vj1wn7j7sqmnsvskkn94w7lkjxmaahd62xdh6v3"))))
    (properties `((upstream-name . "sfd")))
    (build-system r-build-system)
    (propagated-inputs (list r-cli r-rlang r-tibble))
    (native-inputs (list r-testthat))
    (home-page "https://cran.r-project.org/package=sfd")
    (synopsis "Space-Filling Design Library")
    (description
     "This package provides a collection of pre-optimized space-filling
designs, for up to ten parameters, is contained here.  Functions are provided
to access designs described by Husslage et al (2011) and Wang and Fang (2005).
The design types included are Audze-Eglais, MaxiMin, and uniform.")
    (license license:expat)))

(define-public r-sfheaders
  (package
    (name "r-sfheaders")
    (version "0.4.4")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "sfheaders" version))
       (sha256
        (base32 "01xxp7lpf333djs0lifnnhk5akv8prk0r5mq0ilynyyhn5kzwpzn"))))
    (properties `((upstream-name . "sfheaders")))
    (build-system r-build-system)
    (propagated-inputs (list r-geometries r-rcpp))
    (native-inputs (list r-testthat))
    (home-page "https://dcooley.github.io/sfheaders/")
    (synopsis "Converts between R objects and Simple Feature objects")
    (description
     "This package converts between R and Simple Feature @code{sf} objects,
without depending on the Simple Feature library.  Conversion functions are
available at both the R level, and through Rcpp.")
    (license license:expat)))

(define-public r-sftime
  (package
    (name "r-sftime")
    (version "0.3.0")
    (source (origin
              (method url-fetch)
              (uri (cran-uri "sftime" version))
              (sha256
               (base32
                "1dypvq8pc86n02hqd7dfbr3h7b90q3y9cf6q8mqqnf7gyvax9bdd"))))
    (properties `((upstream-name . "sftime")))
    (build-system r-build-system)
    (propagated-inputs (list r-sf))
    (native-inputs (list r-knitr))
    (home-page "https://cran.r-project.org/package=sftime")
    (synopsis "Simple feature objects that have a time column")
    (description
     "This package provides classes and methods for spatial objects
that have a registered time column, in particular for irregular
spatiotemporal data.  The @code{time} column can be of any type, but
needs to be ordinal.  Regularly laid out spatiotemporal data (vector
or raster data cubes) are handled by package stars'.")
    (license license:asl2.0)))

(define-public r-spdep
  (package
    (name "r-spdep")
    (version "1.3-11")
    (source (origin
              (method url-fetch)
              (uri (cran-uri "spdep" version))
              (sha256
               (base32
                "1ql5kpmzcjq73lndq7hjf6bcsac71fx8n90ajrap63npjnrxwpd3"))
              (snippet
               '(for-each delete-file '("inst/doc/CO69.html"
                                        "inst/doc/CO69.R"
                                        "inst/doc/nb.html"
                                        "inst/doc/nb.R"
                                        "inst/doc/nb_sf.html"
                                        "inst/doc/nb_sf.R"
                                        "inst/doc/nb_sf.Rmd"
                                        "inst/doc/sids.html"
                                        "inst/doc/sids.R")))))
    (properties
     '((updater-extra-native-inputs . ("r-dbscan"))))
    (build-system r-build-system)
    (propagated-inputs
     (list r-boot
           r-deldir
           r-e1071
           r-s2
           r-sf
           r-sp
           r-spdata
           r-units))
    (native-inputs
     (list r-dbscan r-knitr r-tinytest))
    (home-page "https://github.com/r-spatial/spdep/")
    (synopsis "Spatial dependence: weighting schemes, statistics and models")
    (description
     "This package provides a collection of functions to create spatial
weights matrix objects from polygon contiguities, from point patterns by
distance and tessellations, for summarizing these objects, and for permitting
their use in spatial data analysis, including regional aggregation by minimum
spanning tree.")
    (license license:gpl2+)))

(define-public r-adegenet
  (package
    (name "r-adegenet")
    (version "2.1.11")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "adegenet" version))
       (sha256
        (base32
         "0wb2ryv4irn47c1p6w3w302hhxmh9mrx7djxc1jli86af96xv2pc"))))
    (build-system r-build-system)
    (propagated-inputs
     (list r-ade4
           r-ape
           r-boot
           r-dplyr
           r-ggplot2
           r-igraph
           r-mass
           r-reshape2
           r-seqinr
           r-shiny
           r-vegan))
    (native-inputs (list r-testthat))
    (home-page "https://github.com/thibautjombart/adegenet")
    (synopsis "Exploratory analysis of genetic and genomic data")
    (description
     "This package provides a toolset for the exploration of genetic and
genomic data.  Adegenet provides formal (S4) classes for storing and handling
various genetic data, including genetic markers with varying ploidy and
hierarchical population structure (@code{genind} class), alleles counts by
populations (@code{genpop}), and genome-wide SNP data (@code{genlight}).  It
also implements original multivariate methods (DAPC, sPCA), graphics,
statistical tests, simulation tools, distance and similarity measures, and
several spatial methods.  A range of both empirical and simulated datasets is
also provided to illustrate various methods.")
    (license license:gpl2+)))

(define-public r-pegas
  (package
    (name "r-pegas")
    (version "1.3")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "pegas" version))
       (sha256
        (base32 "1j1xrnwi80ycwziwcsb48sfdm2ifdzgsn8clh0ai7rvhknrb4ghh"))))
    (build-system r-build-system)
    (propagated-inputs
     (list r-ape))
    (home-page "http://ape-package.ird.fr/pegas.html")
    (synopsis "Population and evolutionary genetics analysis system")
    (description
     "This package provides functions for reading, writing, plotting,
analysing, and manipulating allelic and haplotypic data, including from VCF
files, and for the analysis of population nucleotide sequences and
micro-satellites including coalescent analyses, linkage disequilibrium,
population structure (Fst, Amova) and equilibrium (HWE), haplotype networks,
minimum spanning tree and network, and median-joining networks.")
    (license license:gpl2+)))

(define-public r-genetics
  (package
    (name "r-genetics")
    (version "1.3.8.1.3")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "genetics" version))
       (sha256
        (base32
         "0lljxvz7nc6y2z303icphar2niir0i407w5cyhy2pwspd9gwkwpy"))))
    (build-system r-build-system)
    (propagated-inputs
     (list r-combinat r-gdata r-gtools r-mass r-mvtnorm))
    (home-page "https://cran.r-project.org/web/packages/genetics/")
    (synopsis "Population genetics")
    (description
     "This package provides classes and methods for handling genetic data.
It includes classes to represent genotypes and haplotypes at single markers up
to multiple markers on multiple chromosomes.  Function include allele
frequencies, flagging homo/heterozygotes, flagging carriers of certain
alleles, estimating and testing for Hardy-Weinberg disequilibrium, estimating
and testing for linkage disequilibrium, ...")
    ;; Any GPL version.
    (license license:gpl2+)))

(define-public r-snp-plotter
  (package
    (name "r-snp-plotter")
    (version "0.5.1")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "snp.plotter" version))
       (sha256
        (base32
         "16apsqvkah5l0d5qcwp3lq2jspkb6n62wzr0wskmj84jblx483vv"))))
    (properties `((upstream-name . "snp.plotter")))
    (build-system r-build-system)
    (propagated-inputs (list r-genetics))
    (home-page "https://cran.r-project.org/web/packages/snp.plotter/")
    (synopsis "Plot p-values using single SNP and/or haplotype data")
    (description
     "This package helps you create plots of p-values using single SNP and/or
haplotype data.  Main features of the package include options to display a
@dfn{linkage disequilibrium} (LD) plot and the ability to plot multiple
datasets simultaneously.  Plots can be created using global and/or individual
haplotype p-values along with single SNP p-values.  Images are created as
either PDF/EPS files.")
    (license license:gpl2+)))

(define-public r-polspline
  (package
    (name "r-polspline")
    (version "1.1.25")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "polspline" version))
       (sha256
        (base32 "18wv3v76y4xdlrz7qdp6amr0ynhyqbja1rjqmbz0lc12v56gqhr9"))))
    (build-system r-build-system)
    (native-inputs (list gfortran))
    (home-page "https://cran.r-project.org/web/packages/polspline/")
    (synopsis "Polynomial spline routines")
    (description
     "This package provides routines for the polynomial spline fitting
routines hazard regression, hazard estimation with flexible tails, logspline,
lspec, polyclass, and polymars.")
    (license license:gpl2+)))

(define-public r-rms
  (package
    (name "r-rms")
    (version "8.0-0")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "rms" version))
       (sha256
        (base32 "0jk6gjih3n5xk5x94p8fwhphb7zyajf4y8sakfaw0vq0ig94d097"))))
    (build-system r-build-system)
    ;; One test fails with: "duplicated column name in design matrix:X21"
    (arguments (list #:tests? #false))
    (propagated-inputs
     (list r-cluster
           r-colorspace
           r-digest
           r-ggplot2
           r-hmisc
           r-htmltable
           r-htmltools
           r-knitr
           r-mass
           r-matrix
           r-multcomp
           r-nlme
           r-polspline
           r-quantreg
           r-rpart
           r-scales
           r-sparsem
           r-survival))
    (native-inputs (list gfortran))
    (home-page "http://biostat.mc.vanderbilt.edu/rms")
    (synopsis "Regression modeling strategies")
    (description
     "This is a package for regression modeling, testing, estimation,
validation, graphics, prediction, and typesetting by storing enhanced model
design attributes in the fit.  The rms package is a collection of functions
that assist with and streamline modeling.  It also contains functions for
binary and ordinal logistic regression models, ordinal models for continuous Y
with a variety of distribution families, and the Buckley-James multiple
regression model for right-censored responses, and implements penalized
maximum likelihood estimation for logistic and ordinary linear models.  The
package works with almost any regression model, but it was especially written
to work with binary or ordinal regression models, Cox regression, accelerated
failure time models, ordinary linear models, the Buckley-James model,
generalized least squares for serially or spatially correlated observations,
generalized linear models, and quantile regression.")
    (license license:gpl2+)))

(define-public r-arsenal
  (package
    (name "r-arsenal")
    (version "3.6.3")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "arsenal" version))
       (sha256
        (base32
         "0qvs3ld28djnjnggdhqjwq8sbv8zz322qahlvf7dnx35yqf6xkms"))))
    (properties
     '((upstream-name . "arsenal")
       (updater-extra-native-inputs . ("r-geepack" "r-proc"))))
    (build-system r-build-system)
    (propagated-inputs (list r-knitr))
    (native-inputs (list r-broom r-geepack r-knitr r-proc r-testthat))
    (home-page "https://github.com/mayoverse/arsenal")
    (synopsis "Functions for large-scale statistical summaries")
    (description
     "This package provides an arsenal of R functions for large-scale
statistical summaries, which are streamlined to work within the latest
reporting tools in R and RStudio and which use formulas and versatile
summary statistics for summary tables and models.  The primary functions
include

@enumerate
@item @code{tableby}, a Table-1-like summary of multiple variable types by the
  levels of one or more categorical variables;
@item @code{paired}, a Table-1-like summary of multiple variable types paired
  across two time points;
@item @code{modelsum}, which performs simple model fits on one or more
  endpoints for many variables (univariate or adjusted for covariates);
@item @code{freqlist}, a powerful frequency table across many categorical
  variables;
@item @code{comparedf}, a function for comparing @code{data.frames}; and
@item @code{write2}, a function to output tables to a document.
@end enumerate
")
    (license license:gpl2+)))

(define-public r-haplo-stats
  (package
    (name "r-haplo-stats")
    (version "1.9.7")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "haplo.stats" version))
       (sha256
        (base32
         "1h6r6ddhff75n9brh1pxpqc0s7xn36ly1c3nhlnjipy0k77kxdrg"))))
    (properties `((upstream-name . "haplo.stats")))
    (build-system r-build-system)
    (arguments
     (list
      #:phases
      ;; Needed by r-r-rsp.
      '(modify-phases %standard-phases
         (add-after 'unpack 'set-HOME
           (lambda _ (setenv "HOME" "/tmp"))))))
    (propagated-inputs
     (list r-arsenal r-rms))
    (native-inputs
     (list r-r-rsp r-testthat)) ; for vignettes
    (home-page "https://www.mayo.edu/research/labs/statistical-genetics-genetic-epidemiology/software")
    (synopsis "Analysis of haplotypes when linkage phase is ambiguous")
    (description
     "This package provides routines for the analysis of indirectly measured
haplotypes.  The statistical methods assume that all subjects are unrelated
and that haplotypes are ambiguous (due to unknown linkage phase of the genetic
markers).  The main functions are: @code{haplo.em()}, @code{haplo.glm()},
@code{haplo.score()}, and @code{haplo.power()}; all of which have detailed
examples in the vignette.")
    (license license:gpl2+)))

(define-public r-bqtl
  (package
    (name "r-bqtl")
    (version "1.0-38")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "bqtl" version))
       (sha256
        (base32
         "1859z3wpb9w1lyx6gl01mgp3xwjd2df0xadbc0c4g00y14z5g8vr"))))
    (build-system r-build-system)
    (native-inputs (list gfortran))
    (home-page "http://famprevmed.ucsd.edu/faculty/cberry/bqtl/")
    (synopsis "Bayesian QTL mapping toolkit")
    (description
     "This is a QTL mapping toolkit for inbred crosses and recombinant inbred
lines.  It includes maximum likelihood and Bayesian tools.")
    (license license:gpl2+)))

(define-public r-ibdreg
  (package
    (name "r-ibdreg")
    (version "0.3.8")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "ibdreg" version))
       (sha256
        (base32
         "0c4svyfd7xjx9k6pl40l7y9rc67zschs0nz1l386xi1m7arsp44n"))))
    (build-system r-build-system)
    (home-page "https://www.mayo.edu/research/labs/\
statistical-genetics-genetic-epidemiology/software")
    (synopsis "Regression methods for IBD linkage with covariates")
    (description
     "This package provides a method to test genetic linkage with covariates
by regression methods with response IBD sharing for relative pairs.  Account
for correlations of IBD statistics and covariates for relative pairs within
the same pedigree.")
    (license license:gpl2+)))

(define-public r-dlmap
  (package
    (name "r-dlmap")
    (version "1.13")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "dlmap" version))
       (sha256
        (base32
         "0s6wlkggkm3qndwyvw72xv1n0mcjb7ss3ajbq2ll6rv30splq0db"))))
    (build-system r-build-system)
    (propagated-inputs
     (list r-ibdreg r-mgcv r-nlme r-qtl r-wgaim))
    (home-page "https://cran.r-project.org/web/packages/dlmap/")
    (synopsis "Detection localization mapping for QTL")
    (description
     "This is package for QTL mapping in a mixed model framework with separate
detection and localization stages.  The first stage detects the number of QTL
on each chromosome based on the genetic variation due to grouped markers on
the chromosome; the second stage uses this information to determine the most
likely QTL positions.  The mixed model can accommodate general fixed and
random effects, including spatial effects in field trials and pedigree
effects.  It is applicable to backcrosses, doubled haploids, recombinant
inbred lines, F2 intercrosses, and association mapping populations.")
    (license license:gpl2)))

(define-public r-hwde
  (package
    (name "r-hwde")
    (version "0.67-3")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "hwde" version))
       (sha256
        (base32
         "0kj3vf4pmcvxy95hx1d0q6c626y8d0ljj3r76y5hd90a6v75b5xa"))))
    (build-system r-build-system)
    (home-page "https://cran.r-project.org/web/packages/hwde/")
    (synopsis "Models and tests for departure from Hardy-Weinberg equilibrium")
    (description
     "This package fits models for genotypic disequilibria, as described in
Huttley and Wilson (2000), Weir (1996) and Weir and Wilson (1986).  Contrast
terms are available that account for first order interactions between loci.
It also implements, for a single locus in a single population, a conditional
exact test for Hardy-Weinberg equilibrium.")
    (license license:gpl2+)))

(define-public r-tdthap
  (package
    (name "r-tdthap")
    (version "1.3")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "tdthap" version))
       (sha256
        (base32
         "05yj7jwwd0q2yk8gpp44fhh3sknvw3g6p9glj6z6rz46p9xf31kr"))))
    (build-system r-build-system)
    (arguments
     (list
      #:phases
      '(modify-phases %standard-phases
         (add-after 'unpack 'compatibility
           (lambda _
             ;; ".path.package" is obsolete.
             (substitute* "inst/tests/test.R"
               (("# Read a pedfile" m)
                (string-append "library(tdthap)\n" m))
               (("\\.path.package") "path.package")))))))
    (home-page "https://cran.r-project.org/web/packages/tdthap/")
    (synopsis "TDT tests for extended haplotypes")
    (description
     "Functions and examples are provided for transmission/disequilibrium
tests for extended marker haplotypes, as in Clayton, D. and Jones, H. (1999)
\"Transmission/disequilibrium tests for extended marker haplotypes\".")
    (license license:artistic2.0)))

(define-public r-sparql
  (package
    (name "r-sparql")
    (version "1.16")
    (source (origin
              (method url-fetch)
              (uri (cran-uri "SPARQL" version))
              (sha256
               (base32
                "0gak1q06yyhdmcxb2n3v0h9gr1vqd0viqji52wpw211qp6r6dcrc"))))
    (properties `((upstream-name . "SPARQL")))
    (build-system r-build-system)
    (propagated-inputs
     (list r-rcurl r-xml))
    (home-page "https://cran.r-project.org/web/packages/SPARQL")
    (synopsis "SPARQL client for R")
    (description "This package provides an interface to use SPARQL to pose
SELECT or UPDATE queries to an end-point.")
    ;; The only license indication is found in the DESCRIPTION file,
    ;; which states GPL-3.  So we cannot assume GPLv3+.
    (license license:gpl3)))

(define-public r-bookdown
  (package
    (name "r-bookdown")
    (version "0.43")
    (source (origin
              (method url-fetch)
              (uri (cran-uri "bookdown" version))
              (sha256
               (base32
                "1q0bzwzn9diqa511c58dlz2ipw5j898z8ig28n9d5k5hg9y206li"))
              ;; TODO: there is one more file to replace:
              ;; inst/resources/gitbook/js/app.min.js
              (snippet
               '(for-each delete-file
                          '("inst/resources/gitbook/js/clipboard.min.js"
                            "inst/resources/gitbook/js/lunr.js"
                            "inst/resources/mathquill/mathquill.min.js")))))
    (properties
     `((upstream-name . "bookdown")
       ;; We cannot add knitr because this package depends on xfun, which is
       ;; an input to knitr.
       (updater-ignored-native-inputs . ("r-knitr"))))
    (build-system r-build-system)
    (arguments
     (list
      #:modules '((guix build r-build-system)
                  (guix build minify-build-system)
                  (guix build utils)
                  (ice-9 match))
      #:imported-modules `(,@%r-build-system-modules
                           (guix build minify-build-system))
      #:phases
      #~(modify-phases (@ (guix build r-build-system) %standard-phases)
          (add-after 'unpack 'process-javascript
            (lambda* (#:key inputs #:allow-other-keys)
              (with-directory-excursion "inst/resources"
                (invoke "tar" "-xf" (assoc-ref inputs "js-mathquill")
                        "-C" "/tmp" "--strip-components=2")
                (for-each (match-lambda
                            ((source . target)
                             (minify source #:target target)))
                          `((,(search-input-file inputs "/dist/clipboard.js")
                             . "gitbook/js/clipboard.min.js")
                            (,(search-input-file inputs "/lunr.js")
                             . "gitbook/js/lunr.js")
                            ("/tmp/mathquill.js"
                             . "mathquill/mathquill.min.js")))))))))
    (propagated-inputs
     (list r-htmltools
           r-jquerylib
           r-knitr
           r-rmarkdown
           r-tinytex
           r-xfun
           r-yaml
           pandoc))
    (native-inputs
     `(("esbuild" ,esbuild)
       ("js-clipboard"
        ,(let ((version "2.0.4"))
           (origin
             (method git-fetch)
             (uri (git-reference
                   (url "https://github.com/zenorocha/clipboard.js")
                   (commit (string-append "v" version))))
             (file-name (git-file-name "clipboard.js" version))
             (sha256
              (base32
               "02zzirnddf4kcqdiqb2i7a7yki3rwgscca388qhy3namkw793x4z")))))
       ("js-lunarjs"
        ,(let ((version "0.5.12"))
           (origin
             (method git-fetch)
             (uri (git-reference
                   (url "https://github.com/olivernn/lunr.js")
                   (commit (string-append "v" version))))
             (file-name (git-file-name "lunr.js" version))
             (sha256
              (base32
               "1xwdymcnc75b22bb95hq7ijcf7agf47g2fnqzzj09aihx2c5r430")))))
       ("js-mathquill"
        ,(origin
           (method url-fetch)
           (uri "https://github.com/mathquill/mathquill/\
releases/download/v0.10.1/mathquill-0.10.1.tgz")
           (sha256
            (base32
             "1159l2fi7k3wyclp0pksc0qng291glb8qpa67bvcxwyb9dfiwav7"))))
       ("r-jsonlite" ,r-jsonlite)
       ("r-testit" ,r-testit)
       ("r-testthat" ,r-testthat)
       ("r-withr" ,r-withr)
       ("r-xml2" ,r-xml2)))
    (home-page "https://github.com/rstudio/bookdown")
    (synopsis "Authoring books and technical documents with R markdown")
    (description "This package provides output formats and utilities for
authoring books and technical documents with R Markdown.")
    (license license:gpl3)))

(define-public r-optimparallel
  (package
    (name "r-optimparallel")
    (version "1.0-2")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "optimParallel" version))
       (sha256
        (base32 "178ayfaivkbxkghxbg97lx4gl27kxkmgaaw9y8q5206r4cncd6qg"))))
    (properties `((upstream-name . "optimParallel")))
    (build-system r-build-system)
    (arguments
     (list
      #:phases '(modify-phases %standard-phases
                  (add-after 'unpack 'set-HOME
                    (lambda _
                      (setenv "HOME" "/tmp"))))))
    (native-inputs (list r-numderiv r-r-rsp r-testthat))
    (home-page "https://github.com/florafauna/optimParallel-R")
    (synopsis "Parallel version of the L-BFGS-B optimization method")
    (description
     "This tool provides a parallel version of the L-BFGS-B method of
@code{optim()}.  The main function of the package is @code{optimParallel()},
which has the same usage and output as @code{optim()}.  Using
@code{optimParallel()} can significantly reduce the optimization time.")
    (license license:gpl2+)))

(define-public r-options
  (package
    (name "r-options")
    (version "0.3.1")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "options" version))
       (sha256
        (base32 "1n0xy433plxqgqy3s3gdvxxvzw8hxzqzwi56y61hrg4dqvaamd21"))))
    (properties `((upstream-name . "options")))
    (build-system r-build-system)
    (arguments
     (list
      #:phases
      '(modify-phases %standard-phases
         (add-after 'unpack 'disable-bad-tests
           (lambda _
             ;; One test produces an unexpected warning.
             (substitute* "tests/testthat/test-rcmdcheck.R"
               ((".*Packages that use options pass R CMD check.*" m)
                (string-append m "skip('skip');\n"))))))))
    (native-inputs (list r-knitr r-pkgload r-rcmdcheck r-testthat r-withr))
    (home-page "https://dgkf.github.io/options/")
    (synopsis "Simple, consistent package options")
    (description
     "This package provides simple mechanisms for defining and interpreting
package options.  It provides helpers for interpreting environment variables,
global options, defining default values and more.")
    (license license:expat)))

(define-public r-optparse
  (package
    (name "r-optparse")
    (version "1.7.5")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "optparse" version))
       (sha256
        (base32
         "04jp85jik1zkbb08w44m2h0hqyzd80w4pjnfp1lnwy40ax81gj8c"))))
    (properties
     '((updater-extra-native-inputs . ("r-stringr"))))
    (build-system r-build-system)
    (propagated-inputs
     (list r-getopt))
    (native-inputs
     (list r-knitr r-stringr r-testthat))
    (home-page "https://github.com/trevorld/optparse")
    (synopsis "Command line option parser")
    (description
     "This package provides a command line parser inspired by Python's
@code{optparse} library to be used with Rscript to write shebang scripts
that accept short and long options.")
    (license license:gpl2+)))

(define-public r-osqp
  (package
    (name "r-osqp")
    (version "0.6.3.3")
    (source (origin
              (method url-fetch)
              (uri (cran-uri "osqp" version))
              (sha256
               (base32
                "1fzmw813iab07vnc714zyaszbnsagbmba7j69la36hvnqx78wggz"))))
    (properties
     '((upstream-name . "osqp")
       (updater-extra-native-inputs . ("r-slam"))))
    (build-system r-build-system)
    (propagated-inputs (list r-matrix r-r6 r-rcpp))
    (native-inputs (list r-slam r-testthat))
    (home-page "https://osqp.org")
    (synopsis "Quadratic Programming Solver using the OSQP Library")
    (description
     "This package provides bindings to the OSQP solver.  The OSQP
solver is a numerical optimization package or solving convex quadratic
programs written in C and based on the alternating direction method of
multipliers.  See <arXiv:1711.08013> for details.")
    (license (list license:asl2.0))))

(define-public r-kernlab
  (package
    (name "r-kernlab")
    (version "0.9-33")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "kernlab" version))
       (sha256
        (base32 "0q9hvnams1cjjrx7hny0sjszqqg837pgn642nsdwhqipdmypih3h"))))
    (build-system r-build-system)
    (home-page "https://cran.r-project.org/web/packages/kernlab")
    (synopsis "Kernel-based machine learning tools")
    (description
     "This package provides kernel-based machine learning methods for
classification, regression, clustering, novelty detection, quantile regression
and dimensionality reduction.  Among other methods @code{kernlab} includes
Support Vector Machines, Spectral Clustering, Kernel PCA, Gaussian Processes
and a QP solver.")
    (license license:gpl2)))

(define-public r-kernsmooth
  (package
    (name "r-kernsmooth")
    (version "2.23-26")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "KernSmooth" version))
       (sha256
        (base32
         "0gm79nfaypvpxg7j9jdi6k0w5dyi0fp14m32grwalzvz36nbsrdl"))))
    (properties `((upstream-name . "KernSmooth")))
    (build-system r-build-system)
    (native-inputs
     (list gfortran))
    (home-page "https://cran.r-project.org/web/packages/KernSmooth")
    (synopsis "Functions for kernel smoothing")
    (description
     "This package provides functions for kernel smoothing (and density
estimation) corresponding to the book: Wand, M.P. and Jones, M.C. (1995)
\"Kernel Smoothing\".")
    ;; Unlimited use and distribution
    (license (license:non-copyleft "file://LICENCE.note"))))

(define-public r-hierfstat
  (package
    (name "r-hierfstat")
    (version "0.5-11")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "hierfstat" version))
       (sha256
        (base32
         "0nyb5091lr8ma9vydbssyx9503601rynlrbldv98mmrmh74h6v41"))))
    (build-system r-build-system)
    (propagated-inputs
     (list r-ade4 r-adegenet r-gaston r-gtools))
    (native-inputs
     (list r-knitr r-testthat))
    (home-page "https://cran.r-project.org/web/packages/hierfstat/")
    (synopsis "Estimation and tests of hierarchical F-statistics")
    (description
     "This package allows the estimation of hierarchical F-statistics from
haploid or diploid genetic data with any numbers of levels in the hierarchy,
following the algorithm of Yang (Evolution, 1998, 52(4):950-956).  Functions
are also given to test via randomisations the significance of each F and
variance components, using the likelihood-ratio statistics G.")
    (license license:gpl2+)))

(define-public r-hapassoc
  (package
    (name "r-hapassoc")
    (version "1.2-9")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "hapassoc" version))
       (sha256
        (base32
         "09ijc4sbw743z74fzklmvig11ndkycg6j86k4214wfsj1yj6j9x6"))))
    (build-system r-build-system)
    (home-page "https://stat.sfu.ca/statgen/research/hapassoc.html")
    (synopsis "Inference of trait associations with SNP haplotypes")
    (description
     "Hapassoc performs likelihood inference of trait associations with
haplotypes and other covariates in @dfn{generalized linear models} (GLMs).
The functions are developed primarily for data collected in cohort or
cross-sectional studies.  They can accommodate uncertain haplotype phase and
handle missing genotypes at some SNPs.")
    (license license:gpl2)))

(define-public r-sampling
  (package
    (name "r-sampling")
    (version "2.10")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "sampling" version))
       (sha256
        (base32
         "0x976wblv663aidqmcif1rjv72nbxf4nzms901lmryxbq1p9gv7x"))))
    (build-system r-build-system)
    (propagated-inputs
     (list r-lpsolve r-mass))
    (home-page "https://cran.r-project.org/web/packages/sampling/")
    (synopsis "Survey sampling")
    (description
     "This package provides functions for drawing and calibrating samples.")
    (license license:gpl2+)))

(define-public r-r2html
  (package
    (name "r-r2html")
    (version "2.3.4")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "R2HTML" version))
       (sha256
        (base32
         "1a8yy9xf5gdh3s2rzmv5b28hhdqc5g34hygcrxn8drs0i2j97vdr"))))
    (properties `((upstream-name . "R2HTML")))
    (build-system r-build-system)
    (home-page "https://github.com/nalimilan/R2HTML")
    (synopsis "HTML export for R objects")
    (description
     "This package includes HTML functions and methods to write in an HTML
file.  Thus, making HTML reports is easy.  It includes a function that allows
redirection on the fly, which appears to be very useful for teaching purposes,
as the student can keep a copy of the produced output to keep all that they
did during the course.  The package comes with a vignette describing how to
write HTML reports for statistical analysis.  Finally, a driver for Sweave
parses HTML flat files containing R code and to automatically write
the corresponding outputs (tables and graphs).")
    (license license:gpl2+)))

(define-public r-rjava
  (package
    (name "r-rjava")
    (version "1.0-11")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "rJava" version))
       (sha256
        (base32
         "05v4k0vzv1yx80b5dgmp6l7q3w64cr3k5a29hvggg1ixapswr84y"))))
    (properties `((upstream-name . "rJava")))
    (build-system r-build-system)
    (arguments
     (list
      #:phases
      #~(modify-phases %standard-phases
          (add-after 'unpack 'set-JAVA_HOME
            (lambda* (#:key inputs #:allow-other-keys)
              (let ((jdk (assoc-ref inputs "jdk")))
                (setenv "JAVA_HOME" jdk)
                (setenv "JAVA" (which "java"))
                (setenv "JAR" (which "jar"))
                (setenv "JAVAC" (which "javac"))
                (setenv "JAVAH" (which "javah"))
                (setenv "JAVA_CPPFLAGS"
                        (string-append "-I" jdk "/include "
                                       "-I" jdk "/include/linux"))
                (setenv "JAVA_LIBS" (search-input-file inputs "/lib/libjvm.so"))))))))
    (inputs
     `(("icu4c" ,icu4c)
       ("libdeflate" ,libdeflate)
       ("jdk" ,openjdk11 "jdk")
       ("zlib" ,zlib)))
    (home-page "https://www.rforge.net/rJava/")
    (synopsis "Low-Level R to Java interface")
    (description
     "This package provides a low-level interface to the Java VM very much
like .C/.Call and friends.  It allows the creation of objects, calling methods
and accessing fields.")
    (license license:gpl2)))

(define-public r-svmisc
  (package
    (name "r-svmisc")
    (version "1.4.3")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "svMisc" version))
       (sha256
        (base32
         "0sjqc3bxah1a0zmsyla0pnbpsjzpzqsphpiy9j42fh7bj8qg6z3k"))))
    (properties `((upstream-name . "svMisc")))
    (build-system r-build-system)
    (native-inputs
     (list r-knitr r-testthat))
    (home-page "https://github.com/SciViews/svMisc")
    (synopsis "Miscellaneous functions for SciViews")
    (description
     "This package provides miscellaneous functions for SciViews or general
use, including tools to manage a temporary environment attached to the search
path for temporary variables you do not want to @code{save()} or
@code{load()}; test the current platform; showing progress bars, etc.")
    (license license:gpl2)))

(define-public r-xyz
  (package
    (name "r-xyz")
    (version "0.2")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "xyz" version))
       (sha256
        (base32
         "13w4sb4pvgciwr8wsz785dafj2k2kpx7znz46r5d32wx88vkycp4"))))
    (build-system r-build-system)
    (propagated-inputs
     (list r-rcpp))
    (home-page "https://cran.r-project.org/web/packages/xyz/")
    (synopsis "Algorithm for fast interaction search in high-dimensional data")
    (description
     "High dimensional interaction search by brute force requires a quadratic
computational cost in the number of variables.  The xyz algorithm provably
finds strong interactions in almost linear time.  For details of the algorithm
see: G. Thanei, N. Meinshausen and R. Shah (2016).  The xyz algorithm for fast
interaction search in high-dimensional data.")
    ;; Any version of the GPL.
    (license license:gpl2+)))

(define-public r-rttf2pt1
  (package
    (name "r-rttf2pt1")
    (version "1.3.12")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "Rttf2pt1" version))
       (sha256
        (base32
         "10x580dnzddm9z045gya5ya01d10s9mpp0fy8ilrldlh74q7ljqb"))))
    (properties `((upstream-name . "Rttf2pt1")))
    (build-system r-build-system)
    (home-page "https://github.com/wch/Rttf2pt1")
    (synopsis "Font conversion utility")
    (description
     "This package contains the program @code{ttf2pt1}, for use with the
@code{extrafont} package.")
    ;; Most of the files are covered under the Expat license.  Some files are
    ;; covered under BSD-3.  Deviations for individual files are recorded in
    ;; the LICENSE file.
    (license (list license:bsd-3 license:expat
                   (license:non-copyleft "file://LICENSE")))))

(define-public r-extrafontdb
  (package
    (name "r-extrafontdb")
    (version "1.0")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "extrafontdb" version))
       (sha256
        (base32
         "115n42hfvv5h4nn4cfkfmkmn968py4lpy8zd0d6w5yylwpzbm8gs"))))
    (build-system r-build-system)
    (home-page "https://github.com/wch/extrafontdb")
    (synopsis "Database for the extrafont package")
    (description
     "This package holds the database for the @code{extrafont} package.")
    (license license:gpl2)))

(define-public r-extrafont
  (package
    (name "r-extrafont")
    (version "0.19")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "extrafont" version))
       (sha256
        (base32
         "13dbrlf54nbyfz3z2snz7x4m6rfnnhk2l8kkwpgcagzi5lar13sf"))))
    (build-system r-build-system)
    (propagated-inputs
     (list r-extrafontdb r-rttf2pt1))
    (home-page "https://github.com/wch/extrafont")
    (synopsis "Tools for using fonts in R")
    (description
     "The extrafont package makes it easier to use fonts other than the basic
PostScript fonts that R uses.  Fonts that are imported into extrafont can be
used with PDF or PostScript output files.  There are two hurdles for using
fonts in PDF (or Postscript) output files:

@enumerate
@item Making R aware of the font and the dimensions of the characters.
@item Embedding the fonts in the PDF file so that the PDF can be displayed
  properly on a device that doesn't have the font.  This is usually needed if
  you want to print the PDF file or share it with others.
@end enumerate

The extrafont package makes both of these things easier.")
    (license license:gpl2)))

(define-public r-xkcd
  (package
    (name "r-xkcd")
    (version "0.0.6")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "xkcd" version))
       (sha256
        (base32
         "1z2y0ihn68ppay7xkglhw7djki5654g6z4bbpyy41if57z9q554f"))))
    (build-system r-build-system)
    (propagated-inputs
     (list r-extrafont r-ggplot2 r-hmisc))
    (home-page "https://cran.r-project.org/web/packages/xkcd/")
    (synopsis "Plot ggplot2 graphics in the XKCD style")
    (description
     "This package provides the means to plot ggplot2 graphs in the style of
the XKCD web comic.")
    (license license:gpl3)))

(define-public r-babelgene
  (package
    (name "r-babelgene")
    (version "22.9")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "babelgene" version))
       (sha256
        (base32
         "1ql5r1chl5ajzy9ppcnk755ia3m2a8n08m837dnm2ll3nzf02rnf"))))
    (properties `((upstream-name . "babelgene")))
    (build-system r-build-system)
    (propagated-inputs
     (list r-dplyr r-rlang))
    (native-inputs
     (list r-knitr r-testthat))
    (home-page
     "https://igordot.github.io/babelgene/")
    (synopsis "Gene orthologs for model organisms in a Tidy data format")
    (description
     "Genomic analysis of model organisms often requires the use of databases
based on human data or making comparisons to patient-derived resources.  This
requires converting genes between human and non-human analogues.  The
babelgene R package provides predicted gene orthologs/homologs for frequently
studied model organisms in an R-friendly tidy/long format.  The package
integrates orthology assertion predictions sourced from multiple databases as
compiled by the HGNC Comparison of Orthology Predictions (HCOP).")
    (license license:expat)))

(define-public r-msigdbr
  (package
    (name "r-msigdbr")
    (version "24.1.0")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "msigdbr" version))
       (sha256
        (base32
         "0rii1fmwg09in67s2f6cw482093n320703si6ksjjlda5d8p0i1a"))))
    (build-system r-build-system)
    (arguments
     (list
      #:phases
      '(modify-phases %standard-phases
         (add-after 'unpack 'disable-bad-tests
           (lambda _
             ;; These tests attempt to download a data file.
             (substitute* "tests/testthat/test-msigdbr-collections.R"
               ((".*msigdbr_collections\\(\\).*" m)
                (string-append m "skip('skip');\n")))
             (substitute* "tests/testthat/test-msigdbr.R"
               ((".*collections and subcollections.*" m)
                (string-append m "skip('skip');\n"))
               ((".*msigdbr\\(\\) subcollection partial match.*" m)
                (string-append m "skip('skip');\n"))
               ((".*deprecated parameters.*" m)
                (string-append m "skip('skip');\n"))
               ((".*species.*" m)
                (string-append m "skip('skip');\n"))))))))
    (propagated-inputs
     (list r-assertthat
           r-babelgene
           r-curl
           r-dplyr
           r-lifecycle
           r-rlang
           r-tibble
           r-tidyselect))
    (native-inputs
     (list r-testthat))
    (home-page "https://github.com/igordot/msigdbr")
    (synopsis "MSigDB gene sets for multiple organisms")
    (description
     "This package provides the @dfn{Molecular Signatures Database} (MSigDB)
gene sets typically used with the @dfn{Gene Set Enrichment Analysis} (GSEA)
software in a standard R data frame with key-value pairs.  Included are the
original human gene symbols and Entrez IDs as well as the equivalents for
various frequently studied model organisms such as mouse, rat, pig, fly, and
yeast.")
    ;; The package is covered under the Expat license, but the upstream MSigDB
    ;; files are made available under the Creative Commons Attribution 4.0
    ;; International license.
    (license (list license:expat license:cc-by4.0))))

(define-public r-gridgraphics
  (package
    (name "r-gridgraphics")
    (version "0.5-1")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "gridGraphics" version))
       (sha256
        (base32
         "12yswy02j3h5wir7m5jnkhpjmb0sa4snn61vjd68i49qwsa6w219"))))
    (properties `((upstream-name . "gridGraphics")))
    (build-system r-build-system)
    (home-page "https://github.com/pmur002/gridgraphics")
    (synopsis "Redraw base graphics using @code{grid} graphics")
    (description
     "This package provides functions to convert a page of plots drawn with
the @code{graphics} package into identical output drawn with the @code{grid}
package.  The result looks like the original @code{graphics}-based plot, but
consists of @code{grid} grobs and viewports that can then be manipulated with
@code{grid} functions (e.g., edit grobs and revisit viewports).")
    (license license:gpl2+)))

(define-public r-farver
  (package
    (name "r-farver")
    (version "2.1.2")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "farver" version))
       (sha256
        (base32
         "09gy2wmm3jp2k3q6zbmjl6z55a974221q7vi6xhmdd5abnwj722j"))))
    (build-system r-build-system)
    (native-inputs (list r-testthat))
    (home-page "https://github.com/thomasp85/farver")
    (synopsis "Vectorized color conversion and comparison")
    (description
     "The encoding of color can be handled in many different ways, using
different color spaces.  As different color spaces have different uses,
efficient conversion between these representations are important.  This
package provides a set of functions that gives access to very fast color space
conversion and comparisons implemented in C++, and offers 100-fold speed
improvements over the @code{convertColor} function in the @code{grDevices}
package.")
    (license license:expat)))

(define-public r-yaml
  (package
    (name "r-yaml")
    (version "2.3.10")
    (source (origin
              (method url-fetch)
              (uri (cran-uri "yaml" version))
              (sha256
               (base32
                "0v9al1fh82vpjhml91j73sim7gfyc0154kxaam41sdkf6qnx8dp2"))))
    (build-system r-build-system)
    (native-inputs (list r-runit))
    (home-page "https://cran.r-project.org/web/packages/yaml/")
    (synopsis "Methods to convert R data to YAML and back")
    (description
     "This package implements the libyaml YAML 1.1 parser and
emitter (@url{http://pyyaml.org/wiki/LibYAML}) for R.")
    (license license:bsd-3)))

(define-public r-yulab-utils
  (package
    (name "r-yulab-utils")
    (version "0.2.0")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "yulab.utils" version))
       (sha256
        (base32
         "0sjx22vpzm8xhfr955v5i8xssc22slykqqcy5y7dd7j3n7pyp777"))))
    (properties `((upstream-name . "yulab.utils")))
    (build-system r-build-system)
    (propagated-inputs
     (list r-cli r-digest r-fs r-rlang))
    (home-page "https://cran.r-project.org/package=yulab.utils")
    (synopsis "Supporting functions for packages maintained by YuLab-SMU")
    (description
     "Miscellaneous functions commonly used by YuLab-SMU, such as
@code{install_zip_gh} to install R packages from Github ZIP files.")
    (license license:artistic2.0)))

(define-public r-ggplotify
  (package
    (name "r-ggplotify")
    (version "0.1.2")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "ggplotify" version))
       (sha256
        (base32
         "11qfk4pj0bb013m9964q2fsrj4x39c4kwh84vfyi3qhlkrsybfh1"))))
    (build-system r-build-system)
    (propagated-inputs
     (list r-ggplot2 r-gridgraphics r-yulab-utils))
    (native-inputs
     (list r-knitr))
    (home-page "https://github.com/GuangchuangYu/ggplotify")
    (synopsis "Convert plots to @code{grob} or @code{ggplot} object")
    (description
     "This package provides tools to convert plot function calls (using
expression or formula) to @code{grob} or @code{ggplot} objects that are
compatible with the @code{grid} and @code{ggplot2} environment.  With this
package, we are able to e.g. use @code{cowplot} to align plots produced by
@code{base} graphics, @code{grid}, @code{lattice}, @code{vcd} etc. by
converting them to @code{ggplot} objects.")
    (license license:artistic2.0)))

(define-public r-triebeard
  (package
    (name "r-triebeard")
    (version "0.4.1")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "triebeard" version))
       (sha256
        (base32
         "1xz0xwq9c986as6g7z2g1ycvw1ryh4g89ygldvakpr21cgpjybqr"))))
    (build-system r-build-system)
    (propagated-inputs (list r-rcpp))
    (native-inputs (list r-knitr r-testthat))
    (home-page "https://github.com/Ironholds/triebeard/")
    (synopsis "Radix trees in Rcpp")
    (description
     "Radix trees, or tries, are key-value data structures optimized for
efficient lookups, similar in purpose to hash tables.  This package provides
an implementation of radix trees for use in R programming and in developing
packages with Rcpp.")
    (license license:expat)))

(define-public r-tweenr
  (package
    (name "r-tweenr")
    (version "2.0.3")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "tweenr" version))
       (sha256
        (base32
         "1glc7ks5yymcm4pi0fjpi1zh7m5d4cz7zy20pa3kfraxlh9fbazg"))))
    (build-system r-build-system)
    (arguments
     (list
      #:phases
      '(modify-phases %standard-phases
         (add-after 'unpack 'build-reproducibly
           (lambda _
             (substitute* "R/aaa.R"
               (("BASEDATETIME <- Sys.time.*")
                "BASEDATETIME <- structure(0, class = c(\"POSIXct\", \"POSIXt\"))\n")))))))
    (propagated-inputs
     (list r-cpp11 r-farver r-magrittr r-rlang r-vctrs))
    (native-inputs (list r-testthat))
    (home-page "https://github.com/thomasp85/tweenr")
    (synopsis "Interpolate data for smooth animations")
    (description
     "In order to create smooth animation between states of data, tweening is
necessary.  This package provides a range of functions for creating tweened
data that can be used as basis for animation.  Furthermore it adds a number of
vectorized interpolaters for common R data types such as numeric, date and
color.")
    (license license:expat)))

(define-public r-polyclip
  (package
    (name "r-polyclip")
    (version "1.10-7")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "polyclip" version))
       (sha256
        (base32
         "1lshalmhdaw0g0hzfy2qwid282pq3kwzy4jz1hf73xmjlp1sm3pm"))))
    (build-system r-build-system)
    (native-inputs (list pkg-config))
    (home-page "http://www.angusj.com/delphi/clipper.php")
    (synopsis "Polygon clipping")
    (description
     "This package provides an R port of the library Clipper.  It performs
polygon clipping operations (intersection, union, set minus, set difference)
for polygonal regions of arbitrary complexity, including holes.  It computes
offset polygons (spatial buffer zones, morphological dilations, Minkowski
dilations) for polygonal regions and polygonal lines.  It computes the
Minkowski Sum of general polygons.  There is a function for removing
self-intersections from polygon data.")
    (license license:boost1.0)))

(define-public r-urlchecker
  (package
    (name "r-urlchecker")
    (version "1.0.1")
    (source (origin
              (method url-fetch)
              (uri (cran-uri "urlchecker" version))
              (sha256
               (base32
                "06034lb94krbzawqg5xklwcksvyyzl3qy355f66baj5pw7dms5k2"))))
    (properties `((upstream-name . "urlchecker")))
    (build-system r-build-system)
    (propagated-inputs (list r-cli r-curl r-xml2))
    (home-page "https://github.com/r-lib/urlchecker")
    (synopsis "Run CRAN URL checks from older R versions")
    (description
     "This package provides the URL checking tools available in R 4.1+ as a
package for earlier versions of R.  It also uses concurrent requests so can be
much faster than the serial versions.")
    (license license:gpl3)))

(define-public r-urltools
  (package
    (name "r-urltools")
    (version "1.7.3")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "urltools" version))
       (sha256
        (base32
         "04x3my655dd287cbsszbnf75q0swmjlxxrblcsay7a8n3df3a830"))))
    (build-system r-build-system)
    (propagated-inputs
     (list r-rcpp r-triebeard))
    (native-inputs (list r-knitr r-testthat))
    (home-page "https://github.com/Ironholds/urltools/")
    (synopsis "Vectorized tools for URL handling and parsing")
    (description
     "This package provides a toolkit for all URL-handling needs, including
encoding and decoding, parsing, parameter extraction and modification.  All
functions are designed to be both fast and entirely vectorized.  It is
intended to be useful for people dealing with web-related datasets, such as
server-side logs, although may be useful for other situations involving large
sets of URLs.")
    (license license:expat)))

(define-public r-ggforce
  (package
    (name "r-ggforce")
    (version "0.4.2")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "ggforce" version))
       (sha256
        (base32
         "1a2i1rl27yqh8kxjpphwcv05p19l2aw07q9gxl4x8iv8xpkb0if1"))))
    (build-system r-build-system)
    (propagated-inputs
     (list r-cli
           r-ggplot2
           r-gtable
           r-lifecycle
           r-mass
           r-polyclip
           r-rcpp
           r-rcppeigen
           r-rlang
           r-scales
           r-systemfonts
           r-tidyselect
           r-tweenr
           r-vctrs
           r-withr))
    (home-page "https://ggforce.data-imaginist.com")
    (synopsis "Accelerating ggplot2")
    (description
     "The aim of the ggplot2 package is to aid in visual data investigations.
This focus has led to a lack of facilities for composing specialized plots.
This package aims to be a collection of mainly new statistics and geometries
that fills this gap.")
    (license license:expat)))

(define-public r-eulerr
  (package
    (name "r-eulerr")
    (version "7.0.2")
    (source (origin
              (method url-fetch)
              (uri (cran-uri "eulerr" version))
              (sha256
               (base32
                "0aw4l338nymrmna7q01vxn2cc7wyzz3lhf1bwazy55qa4hmww3af"))))
    (properties `((upstream-name . "eulerr")))
    (build-system r-build-system)
    (propagated-inputs
     (list r-gensa
           r-polyclip
           r-polylabelr
           r-rcpp
           r-rcpparmadillo))
    (native-inputs (list r-knitr r-testthat))
    (home-page "https://github.com/jolars/eulerr")
    (synopsis "Area-proportional Euler and Venn diagrams with ellipses")
    (description
     "This package generates area-proportional Euler diagrams using
numerical optimization.  An Euler diagram is a generalization of a
Venn diagram, relaxing the criterion that all interactions need to be
represented.  Diagrams may be fit with ellipses and circles via a wide
range of inputs and can be visualized in numerous ways.")
    (license license:gpl3)))

(define-public r-europepmc
  (package
    (name "r-europepmc")
    (version "0.4.3")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "europepmc" version))
       (sha256
        (base32
         "160rvp4yl5myccasyzaq8qhgxwv858y1wdwyrmnrmn3va8s5b515"))))
    (build-system r-build-system)
    (propagated-inputs
     (list r-dplyr
           r-httr
           r-jsonlite
           r-plyr
           r-progress
           r-purrr
           r-rlang
           r-tibble
           r-tidyr
           r-urltools
           r-xml2))
    (native-inputs
     (list r-knitr r-testthat))
    (home-page "https://github.com/ropensci/europepmc/")
    (synopsis "R Interface to the Europe PubMed Central RESTful Web Service")
    (description
     "This package provides an R Client for the
@url{https://europepmc.org/RestfulWebService,Europe PubMed Central RESTful Web
Service}.  It gives access to both metadata on life science literature and
open access full texts.  Europe PMC indexes all PubMed content and other
literature sources including Agricola, a bibliographic database of citations
to the agricultural literature, or Biological Patents.  In addition to
bibliographic metadata, the client allows users to fetch citations and
reference lists.  Links between life-science literature and other EBI
databases, including ENA, PDB or ChEMBL are also accessible.")
    (license license:gpl3)))

(define-public r-ggraph
  (package
    (name "r-ggraph")
    (version "2.2.1")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "ggraph" version))
       (sha256
        (base32
         "1w9snb43wpa2rv16fx5vmh7nqpgkr05iz6flnmlfx3xd0ylzh1a4"))))
    (build-system r-build-system)
    (propagated-inputs
     (list r-cli
           r-cpp11
           r-dplyr
           r-ggforce
           r-ggplot2
           r-ggrepel
           r-graphlayouts
           r-igraph
           r-lifecycle
           r-mass
           r-memoise
           r-rlang
           r-scales
           r-tidygraph
           r-vctrs
           r-viridis
           r-withr))
    (native-inputs
     (list r-knitr))
    (home-page "https://cran.r-project.org/web/packages/ggraph/")
    (synopsis "Implementation of grammar of graphics for graphs and networks")
    (description
     "The grammar of graphics as implemented in ggplot2 is a poor fit for
graph and network visualizations due to its reliance on tabular data input.
The ggraph package is an extension of the ggplot2 API tailored to graph
visualizations and provides the same flexible approach to building up plots
layer by layer.")
    (license license:gpl3)))

(define-public r-gkmsvm
  (package
    (name "r-gkmsvm")
    (version "0.83.0")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "gkmSVM" version))
       (sha256
        (base32
         "1bg9jw4ra76j132lkr0p5m2xlr952fdij1hn6f1v7g687l55m0k5"))))
    (properties `((upstream-name . "gkmSVM")))
    (build-system r-build-system)
    (propagated-inputs
     (list r-kernlab r-rcpp r-rocr r-seqinr))
    (home-page "https://cran.r-project.org/web/packages/gkmSVM")
    (synopsis "Gapped-kmer support vector machine")
    (description
     "This R package provides tools for training gapped-kmer SVM classifiers
for DNA and protein sequences.  This package supports several sequence
kernels, including: gkmSVM, kmer-SVM, mismatch kernel and wildcard kernel.")
    (license license:gpl2+)))

(define-public r-varselrf
  (package
    (name "r-varselrf")
    (version "0.7-8")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "varSelRF" version))
       (sha256
        (base32
         "0h49rl1j13yfh97rsfsyh9s2c4wajny4rzms2qw77d0cavxqg53i"))))
    (properties `((upstream-name . "varSelRF")))
    (build-system r-build-system)
    (propagated-inputs
     (list r-randomforest))
    (home-page "https://www.ligarto.org/rdiaz/software/software")
    (synopsis "Variable selection using random forests")
    (description
     "This package provides tools for the variable selection from random
forests using both backwards variable elimination (for the selection of small
sets of non-redundant variables) and selection based on the importance
spectrum (somewhat similar to scree plots; for the selection of large,
potentially highly-correlated variables).  The main applications are in
high-dimensional data (e.g., microarray data, and other genomics and
proteomics applications).")
    (license license:gpl2+)))

(define-public r-pamr
  (package
    (name "r-pamr")
    (version "1.57")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "pamr" version))
       (sha256
        (base32
         "0gdgaspan6j4qw98357mdk7rs6r1abzzfrp63jzf99gi41v8z5h1"))))
    (build-system r-build-system)
    (propagated-inputs
     (list r-cluster r-survival))
    (home-page "https://cran.r-project.org/web/packages/pamr/")
    (synopsis "Prediction Analysis for Microarrays")
    (description
     "This package provides some functions for sample classification in
microarrays.")
    (license license:gpl2)))

(define-public r-rda
  (package
    (name "r-rda")
    (version "1.2-1")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "rda" version))
       (sha256
        (base32
         "16mf76hlhii30f2m5xlwa4gv4a5ydnla2kz6ylcka4y9668ql0rp"))))
    (build-system r-build-system)
    (home-page "https://cran.r-project.org/web/packages/rda/")
    (synopsis "Shrunken centroids regularized discriminant analysis")
    (description
     "This package provides tools for shrunken centroids regularized
discriminant analysis for the purpose of classifying high dimensional data.")
    (license license:gpl2+)))

(define-public r-ggvis
  (package
    (name "r-ggvis")
    (version "0.4.9")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "ggvis" version))
       (sha256
        (base32
         "0bx1bg19l8nfwzwhnn2jn0b0lwcb781l6v9k5zfsx44wg22d3fb9"))
       (snippet
        '(for-each delete-file
                   '("inst/www/lib/d3/d3.min.js"
                     "inst/www/lib/jquery-ui/jquery-ui.min.js"
                     "inst/www/lib/jquery/jquery.min.js"
                     "inst/www/lib/lodash/lodash.min.js"
                     "inst/www/lib/vega/vega.min.js")))))
    (properties
     '((updater-extra-native-inputs . ("r-lubridate"))))
    (build-system r-build-system)
    (arguments
     (list
      #:modules '((guix build utils)
                  (guix build r-build-system)
                  (srfi srfi-1))
      #:phases
      #~(modify-phases %standard-phases
          (add-after 'unpack 'process-javascript
            (lambda* (#:key inputs #:allow-other-keys)
              (with-directory-excursion "inst/www/lib"
                (call-with-values
                    (lambda ()
                      (unzip2
                       `(("d3/d3.js" "d3/d3.min.js")
                         ("jquery-ui/jquery-ui.js"
                          "jquery-ui/jquery-ui.min.js")
                         ("jquery/jquery.js"
                          "jquery/jquery.min.js")
                         (,(search-input-file inputs "/dist/lodash.js")
                          "lodash/lodash.min.js")
                         ("vega/vega.js"
                          "vega/vega.min.js"))))
                  (lambda (sources targets)
                    (for-each (lambda (source target)
                                (format #true "Processing ~a --> ~a~%"
                                        source target)
                                (invoke "esbuild" source "--minify"
                                        (string-append "--outfile=" target)))
                              sources targets)))))))))
    (propagated-inputs
     (list r-assertthat
           r-dplyr
           r-htmltools
           r-jsonlite
           r-magrittr
           r-rlang
           r-shiny))
    (native-inputs
     `(("esbuild" ,esbuild)
       ;; Version according to commit
       ;; https://github.com/rstudio/ggvis/commit/0a197c25b5a1d94724f1868270d5163b27ad2e76
       ("js-lodash"
        ,(let ((version "4.17.21"))
           (origin
             (method git-fetch)
             (uri (git-reference
                   (url "https://github.com/lodash/lodash")
                   (commit version)))
             (file-name (git-file-name "lodash.js" version))
             (sha256
              (base32
               "0gd1rhp85z0xybii19fkkqkbshcklwrrcvj335z17q2cnbb57v44")))))
       ("r-lubridate" ,r-lubridate)
       ("r-testthat" ,r-testthat)))
    (home-page "https://ggvis.rstudio.com/")
    (synopsis "Interactive grammar of graphics")
    (description
     "This package is a data visualization package for R providing an
implementation of an interactive grammar of graphics, taking the best parts of
ggplot2, combining them with the reactive framework of Shiny and drawing web
graphics using Vega.")
    (license license:gpl2)))

(define-public r-gbm
  (package
    (name "r-gbm")
    (version "2.2.2")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "gbm" version))
       (sha256
        (base32
         "1x64a0cq9ys49i3z4df0grk506n55i7yj1ljysf9g60cq6xd56h2"))))
    (build-system r-build-system)
    (propagated-inputs
     (list r-lattice r-survival))
    (native-inputs
     (list r-knitr r-runit))
    (home-page "https://github.com/gbm-developers/gbm")
    (synopsis "Generalized boosted regression models")
    (description
     "This package is an implementation of extensions to Freund and Schapire's
AdaBoost algorithm and Friedman's gradient boosting machine.  It includes
regression methods for least squares, absolute loss, t-distribution loss,
quantile regression, logistic, multinomial logistic, Poisson, Cox proportional
hazards partial likelihood, AdaBoost exponential loss, Huberized hinge loss,
and Learning to Rank measures (LambdaMart).")
    (license license:gpl2+)))

(define-public r-threejs
  (package
    (name "r-threejs")
    (version "0.3.4")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "threejs" version))
       (sha256
        (base32
         "115ldv4df276312bsfigkz28mp2d0xk2izxwvghiw182hzbsasqw"))))
    (build-system r-build-system)
    (arguments
     (list
      #:modules '((guix build r-build-system)
                  (guix build minify-build-system)
                  (guix build utils)
                  (ice-9 match))
      #:imported-modules `(,@%r-build-system-modules
                           (guix build minify-build-system))
      #:phases
      #~(modify-phases (@ (guix build r-build-system) %standard-phases)
          (add-after 'unpack 'process-javascript
            (lambda* (#:key inputs #:allow-other-keys)
              (with-directory-excursion "inst"
                (for-each
                 (match-lambda
                   ((source . target)
                    (minify source #:target target)))
                 `((,(assoc-ref inputs "js-jquery")
                     . "htmlwidgets/lib/jquery/jquery.min.js")
                   (,(assoc-ref inputs "js-threejs-111")
                    . "htmlwidgets/lib/threejs-111/three.min.js")))))))))
    (propagated-inputs
     (list r-base64enc r-crosstalk r-htmlwidgets r-igraph))
    (native-inputs
     `(("esbuild" ,esbuild)
       ("js-jquery"
        ,(origin
           (method url-fetch)
           (uri "https://code.jquery.com/jquery-1.12.4.js")
           (sha256
            (base32
             "0x9mrc1668icvhpwzvgafm8xm11x9lfai9nwr66aw6pjnpwkc3s3"))))
       ("js-threejs-111"
        ,(origin
           (method url-fetch)
           (uri "https://raw.githubusercontent.com/mrdoob/three.js/r111/build/three.js")
           (sha256
            (base32
             "1cxdkw3plmlw1xvhbx5dm39gqczgzxip2dm887v6whhsxqxl9cky"))))))
    (home-page "https://bwlewis.github.io/rthreejs")
    (synopsis "Interactive 3D scatter plots, networks and globes")
    (description
     "Create interactive 3D scatter plots, network plots, and globes in R
using the three.js visualization library.")
    (license license:expat)))

(define-public r-mlbench
  (package
    (name "r-mlbench")
    (version "2.1-6")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "mlbench" version))
       (sha256
        (base32
         "07lma8vf1qyk1milv6nxh0vbiw2hyfb491993rk3byclhm8cyb7a"))))
    (build-system r-build-system)
    (home-page "https://cran.r-project.org/web/packages/mlbench/")
    (synopsis "Machine learning benchmark problems")
    (description
     "This package provides a collection of artificial and real-world machine
learning benchmark problems, including, e.g., several data sets from the UCI
repository.")
    (license license:gpl2)))

(define-public r-mlmetrics
  (package
    (name "r-mlmetrics")
    (version "1.1.3")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "MLmetrics" version))
       (sha256
        (base32 "11dgpw6lzs3vrfa3v9kf8x2rph3vpicxbw5af89afa175by3amrc"))))
    (properties `((upstream-name . "MLmetrics")))
    (build-system r-build-system)
    (propagated-inputs (list r-rocr))
    (home-page "https://github.com/yanyachen/MLmetrics")
    (synopsis "Machine learning evaluation metrics")
    (description
     "This package provides a collection of evaluation metrics, including
loss, score and utility functions, that measure regression, classification and
ranking performance.")
    (license license:gpl2)))

(define-public r-mlogit
  (package
    (name "r-mlogit")
    (version "1.1-2")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "mlogit" version))
       (sha256
        (base32 "1i8wiz4gkq369mk8scz5c8b1nsnxyrzpk89v7aj56rmw3x53k6l9"))))
    (properties
     '((upstream-name . "mlogit")
       (updater-extra-native-inputs . ("r-aer"))))
    (build-system r-build-system)
    (propagated-inputs (list r-dfidx
                             r-formula
                             r-lmtest
                             r-mass
                             r-rdpack
                             r-statmod
                             r-zoo))
    (native-inputs (list r-aer r-knitr r-lattice r-nnet))
    (home-page "https://cran.r-project.org/package=mlogit")
    (synopsis "Multinomial logit models")
    (description
     "This is a package for maximum likelihood estimation of random utility
discrete choice models.  The software is described in Croissant (2020)
<doi:10.18637/jss.v095.i11> and the underlying methods in Train (2009)
<doi:10.1017/CBO9780511805271>.")
    (license license:gpl2+)))

(define-public r-mpm
  (package
    (name "r-mpm")
    (version "1.0-23")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "mpm" version))
       (sha256
        (base32
         "1jpv2ddmw7aarqbbyfys1yb840arw33319wnny3v2hk84hldmayj"))))
    (build-system r-build-system)
    (propagated-inputs
     (list r-kernsmooth r-mass))
    (home-page "https://mpm.r-forge.r-project.org")
    (synopsis "Multivariate projection methods")
    (description
     "This is a package for exploratory graphical analysis of multivariate
data, specifically gene expression data with different projection methods:
principal component analysis, correspondence analysis, spectral map
analysis.")
    (license license:gpl2+)))

(define-public r-png
  (package
    (name "r-png")
    (version "0.1-8")
    (source (origin
              (method url-fetch)
              (uri (cran-uri "png" version))
              (sha256
               (base32
                "077nca3x0l6mq2g6izknzcn994bqs3nfqk7wscrjbfk2dnxzldjs"))))
    (build-system r-build-system)
    (inputs
     (list libpng zlib))
    (home-page "https://www.rforge.net/png/")
    (synopsis "Read and write PNG images")
    (description
     "This package provides an easy and simple way to read, write and display
bitmap images stored in the PNG format.  It can read and write both files and
in-memory raw vectors.")
    ;; Any of these GPL versions.
    (license (list license:gpl2 license:gpl3))))

(define-public r-ggcorrplot
  (package
    (name "r-ggcorrplot")
    (version "0.1.4.1")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "ggcorrplot" version))
       (sha256
        (base32
         "0yd865lfs4144jqh9ilznqa69rj0183ashnhvmjmis87zw69a45q"))))
    (build-system r-build-system)
    (propagated-inputs
     (list r-ggplot2 r-reshape2))
    (native-inputs (list r-testthat))
    (home-page "http://www.sthda.com/english/wiki/ggcorrplot")
    (synopsis "Visualization of a correlation matrix using ggplot2")
    (description
     "The ggcorrplot package can be used to visualize easily a correlation
matrix using ggplot2.  It provides a solution for reordering the correlation
matrix and displays the significance level on the plot.  It also includes a
function for computing a matrix of correlation p-values.")
    (license license:gpl2)))

(define-public r-ggfun
  (package
    (name "r-ggfun")
    (version "0.1.8")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "ggfun" version))
       (sha256
        (base32
         "0p1znrc6k7lh1i3q65v8i48z5d48fag8pz213a8297cdiik9wgq8"))))
    (properties `((upstream-name . "ggfun")))
    (build-system r-build-system)
    (propagated-inputs
     (list r-cli r-dplyr r-ggplot2 r-rlang r-yulab-utils))
    (native-inputs (list r-knitr))
    (home-page "https://cran.r-project.org/package=ggfun")
    (synopsis "Miscellaneous functions for ggplot2")
    (description
     "This package provides useful functions to edit ggplot object (e.g.,
setting fonts for theme and layers, adding rounded rectangle as background for
each of the legends).")
    (license license:artistic2.0)))

(define-public r-gridtext
  (package
    (name "r-gridtext")
    (version "0.1.5")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "gridtext" version))
       (sha256
        (base32
         "0f7i2qb8fawi8agy2iz2c173kfwj7cbb5ikjix64nmzqc5j7363d"))))
    (properties `((upstream-name . "gridtext")))
    (build-system r-build-system)
    (propagated-inputs
     (list r-curl
           r-jpeg
           r-markdown
           r-png
           r-rcpp
           r-rlang
           r-stringr
           r-xml2))
    (native-inputs (list r-testthat))
    (home-page "https://wilkelab.org/gridtext/")
    (synopsis "Improved text rendering support for Grid graphics")
    (description
     "This package provides support for rendering of formatted text using Grid
graphics.  Text can be formatted via a minimal subset of Markdown, HTML, and
inline CSS directives, and it can be rendered both with and without word
wrap.")
    (license license:expat)))

(define-public r-gggenes
  (package
    (name "r-gggenes")
    (version "0.5.1")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "gggenes" version))
       (sha256
        (base32 "08s0fhk2kz3ks64nfmdbd8p3swkn62cbw7dpbqgk9ydpmh5gpjbj"))))
    (properties `((upstream-name . "gggenes")))
    (build-system r-build-system)
    (propagated-inputs (list r-ggfittext r-ggplot2 r-rlang))
    (native-inputs (list r-knitr r-testthat))
    (home-page "https://wilkox.org/gggenes/")
    (synopsis "Draw gene arrow maps in ggplot2")
    (description
     "This package provides a ggplot2 extension for drawing gene arrow maps.")
    (license license:gpl2)))

(define-public r-ggghost
  (package
    (name "r-ggghost")
    (version "0.2.2")
    (source (origin
              (method url-fetch)
              (uri (cran-uri "ggghost" version))
              (sha256
               (base32
                "08ik4zbkglff6byqdym2ipg3ar2p273p014n3lf4dkvrys7asvk6"))))
    (properties `((upstream-name . "ggghost")))
    (build-system r-build-system)
    (propagated-inputs (list r-animation r-ggplot2))
    (native-inputs (list r-testthat))
    (home-page "https://github.com/jonocarroll/ggghost")
    (synopsis "Capture the spirit of your ggplot2 calls")
    (description
     "This package lets you create a reproducible @code{ggplot2} object by
storing the data and calls.")
    (license license:gpl3+)))

(define-public r-ggtext
  (package
    (name "r-ggtext")
    (version "0.1.2")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "ggtext" version))
       (sha256
        (base32
         "10vrrxviv4yp9lqsanqvwsvbj64vn66hwm1w7860x1g58hf1g0l7"))))
    (properties `((upstream-name . "ggtext")))
    (build-system r-build-system)
    (propagated-inputs
     (list r-ggplot2 r-gridtext r-rlang r-scales))
    (native-inputs (list r-knitr r-testthat))
    (home-page "https://wilkelab.org/ggtext/")
    (synopsis "Improved text rendering support for ggplot2")
    (description
     "This package provides a ggplot2 extension that enables the rendering of
complex formatted plot labels (titles, subtitles, facet labels, axis labels,
etc.).  Text boxes with automatic word wrap are also supported.")
    (license license:gpl2)))

(define-public r-ggthemeassist
  (package
    (name "r-ggthemeassist")
    (version "0.1.5")
    (source (origin
              (method url-fetch)
              (uri (cran-uri "ggThemeAssist" version))
              (sha256
               (base32
                "1biw91a8p13h62v4w3yim6ghr98khmyhb3qd0h04asf91vvmpxbv"))))
    (properties `((upstream-name . "ggThemeAssist")))
    (build-system r-build-system)
    (propagated-inputs
     (list r-formatr
           r-ggplot2
           r-miniui
           r-rstudioapi
           r-shiny))
    (home-page "https://github.com/calligross/ggthemeassist")
    (synopsis "Add-in to customize ggplot2 themes")
    (description
     "This package provides an Rstudio add-in that delivers a graphical
interface for editing @code{ggplot2} theme elements.")
    (license license:gpl3)))

;; This package includes minified JavaScript files.  When upgrading please
;; check that there are no new minified JavaScript files.
(define-public r-flexdashboard
  (package
    (name "r-flexdashboard")
    (version "0.6.2")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "flexdashboard" version))
       (sha256
        (base32
         "0zxyrfp1inv19palaba81pxlq0nz655hcliynvh995a58cvg6c5n"))
       ;; Delete bundled minified JavaScript files
       (snippet
        '(for-each delete-file
                   '("inst/htmlwidgets/lib/raphael/raphael-2.1.4.min.js"
                     "inst/www/featherlight/featherlight.min.js"
                     "inst/www/prism/prism.js"
                     "inst/www/sly/sly.min.js"
                     "inst/www/stickytableheaders/jquery.stickytableheaders.min.js")))))
    (build-system r-build-system)
    (arguments
     `(#:modules ((guix build utils)
                  (guix build r-build-system)
                  (srfi srfi-1)
                  (srfi srfi-26)
                  (ice-9 textual-ports))
       #:phases
       (modify-phases %standard-phases
         (add-after 'unpack 'process-javascript
           (lambda* (#:key inputs #:allow-other-keys)
             (with-directory-excursion "inst"
               ;; Concatenate all components of prism.js
               (let ((contents (string-join
                                (map (lambda (name)
                                       (call-with-input-file
                                           (assoc-ref inputs name)
                                         get-string-all))
                                     (list "js-prism"
                                           "js-prism-r"
                                           "js-prism-line-numbers"))
                                "\n")))
                 (call-with-output-file "prism-src.js"
                   (cut display contents <>)))
               (call-with-values
                   (lambda ()
                     (unzip2
                      `(("www/stickytableheaders/jquery.stickytableheaders.js"
                         "www/stickytableheaders/jquery.stickytableheaders.min.js")
                        ("www/sly/sly.js"
                         "www/sly/sly.min.js")
                        ("prism-src.js"
                         "www/prism/prism.js")
                        (,(assoc-ref inputs "js-raphael")
                         "htmlwidgets/lib/raphael/raphael-2.1.4.min.js")
                        (,(assoc-ref inputs "js-featherlight")
                         "www/featherlight/featherlight.min.js"))))
                 (lambda (sources targets)
                   (for-each (lambda (source target)
                               (format #true "Processing ~a --> ~a~%"
                                       source target)
                               (invoke "esbuild" source "--minify"
                                       (string-append "--outfile=" target)))
                             sources targets)))))))))
    (propagated-inputs
     (list r-bslib
           r-htmltools
           r-htmlwidgets
           r-jsonlite
           r-knitr
           r-rmarkdown
           r-sass
           r-scales
           r-shiny))
    (native-inputs
     `(("esbuild" ,esbuild)
       ("js-raphael"
        ,(origin
           (method url-fetch)
           (uri "https://raw.githubusercontent.com/DmitryBaranovskiy/raphael/v2.1.4/raphael.js")
           (sha256
            (base32
             "1h4c4akrgcj7wra9j1z1rv2406j0yf68y9c0wg8v7w9ibw2iwf1x"))))
       ;; It actually wants version 1.4.1 according to R/dependencies.R.
       ("js-prism"
        ,(origin
           (method url-fetch)
           (uri "https://raw.githubusercontent.com/PrismJS/prism/v1.16.0/prism.js")
           (sha256
            (base32
             "0gqa9irbp9k8p5r3d98cszajzhjnssnl43nrsc5aiy7ki52z500c"))))
       ("js-prism-r"
        ,(origin
           (method url-fetch)
           (uri "https://raw.githubusercontent.com/PrismJS/prism/v1.16.0/components/prism-r.js")
           (sha256
            (base32
             "1x31glci7wdgr2305njy0bm2lncb0jyn0j1s2g72rqi29xid9aki"))))
       ("js-prism-line-numbers"
        ,(origin
           (method url-fetch)
           (uri "https://raw.githubusercontent.com/PrismJS/prism/v1.16.0/plugins/line-numbers/prism-line-numbers.js")
           (sha256
            (base32
             "1543wgf3iynrilyb27jq8px3h5gvfz5xmdib5ik2ki400c1sl991"))))
       ;; See R/dependencies.R
       ("js-featherlight"
        ,(origin
           (method url-fetch)
           (uri "https://raw.githubusercontent.com/noelboss/featherlight/1.3.5/src/featherlight.js")
           (sha256
            (base32
             "0pbxgcipzbyivzlf3hal0lpajjj33p86fggm704c1b5bcq7ljl80"))))
       ("r-testthat" ,r-testthat)))
    (home-page "https://rmarkdown.rstudio.com/flexdashboard")
    (synopsis "R Markdown format for flexible dashboards")
    (description
     "This package provides an R Markdown format for converting an R Markdown
document to a grid-oriented dashboard.  The dashboard flexibly adapts the size
of its components to the containing web page.")
    (license license:expat)))

(define-public r-preseqr
  (package
    (name "r-preseqr")
    (version "4.0.0")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "preseqR" version))
       (sha256
        (base32
         "1g2rnnmi45649vpy6z45v5i3wxm54s138ajqrzwi3a5r7x3xnhq1"))))
    (properties `((upstream-name . "preseqR")))
    (build-system r-build-system)
    (propagated-inputs
     (list r-polynom))
    (home-page "https://cran.r-project.org/web/packages/preseqR/")
    (synopsis "Predicting species accumulation curves")
    (description
     "This package can be used to predict the r-species accumulation
curve (r-SAC), which is the number of species represented at least r times as
a function of the sampling effort.  When r = 1, the curve is known as the
species accumulation curve, or the library complexity curve in high-throughput
genomic sequencing.  The package includes both parametric and nonparametric
methods, as described by Deng C, et al. (2018).")
    (license license:gpl3)))

(define-public r-mapplots
  (package
    (name "r-mapplots")
    (version "1.5.2")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "mapplots" version))
       (sha256
        (base32
         "064a3jc7p4wh5x8rxmjap6kqkg19zfkq8ac820d9sm35d0fia3pd"))))
    (build-system r-build-system)
    (home-page "https://cran.r-project.org/web/packages/mapplots/")
    (synopsis "Data visualization on maps")
    (description
     "This package helps you create simple maps; add sub-plots like pie plots
to a map or any other plot; format, plot and export gridded data.  The package
was developed for displaying fisheries data but most functions can be used for
more generic data visualisation.")
    (license license:gpl2+)))

(define-public r-pmcmr
  (package
    (name "r-pmcmr")
    (version "4.4")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "PMCMR" version))
       (sha256
        (base32
         "05n13pp5yff6pzk4ry07crddfaj3jlglrd1vkcnacyd8jpaxkd77"))))
    (properties `((upstream-name . "PMCMR")))
    (build-system r-build-system)
    (home-page "https://cran.r-project.org/web/packages/PMCMR/")
    (synopsis "Calculate pairwise multiple comparisons of mean rank sums")
    (description
     "This is a deprecated package for calculating pairwise multiple
comparisons of mean rank sums.  This package is superseded by the novel
PMCMRplus package.  The PMCMR package is no longer maintained, but kept for
compatibility of dependent packages for some time.")
    (license license:gpl3+)))

(define-public r-downloader
  (package
    (name "r-downloader")
    (version "0.4.1")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "downloader" version))
       (sha256
        (base32
         "0xai0dp0hchsnrijx8dfxawzlw67xvrdm8jzwaxy604ngvv5ynbl"))))
    (build-system r-build-system)
    ;; FIXME Tests fail with: could not find function "context"
    (arguments (list #:tests? #false))
    (propagated-inputs
     (list r-digest))
    (native-inputs (list r-devtools r-testthat))
    (home-page "https://github.com/wch/downloader")
    (synopsis "Download files over HTTP and HTTPS")
    (description
     "This package provides a wrapper for the @code{download.file} function,
making it possible to download files over HTTPS across platforms.  The
@code{RCurl} package provides this functionality (and much more) but has
external dependencies.  This package has is implemented purely in R.")
    (license license:gpl2)))

(define-public r-aplot
  (package
    (name "r-aplot")
    (version "0.2.5")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "aplot" version))
       (sha256
        (base32
         "1fzpnfh5kn49ng7s1ssgmpih2chv30shy5dsgbjbp3wmx7qri9ym"))))
    (properties `((upstream-name . "aplot")))
    (build-system r-build-system)
    (propagated-inputs
     (list r-ggfun
           r-ggplot2
           r-ggplotify
           r-magrittr
           r-patchwork
           r-yulab-utils))
    (home-page "https://github.com/YuLab-SMU/aplot")
    (synopsis "Decorate a ggplot with associated information")
    (description
     "Users may want to align plots with associated information that requires
axes to be exactly matched in subplots, e.g. hierarchical clustering with a
heatmap.  This package provides utilities to align associated subplots to a
main plot at different sides (left, right, top and bottom) with axes exactly
matched.")
    (license license:artistic2.0)))

(define-public r-ggnewscale
  (package
    (name "r-ggnewscale")
    (version "0.5.1")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "ggnewscale" version))
       (sha256
        (base32
         "14kf0app8gfylky1vd6gvqdihxm1k4lfgpawx04z1ckb82gifl6d"))))
    (properties
     `((upstream-name . "ggnewscale")))
    (build-system r-build-system)
    (propagated-inputs
     (list r-ggplot2))
    (native-inputs (list r-testthat r-vdiffr))
    (home-page "https://cran.r-project.org/package=ggnewscale")
    (synopsis "Multiple fill and color scales in ggplot2")
    (description
     "This package lets you use multiple fill and color scales in ggplot2.")
    (license license:gpl3)))

(define-public r-ggpointdensity
  (package
    (name "r-ggpointdensity")
    (version "0.2.0")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "ggpointdensity" version))
       (sha256
        (base32
         "07pjk20arsw50y3dnjbvpdffpwdqvgr7sahvng6bikxpz3jcq7k1"))))
    (properties
     `((upstream-name . "ggpointdensity")))
    (build-system r-build-system)
    (propagated-inputs
     (list r-ggplot2))
    (native-inputs (list r-testthat))
    (home-page "https://github.com/LKremer/ggpointdensity")
    (synopsis "Cross between a 2D density plot and a scatter plot")
    (description
     "This package provides a cross between a 2D density plot and a scatter
plot, implemented as a ggplot2 @code{geom}.  Points in the scatter plot are
colored by the number of neighboring points.  This is useful to visualize the
2D-distribution of points in case of overplotting.")
    (license license:gpl3)))

(define-public r-arrow
  (package
    (name "r-arrow")
    (version "21.0.0")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "arrow" version))
       (sha256
        (base32
         "1ipwcgzbzr5xb1ff0ikwxdfhbniqdjmvi4505cmb0divg9p50946"))))
    (properties
     `((upstream-name . "arrow")
       (updater-ignored-native-inputs . ("r-duckdb"))
       (updater-ignored-inputs . ("openssh" "openssl"))
       (updater-extra-native-inputs
        . ("glibc-utf8-locales" "tzdata-for-tests"))))
    (build-system r-build-system)
    (arguments
     (list
      #:phases
      '(modify-phases %standard-phases
         (add-after 'unpack 'delete-bad-tests
           (lambda _
             ;; Two tests fail with "Cannot locate timezone"
             (delete-file "tests/testthat/test-dataset-dplyr.R")))
         ;; Some test fail when the current locale is the C locale.
         (add-before 'check 'set-test-locale
           (lambda _ (setenv "LC_ALL" "en_US.UTF-8")))
         (add-before 'check 'set-timezone
           (lambda* (#:key inputs #:allow-other-keys)
             (setenv "TZ" "UTC+1")
             (setenv "TZDIR"
                     (search-input-directory inputs
                                             "share/zoneinfo")))))))
    (inputs
     (list `(,apache-arrow "lib") zlib))
    (propagated-inputs
     (list r-assertthat
           r-bit64
           r-cpp11
           r-glue
           r-purrr
           r-r6
           r-rlang
           r-tidyselect
           r-vctrs))
    (native-inputs
     (list glibc-utf8-locales
           pkg-config
           r-blob
           r-dbi
           r-dbplyr
           r-dplyr
           r-hms
           r-jsonlite
           r-lubridate
           r-readr
           r-remotes
           r-reticulate
           r-stringi
           r-stringr
           r-sys
           r-testthat
           r-tibble
           r-withr
           tzdata-for-tests))
    (home-page "https://github.com/apache/arrow/")
    (synopsis "R integration to Apache Arrow")
    (description
     "Apache Arrow is a cross-language development platform for in-memory
data.  It specifies a standardized language-independent columnar memory format
for flat and hierarchical data, organized for efficient analytic operations on
modern hardware.  This package provides an R interface to the Arrow C++
library.")
    (license license:asl2.0)))

(define-public r-rex
  (package
    (name "r-rex")
    (version "1.2.1")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "rex" version))
       (sha256
        (base32
         "1mmzlc3j7xa0rbjxa369f4sr0iw3gq58g8fmjjxbsjvfq14ychmg"))))
    (build-system r-build-system)
    (propagated-inputs
     (list r-lazyeval))
    (native-inputs
     (list r-knitr r-testthat))
    (home-page "https://github.com/kevinushey/rex")
    (synopsis "Friendly regular expressions")
    (description
     "This package provides a friendly interface for the construction of
regular expressions.  Regular expressions are a very powerful feature, however
they are often difficult to interpret.  Rex allows you to build complex
regular expressions from human readable expressions")
    (license license:expat)))

(define-public r-mlapi
  (package
    (name "r-mlapi")
    (version "0.1.1")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "mlapi" version))
       (sha256
        (base32
         "1qyiii6x9b89i4pd4yi2zd23aabpmnpj18gqi5va0zy0l8r7kknr"))))
    (properties `((upstream-name . "mlapi")))
    (build-system r-build-system)
    (propagated-inputs
     (list r-matrix r-r6))
    (native-inputs
     (list r-knitr))
    (home-page "https://cran.r-project.org/package=mlapi")
    (synopsis "Abstract classes for building scikit-learn like API")
    (description
     "This package provides R6 abstract classes for building machine learning
models with a scikit-learn like API.  Scikit-learn is a popular module for the
Python programming language whose design became a de facto standard in
industry for machine learning tasks.")
    (license license:expat)))

(define-public r-float
  (package
    (name "r-float")
    (version "0.3-3")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "float" version))
       (sha256
        (base32
         "1lbjafz23m38il8mjwns8mnprryafzd3am6nw9xz5ivsf18n7flp"))))
    (properties `((upstream-name . "float")))
    (build-system r-build-system)
    (native-inputs
     (list gfortran r-rbenchmark))
    (home-page "https://github.com/wrathematics/float")
    (synopsis "32-bit floats")
    (description
     "R comes with a suite of utilities for linear algebra with
\"numeric\" (double precision) vectors/matrices.  However, sometimes single
precision (or less!) is more than enough for a particular task.  This package
extends R's linear algebra facilities to include 32-bit float (single
precision) data.  Float vectors/matrices have half the precision of their
\"numeric\"-type counterparts but are generally faster to numerically operate
on, for a performance vs accuracy trade-off.")
    (license license:bsd-2)))

(define-public r-rsparse
  (package
    (name "r-rsparse")
    (version "0.5.3")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "rsparse" version))
       (sha256
        (base32
         "0yzijxgd82h0yzqzpyfix5fd840clmms1nagl1161ngfdwd4kqb9"))))
    (properties `((upstream-name . "rsparse")))
    (build-system r-build-system)
    (propagated-inputs
     (list r-data-table
           r-float
           r-lgr
           r-matrix
           r-matrixextra
           r-rcpp
           r-rcpparmadillo
           r-rhpcblasctl))
    (native-inputs (list r-glmnet r-testthat))
    (home-page "https://github.com/rexyai/rsparse")
    (synopsis "Statistical learning on sparse matrices")
    (description
     "This package implements many algorithms for statistical learning on
sparse matrices: matrix factorizations, matrix completion, elastic net
regressions, factorization machines.  The rsparse package also enhances the
Matrix package by providing methods for multithreaded <sparse, dense> matrix
products and native slicing of the sparse matrices in @dfn{Compressed Sparse
Row} (CSR) format.")
    (license license:gpl2+)))

(define-public r-text2vec
  (package
    (name "r-text2vec")
    (version "0.6.4")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "text2vec" version))
       (sha256
        (base32
         "0sjlvp4zhzwc0ai7626fpw3ws8xv0xhl8gv8mrk24lrpk5nhin2h"))))
    (properties `((upstream-name . "text2vec")))
    (build-system r-build-system)
    (propagated-inputs
     (list r-data-table
           r-digest
           r-lgr
           r-matrix
           r-mlapi
           r-r6
           r-rcpp
           r-rsparse
           r-stringi))
    (native-inputs
     (list r-knitr r-testthat))
    (home-page "https://text2vec.org")
    (synopsis "Text mining framework for R")
    (description
     "This package provides fast and memory-friendly tools for text
vectorization, topic modeling (LDA, LSA), word embeddings (GloVe),
similarities.  It provides a source-agnostic streaming API, which allows
researchers to perform analysis of collections of documents which are larger
than available RAM.  All core functions are parallelized to benefit from
multicore machines.")
    (license license:gpl2+)))

(define-public r-mcmcpack
  (package
    (name "r-mcmcpack")
    (version "1.7-1")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "MCMCpack" version))
       (sha256
        (base32
         "0ac5nllnsdbvbf0l578dab1i24q3kxr0dpkch8w7q694cds4c2rv"))))
    (properties `((upstream-name . "MCMCpack")))
    (build-system r-build-system)
    (propagated-inputs
     (list r-coda r-lattice r-mass r-mcmc r-quantreg))
    (home-page "https://cran.r-project.org/package=MCMCpack")
    (synopsis "Markov Chain Monte Carlo (MCMC) package")
    (description
     "This package contains functions to perform Bayesian inference using
posterior simulation for a number of statistical models.  Most simulation is
done in compiled C++ written in the Scythe Statistical Library.  All models
return @code{coda} @code{mcmc} objects that can then be summarized using the
@code{coda} package.  Some useful utility functions such as density functions,
pseudo-random number generators for statistical distributions, a general
purpose Metropolis sampling algorithm, and tools for visualization are
provided.")
    (license license:gpl3)))

(define-public r-xml
  (package
    (name "r-xml")
    (version "3.99-0.18")
    (source (origin
              (method url-fetch)
              (uri (cran-uri "XML" version))
              (sha256
               (base32
                "0jskpmx300bimf835v00bsabz8nxrkr2y63wzrdwbn1cpnlaj398"))))
    (properties
     `((upstream-name . "XML")))
    (build-system r-build-system)
    (inputs
     (list libxml2 zlib))
    (native-inputs
     (list pkg-config))
    (home-page "https://www.omegahat.net/RSXML")
    (synopsis "Tools for parsing and generating XML within R")
    (description
     "Many approaches for both reading and creating XML (and HTML)
documents (including DTDs), both local and accessible via HTTP or FTP.  Also
offers access to an XPath \"interpreter\".")
    (license license:bsd-2)))

(define-public r-xml2
  (package
    (name "r-xml2")
    (version "1.3.8")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "xml2" version))
       (sha256
        (base32
         "01qhmlr5rhsn25ddb8cm3vl9vyqk5c5cgpc6c0krs9wccd1j4pbj"))))
    (properties
     ;; Avoid dependency cycle.
     '((updater-ignored-native-inputs . ("r-httr"))))
    (build-system r-build-system)
    (inputs
     (list libxml2 zlib))
    (propagated-inputs
     (list r-cli r-rlang))
    (native-inputs
     (list pkg-config r-knitr r-mockery r-testthat))
    (home-page "https://github.com/hadley/xml2")
    (synopsis "Parse XML with R")
    (description
     "This package provides a simple, consistent interface to working with XML
files in R.  It is built on top of the libxml2 C library.")
    (license license:gpl2+)))

(define-public r-xmlparsedata
  (package
    (name "r-xmlparsedata")
    (version "1.0.5")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "xmlparsedata" version))
       (sha256
        (base32
         "1c6bnz3ng1qw7sfip8wq3a4dn36a4d6rbja0sadn0a4pbsmk8q3n"))))
    (properties `((upstream-name . "xmlparsedata")))
    (build-system r-build-system)
    (native-inputs (list r-testthat))
    (home-page "https://github.com/r-lib/xmlparsedata#readme")
    (synopsis "Parse data of @code{R} code as an @code{XML} tree")
    (description
     "This package provides tools to convert the output of
@code{utils::getParseData()} to an @code{XML} tree, that one can search via
@code{XPath}, and is easier to manipulate in general.")
    (license license:expat)))

(define-public r-cyclocomp
  (package
    (name "r-cyclocomp")
    (version "1.1.1")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "cyclocomp" version))
       (sha256
        (base32
         "0kdinnn6cgkfc94japyyp5qr7imjxddajds3qqxf4q5higahdzws"))))
    (properties `((upstream-name . "cyclocomp")))
    (build-system r-build-system)
    (propagated-inputs
     (list r-callr r-crayon r-desc r-remotes r-withr))
    (native-inputs (list r-testthat))
    (home-page "https://github.com/MangoTheCat/cyclocomp")
    (synopsis "Cyclomatic complexity of R code")
    (description
     "Cyclomatic complexity is a software metric, used to indicate the
complexity of a program.  It is a quantitative measure of the number of
linearly independent paths through a program's source code.  This package
provides tools to compute this metric.")
    (license license:expat)))

(define-public r-lintr
  (package
    (name "r-lintr")
    (version "3.2.0")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "lintr" version))
       (sha256
        (base32
         "13mzwbg7k52finb0qp0xs1c1mp79f92cxlpfkc6h064s529czk20"))))
    (properties `((upstream-name . "lintr")))
    (build-system r-build-system)
    (arguments
     (list
      #:phases
      '(modify-phases %standard-phases
         (add-after 'unpack 'disable-bad-tests
           (lambda _
             ;; Two tests run code outside of testthat.
             (delete-file "tests/testthat/test-fixed_regex_linter.R")
             (delete-file "tests/testthat/test-pipe_continuation_linter.R")))
         ;; Needed by tests.
         (add-after 'unpack 'set-HOME
           (lambda _ (setenv "HOME" "/tmp"))))))
    (propagated-inputs
     (list r-backports
           r-cli
           r-codetools
           r-digest
           r-glue
           r-knitr
           r-rex
           r-xml2
           r-xmlparsedata))
    ;; The importer adds a lot of inputs that we don't need.
    (native-inputs (list r-knitr r-patrick r-testthat))
    (home-page "https://github.com/jimhester/lintr")
    (synopsis "Linter for R code")
    (description "This package checks adherence to a given style, syntax
errors and possible semantic issues.  It supports on the fly checking of R
code edited with @code{RStudio IDE}, @code{Emacs} and @code{Vim}.")
    (license license:expat)))

(define-public r-sccore
  (package
    (name "r-sccore")
    (version "1.0.6")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "sccore" version))
       (sha256
        (base32 "1lbqg8m6mh997fk0cx8yyv0iq68lsp61nfhk4r5xy7k6cf3gvjkn"))))
    (properties `((upstream-name . "sccore")))
    (build-system r-build-system)
    (propagated-inputs
     (list r-dplyr
           r-ggplot2
           r-ggrepel
           r-igraph
           r-irlba
           r-magrittr
           r-matrix
           r-pbmcapply
           r-proc
           r-rcpp
           r-rcpparmadillo
           r-rcppeigen
           r-rcppprogress
           r-rlang
           r-scales
           r-seurat
           r-tibble
           r-uwot
           r-withr))
    (native-inputs (list r-testthat))
    (home-page "https://github.com/kharchenkolab/sccore")
    (synopsis "Core utilities for single-cell RNA-Seq")
    (description
     "This package implements core utilities for single-cell RNA-seq data analysis.
Contained within are utility functions for working with @acronym{DE,
differential expression} matrices and count matrices, a collection of
functions for manipulating and plotting data via ggplot2, and functions to
work with cell graphs and cell embeddings.  Graph-based methods include
embedding kNN cell graphs into a UMAP, collapsing vertices of each cluster in
the graph, and propagating graph labels.")
    (license license:gpl3)))

(define-public r-scs
  (package
    (name "r-scs")
    (version "3.2.7")
    (source (origin
              (method url-fetch)
              (uri (cran-uri "scs" version))
              (sha256
               (base32
                "1jmag5s79vg7lvgv6h3ns72zaw2nl2hcbfbq5vi17xv5agwh8h7q"))))
    (properties `((upstream-name . "scs")))
    (build-system r-build-system)
    (native-inputs (list r-matrix r-slam r-tinytest))
    (home-page "https://github.com/FlorianSchwendinger/scs")
    (synopsis "Splitting conic solver")
    (description
     "This package solves convex cone programs via operator splitting.
It can solve: linear programs, second-order cone programs,
semidefinite programs, exponential cone programs, and power cone
programs, or problems with any combination of those cones.  SCS uses
AMD (a set of routines for permuting sparse matrices prior to
factorization) and LDL (a sparse LDL factorization and solve package)
from SuiteSparse.")
    (license license:gpl3)))

(define-public r-sctransform
  (package
    (name "r-sctransform")
    (version "0.4.2")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "sctransform" version))
       (sha256
        (base32
         "1l50df46kfn77m98i8yib4x6glw12ra7dpqh6bk4a4zrqzmhl62n"))))
    (build-system r-build-system)
    (propagated-inputs
     (list r-dplyr
           r-future
           r-future-apply
           r-ggplot2
           r-gridextra
           r-magrittr
           r-mass
           r-matrix
           r-matrixstats
           r-rcpp
           r-rcpparmadillo
           r-reshape2
           r-rlang))
    (native-inputs (list r-testthat))
    (home-page "https://github.com/ChristophH/sctransform")
    (synopsis "Variance stabilizing transformations for Single Cell UMI Data")
    (description
     "This package provides a normalization method for single-cell UMI count
data using a variance stabilizing transformation.  The transformation is based
on a negative binomial regression model with regularized parameters.  As part
of the same regression framework, this package also provides functions for
batch correction, and data correction.")
    (license license:gpl3)))

(define-public r-styler
  (package
    (name "r-styler")
    (version "1.10.3")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "styler" version))
       (sha256
        (base32
         "0hfspw1q40jqla238dw86iyf0lyk1agc19flwvf9nrm824hw5fdd"))))
    (properties
     '((updater-extra-native-inputs . ("r-roxygen2"))))
    (build-system r-build-system)
    ;; This is needed by R.cache.
    (arguments
     `(#:phases
       (modify-phases %standard-phases
         (add-after 'unpack 'set-HOME
           (lambda _ (setenv "HOME" "/tmp"))))))
    (propagated-inputs
     (list r-cli
           r-magrittr
           r-purrr
           r-r-cache
           r-rlang
           r-rprojroot
           r-vctrs
           r-withr))
    (native-inputs
     (list r-knitr r-roxygen2 r-testthat))
    (home-page "https://github.com/r-lib/styler")
    (synopsis "Non-invasive pretty printing of R code")
    (description
     "This is a package for pretty-printing R code without changing the user's
formatting intent.")
    (license license:gpl3)))

(define-public r-scrime
  (package
    (name "r-scrime")
    (version "1.3.5")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "scrime" version))
       (sha256
        (base32
         "0y2mh9fsffjf3i15bafpasa17z99c1s75r8g6h4hgcwfgpjx75sx"))))
    (build-system r-build-system)
    (home-page "https://cran.r-project.org/web/packages/scrime/")
    (synopsis "Analysis of high-dimensional categorical data such as SNP data")
    (description
     "This package provides tools for the analysis of high-dimensional data
developed/implemented at the group \"Statistical Complexity Reduction In
Molecular Epidemiology\" (SCRIME).  The main focus is on SNP data, but most of
the functions can also be applied to other types of categorical data.")
    (license license:gpl2)))

(define-public r-pbmcapply
  (package
    (name "r-pbmcapply")
    (version "1.5.1")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "pbmcapply" version))
       (sha256
        (base32
         "1p8jf7c4k45482w72sr0jw4jkz787krrxai3sl6jz5l4lda2iz3z"))))
    (build-system r-build-system)
    (home-page "https://github.com/kvnkuang/pbmcapply")
    (synopsis "Track the progress of apply procedures with a progress bar")
    (description
     "This light-weight package helps you track and visualize the progress of
parallel versions of vectorized R functions of the @code{mc*apply} family.")
    (license license:expat)))

(define-public r-blme
  (package
    (name "r-blme")
    (version "1.0-6")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "blme" version))
       (sha256
        (base32
         "0ghpbhs3bqxv9s759i3klfzrvigaxp34sscsy2m0n3d08j09f206"))))
    (build-system r-build-system)
    (propagated-inputs (list r-lme4))
    (native-inputs (list r-testthat))
    (home-page "https://github.com/vdorie/blme")
    (synopsis "Bayesian linear mixed-effects models")
    (description
     "This package provides tools for maximum a posteriori estimation for
linear and generalized linear mixed-effects models in a Bayesian setting.  It
extends the lme4 package.")
    (license license:gpl2+)))

(define-public r-batchtools
  (package
    (name "r-batchtools")
    (version "0.9.17")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "batchtools" version))
       (sha256
        (base32
         "1rlvfk0279saf930z48g230p9z30dd7qil9aiprjn35px1advqdn"))))
    (build-system r-build-system)
    (properties
     '((updater-extra-native-inputs . ("r-ranger"))))
    (propagated-inputs
     (list r-backports
           r-base64url
           r-brew
           r-checkmate
           r-data-table
           r-digest
           r-fs
           r-progress
           r-r6
           r-rappdirs
           r-stringi
           r-withr))
    (native-inputs
     (list r-knitr r-ranger r-testthat))
    (home-page "https://github.com/mllg/batchtools")
    (synopsis "Tools for computation on batch systems")
    (description
     "As a successor of the packages BatchJobs and BatchExperiments, this
package provides a parallel implementation of the Map function for high
performance computing systems managed by various schedulers.  A multicore and
socket mode allow the parallelization on a local machines, and multiple
machines can be hooked up via SSH to create a makeshift cluster.  Moreover,
the package provides an abstraction mechanism to define large-scale computer
experiments in a well-organized and reproducible way.")
    (license license:lgpl3)))

(define-public r-clue
  (package
    (name "r-clue")
    (version "0.3-66")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "clue" version))
       (sha256
        (base32
         "1yy26zvw15bqphdlb6gj2m4ay92gbb8hvply9hwyndanq1cdv1ma"))))
    (build-system r-build-system)
    (propagated-inputs (list r-cluster))
    (home-page "https://cran.r-project.org/web/packages/clue/")
    (synopsis "Tools for analyzing cluster ensembles")
    (description "Cluster ensembles are collections of individual solutions to
a given clustering problem which are useful or necessary to consider in a wide
range of applications.  This R package provides an extensible computational
environment for creating and analyzing cluster ensembles, with basic data
structures for representing partitions and hierarchies, and facilities for
computing on them, including methods for measuring proximity and obtaining
consensus and secondary clusterings.")
    (license license:gpl2)))

(define-public r-sitmo
  (package
    (name "r-sitmo")
    (version "2.0.2")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "sitmo" version))
       (sha256
        (base32
         "1hm89zi38ldgbskyx1cn7gm87yqy7zrxli8q05a36y1ndvazi3j4"))))
    (build-system r-build-system)
    (propagated-inputs (list r-rcpp))
    (native-inputs
     (list r-knitr))
    (home-page "https://github.com/coatless/sitmo/")
    (synopsis "Parallel pseudo random number generator header files")
    (description
     "This package provides two high quality and fast PPRNGs that may be used
in an OpenMP parallel environment.  In addition, there is a generator for one
dimensional low-discrepancy sequence.")
    (license license:expat)))

(define-public r-dqrng
  (package
    (name "r-dqrng")
    (version "0.4.1")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "dqrng" version))
       (sha256
        (base32
         "13r8agil10q0phzwh1vlsrwv7i15k43mc93iphw2ag0c08szk79x"))))
    (build-system r-build-system)
    (propagated-inputs
     (list r-bh r-rcpp r-sitmo))
    (native-inputs
     (list r-knitr r-testthat))
    (home-page "https://www.daqana.org/dqrng")
    (synopsis "Fast pseudo random number generators")
    (description
     "Several fast random number generators are provided as C++ header-only
libraries: the PCG family as well as Xoroshiro128+ and Xoshiro256+.
Additionally, fast functions for generating random numbers according to a
uniform, normal and exponential distribution are included.  The latter two use
the Ziggurat algorithm originally proposed by Marsaglia and Tsang.  These
functions are exported to R and as a C++ interface and are enabled for use
with the default 64 bit generator from the PCG family, Xoroshiro128+ and
Xoshiro256+ as well as the 64 bit version of the 20 rounds Threefry
engine (Salmon et al., 2011) as provided by the package @code{sitmo}.")
    ;; This package includes code under CC0 and Apache 2.0 or Expat, but as a
    ;; whole is distributed under the terms of the AGPL 3.
    (license license:agpl3)))

(define-public r-ingredients
  (package
    (name "r-ingredients")
    (version "2.3.0")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "ingredients" version))
       (sha256
        (base32
         "0jvxkdhbc28a096hi0y6519cj4im4mnl1vz9s563dvb5g4vb7r7b"))))
    (properties `((upstream-name . "ingredients")))
    (build-system r-build-system)
    ;; Tests need r-dalex, which depends on this package.
    (arguments (list #:tests? #false))
    (propagated-inputs
     (list r-ggplot2 r-gridextra r-scales))
    (native-inputs (list r-knitr r-testthat))
    (home-page "https://ModelOriented.github.io/ingredients/")
    (synopsis "Effects and importances of model ingredients")
    (description
     "This is a collection of tools for assessment of feature importance and
feature effects.  Key functions are:

@itemize
@item @code{feature_importance()} for assessment of global level feature
  importance,
@item @code{ceteris_paribus()} for calculation of the what-if plots,
@item @code{partial_dependence()} for partial dependence plots,
@item @code{conditional_dependence()} for conditional dependence plots,
@item @code{accumulated_dependence()} for accumulated local effects plots,
@item @code{aggregate_profiles()} and @code{cluster_profiles()} for
  aggregation of ceteris paribus profiles,
@item generic @code{print()} and @code{plot()} for better usability of
  selected explainers,
@item generic @code{plotD3()} for interactive, D3 based explanations, and
@item generic @code{describe()} for explanations in natural language.
@end itemize\n")
    (license license:gpl3)))

(define-public r-ibreakdown
  (package
    (name "r-ibreakdown")
    (version "2.1.2")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "iBreakDown" version))
       (sha256
        (base32
         "1qacvfzknchfm27mhl7a357fnb6lzjkj4vh8lch5aljz82sdmdaf"))))
    (properties `((upstream-name . "iBreakDown")))
    (build-system r-build-system)
    ;; Tests need r-dalex, which depends on this package.
    (arguments (list #:tests? #false))
    (propagated-inputs (list r-ggplot2))
    (native-inputs (list r-knitr r-testthat))
    (home-page "https://ModelOriented.github.io/iBreakDown/")
    (synopsis "Model agnostic instance level variable attributions")
    (description
     "This package provides a model agnostic tool for decomposition of
predictions from black boxes.  It supports additive attributions and
attributions with interactions.  The Break Down Table shows contributions of
every variable to a final prediction.  The Break Down Plot presents variable
contributions in a concise graphical way.  This package works for
classification and regression models.")
    (license license:gpl3)))

(define-public r-dae
  (package
    (name "r-dae")
    (version "3.2.30")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "dae" version))
       (sha256
        (base32
         "0avjx7q81gybvkzkrg9bjf57sj7mbwkv7qwkzzff05hnbcjrab0y"))))
    (build-system r-build-system)
    (arguments
     '(#:phases
       (modify-phases %standard-phases
         (add-after 'unpack 'set-HOME
           ;; Needed for vignette builder
           (lambda _ (setenv "HOME" "/tmp"))))))
    (propagated-inputs
     (list r-ggplot2 r-ggpubr r-plyr r-trycatchlog))
    (native-inputs
     (list r-r-rsp r-testthat)) ; vignette builder
    (home-page "http://chris.brien.name")
    (synopsis "Functions useful in the design and ANOVA of experiments")
    (description
     "This package provides functions useful in the design and ANOVA of
experiments.  The content falls into the following groupings:

@enumerate
@item data,
@item factor manipulation functions,
@item design functions,
@item ANOVA functions,
@item matrix functions,
@item projector and canonical efficiency functions, and
@item miscellaneous functions.
@end enumerate

There is a vignette called @code{DesignNotes} describing how to use the design
functions for randomizing and assessing designs.  The ANOVA functions
facilitate the extraction of information when the @code{Error} function has
been used in the call to @code{aov}.")
    (license license:gpl2)))

(define-public r-dalex
  (package
    (name "r-dalex")
    (version "2.4.3")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "DALEX" version))
       (sha256
        (base32
         "08cd5nhgd6vaazcqq985kwivg99v6ily4idhgkpz8l9ffl3lavm0"))))
    (properties `((upstream-name . "DALEX")))
    (build-system r-build-system)
    (propagated-inputs
     (list r-ggplot2 r-ibreakdown r-ingredients))
    (native-inputs (list r-gower r-ranger r-testthat))
    (home-page "https://pbiecek.github.io/DALEX/")
    (synopsis "Descriptive machine learning explanations")
    (description
     "Machine Learning models are widely used and have various applications in
classification or regression.  Models created with boosting, bagging, stacking
or similar techniques are often used due to their high performance, but such
black-box models usually lack interpretability.  The DALEX package contains
various explainers that help to understand the link between input variables
and model output.")
    ;; Any version of the GPL
    (license license:gpl3+)))

(define-public r-enrichr
  (package
    (name "r-enrichr")
    (version "3.4")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "enrichR" version))
       (sha256
        (base32
         "0gl4731z496nci71kbigagqi35afv43fqs1vnrmzwnn0q8jndcan"))))
    (properties `((upstream-name . "enrichR")))
    (build-system r-build-system)
    (propagated-inputs
     (list r-curl r-ggplot2 r-httr r-rjson r-writexls))
    (native-inputs
     (list r-knitr))
    (home-page "https://cran.r-project.org/web/packages/enrichR/")
    (synopsis "R Interface to Enrichr database for analyzing gene sets")
    (description
     "This package provides an R interface to all Enrichr databases, a
web-based tool for analyzing gene sets and returns any enrichment of common
annotated biological functions.")
    (license license:gpl2+)))

(define-public r-enrichwith
  (package
    (name "r-enrichwith")
    (version "0.3.1")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "enrichwith" version))
       (sha256
        (base32 "05fhx323ani86wdxbjp8dgw4d1iq4kr1887646w072a6iq93bwhm"))))
    (properties `((upstream-name . "enrichwith")))
    (build-system r-build-system)
    (native-inputs (list r-knitr))
    (home-page "https://github.com/ikosmidis/enrichwith")
    (synopsis "Methods to enrich R objects with extra components")
    (description
     "This package provides the \"enrich\" method to enrich list-like R
objects with new, relevant components.  The current version has methods for
enriching objects of class @code{family}, @code{link-glm}, @code{lm},
@code{glm} and @code{betareg}.  The resulting objects preserve their class, so
all methods associated with them still apply.  The package also provides the
@code{enriched_glm} function that has the same interface as @code{glm} but
results in objects of class @code{enriched_glm}.  In addition to the usual
components in a @code{glm} object, @code{enriched_glm} objects carry an
object-specific simulate method and functions to compute the scores, the
observed and expected information matrix, the first-order bias, as well as
model densities, probabilities, and quantiles at arbitrary parameter values.
The package can also be used to produce customizable source code templates for
the structured implementation of methods to compute new components and enrich
arbitrary objects.")
    (license (list license:gpl2 license:gpl3))))

(define-public r-plot3d
  (package
    (name "r-plot3d")
    (version "1.4.1")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "plot3D" version))
       (sha256
        (base32
         "1x6ian6hfkaih2aa11z92qlihqqf5wmpc9705dzigafx8i4gfvfv"))))
    (properties `((upstream-name . "plot3D")))
    (build-system r-build-system)
    (propagated-inputs (list r-misc3d))
    (home-page "https://cran.r-project.org/web/packages/plot3D")
    (synopsis "Plot multi-dimensional data")
    (description
     "This package provides functions for viewing 2D and 3D data, including
perspective plots, slice plots, surface plots, scatter plots, etc.  It
includes data sets from oceanography.")
    (license license:gpl3+)))

(define-public r-plotroc
  (package
    (name "r-plotroc")
    (version "2.3.1")
    (source (origin
              (method url-fetch)
              (uri (cran-uri "plotROC" version))
              (sha256
               (base32
                "15jvn1dlx8qh5ghnkhqyc49frw6rp58ikpjs3ga8mjxrqyz7wb1g"))
              (snippet
               '(delete-file "inst/d3.v3.min.js"))))
    (properties `((upstream-name . "plotROC")))
    (build-system r-build-system)
    (arguments
     (list
      #:phases
      '(modify-phases %standard-phases
         (add-after 'unpack 'process-javascript
           (lambda* (#:key inputs #:allow-other-keys)
             (let ((source (assoc-ref inputs "d3.v3.js"))
                   (target "inst/d3.v3.min.js"))
               (invoke "esbuild" source "--minify"
                       (string-append "--outfile=" target))))))))
    (propagated-inputs
     (list r-ggplot2
           r-gridsvg
           r-plyr
           r-rlang
           r-shiny))
    (native-inputs
     `(("r-knitr" ,r-knitr)
       ("r-testthat" ,r-testthat)
       ("esbuild" ,esbuild)
       ("d3.v3.js"
        ,(origin
           (method url-fetch)
           (uri "https://d3js.org/d3.v3.js")
           (sha256
            (base32
             "1arr7sr08vy7wh0nvip2mi7dpyjw4576vf3bm45rp4g5lc1k1x41"))))))
    (home-page "https://sachsmc.github.io/plotROC/")
    (synopsis "Generating useful receiver operating characteristic curve charts")
    (description
     "This package generates @acronym{ROC, receiver operating characteristic}
plots.  Most ROC curve plots obscure the cutoff values and inhibit
interpretation and comparison of multiple curves.  This attempts to address
those shortcomings by providing plotting and interactive tools.  Functions are
provided to generate an interactive ROC curve plot for web use, and print
versions.  A Shiny application implementing the functions is also included.")
    (license license:expat)))

(define-public r-ggfortify
  (package
    (name "r-ggfortify")
    (version "0.4.17")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "ggfortify" version))
       (sha256
        (base32
         "1ygbvk3b99mabwqc9hh5lz3adj1i05ym7i8b6kbgid8cgrbaaxag"))))
    (build-system r-build-system)
    (propagated-inputs
     (list r-dplyr
           r-ggplot2
           r-gridextra
           r-scales
           r-stringr
           r-tibble
           r-tidyr))
    (native-inputs
     (list r-knitr r-testthat))
    (home-page "https://github.com/sinhrks/ggfortify")
    (synopsis "Data visualization tools for statistical analysis results")
    (description
     "This package provides unified plotting tools for statistics commonly
used, such as GLM, time series, PCA families, clustering and survival
analysis.  The package offers a single plotting interface for these analysis
results and plots in a unified style using the @code{ggplot2} package.")
    (license license:gpl2)))

(define-public r-refmanager
  (package
    (name "r-refmanager")
    (version "1.4.0")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "RefManageR" version))
       (sha256
        (base32
         "1kjd66gp2z9fzrnyr1bqfd9p58q0bin3a187z9b56hiqmdjhyc78"))))
    (properties `((upstream-name . "RefManageR")))
    (build-system r-build-system)
    (propagated-inputs
     (list r-bibtex
           r-httr
           r-jsonlite
           r-lubridate
           r-plyr
           r-stringr
           r-xml2))
    (native-inputs
     (list r-knitr r-testthat))
    (home-page "https://github.com/ropensci/RefManageR/")
    (synopsis "Straightforward BibTeX and BibLaTeX bibliography management")
    (description
     "This package provides tools for importing and working with bibliographic
references.  It greatly enhances the @code{bibentry} class by providing a
class @code{BibEntry} which stores BibTeX and BibLaTeX references, supports
UTF-8 encoding, and can be easily searched by any field, by date ranges, and
by various formats for name lists (author by last names, translator by full
names, etc.).  Entries can be updated, combined, sorted, printed in a number
of styles, and exported.  BibTeX and BibLaTeX @code{.bib} files can be read
into R and converted to @code{BibEntry} objects.")
    ;; Any of these licenses may be picked.
    (license (list license:gpl2 license:gpl3 license:bsd-3))))

(define-public r-citr
  (package
    (name "r-citr")
    (version "0.3.2")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "citr" version))
       (sha256
        (base32
         "1qbarvafjb8jgkrnrhh6jw7mcglmjwf7dpdiibxf39jkmlhf7las"))))
    (build-system r-build-system)
    (propagated-inputs
     (list r-assertthat
           r-curl
           r-httr
           r-miniui
           r-refmanager
           r-rstudioapi
           r-shiny
           r-shinyjs
           r-yaml))
    (native-inputs (list r-testthat))
    (home-page "https://github.com/crsh/citr")
    (synopsis "RStudio add-in to insert Markdown citations")
    (description
     "This package provides functions and an RStudio add-in that search a
BibTeX or BibLaTeX file to create and insert formatted Markdown citations into
the current document.")
    (license license:expat)))

(define-public r-xgboost
  (package
    (name "r-xgboost")
    (version "1.7.11.1")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "xgboost" version))
       (sha256
        (base32
         "1ifpi156cw5w073857915j0qlwrn6gxvyshn8vppzqbswwdn6ny1"))))
    (properties
     '((updater-ignored-native-inputs . ("r-titanic"))))
    (build-system r-build-system)
    (arguments
     (list
      #:phases
      '(modify-phases %standard-phases
         (add-after 'unpack 'delete-bad-tests
           (lambda _
             ;; One tests here requires r-titanic.
             (delete-file "tests/testthat/test_callbacks.R")
             ;; This needs internet access
             (delete-file "tests/testthat/test_model_compatibility.R")
             ;; object 'Arthritis' not found
             (delete-file "tests/testthat/test_helpers.R"))))))
    (propagated-inputs
     (list r-data-table r-jsonlite r-matrix))
    (native-inputs
     (list r-knitr r-testthat  r-vcd))
    (home-page "https://github.com/dmlc/xgboost")
    (synopsis "Extreme gradient boosting")
    (description
     "This package provides an R interface to Extreme Gradient Boosting, which
is an efficient implementation of the gradient boosting framework from Chen
and Guestrin (2016).  The package includes efficient linear model solver and
tree learning algorithms.  The package can automatically do parallel
computation on a single machine.  It supports various objective functions,
including regression, classification and ranking.  The package is made to be
extensible, so that users are also allowed to define their own objectives
easily.")
    (license license:asl2.0)))

(define-public r-xnomial
  (package
    (name "r-xnomial")
    (version "1.0.4.1")
    (source
     (origin (method url-fetch)
             (uri (cran-uri "XNomial" version))
             (sha256
              (base32
               "09chxyj35s291myjaxk6y9afvg2wdsi05vz7rwqmaqzmvyqcwpw7"))))
    (properties (quasiquote ((upstream-name . "XNomial"))))
    (build-system r-build-system)
    (native-inputs (list r-knitr))
    (home-page "https://cran.r-project.org/web/packages/XNomial")
    (synopsis "Goodness-of-Fit test for multinomial data")
    (description
     "This package provides an exact Goodness-of-Fit test for multinomial data
with fixed probabilities.  It can be used to determine whether a set of counts
fits a given expected ratio.  To see whether a set of observed counts fits an
expectation, one can examine all possible outcomes with @code{xmulti()} or a
random sample of them with @code{xmonte()} and find the probability of an
observation deviating from the expectation by at least as much as the
observed.  As a measure of deviation from the expected, one can use the
log-likelihood ratio, the multinomial probability, or the classic chi-square
statistic.  A histogram of the test statistic can also be plotted and compared
with the asymptotic curve.")
    (license (list license:gpl2+ license:gpl3+))))

(define-public r-xtable
  (package
    (name "r-xtable")
    (version "1.8-4")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "xtable" version))
       (sha256
        (base32
         "077xfm0gphvhsay75amd9v90zk57kjgrrlgih04fyrbqqblc1gjs"))))
    (build-system r-build-system)
    (native-inputs
     (list r-knitr)) ; for vignettes
    (home-page "https://xtable.r-forge.r-project.org/")
    (synopsis "Export R tables to LaTeX or HTML")
    (description
     "This package provides tools to export R data as LaTeX and HTML tables.")
    (license license:gpl2+)))

(define-public r-umap
  (package
    (name "r-umap")
    (version "0.2.10.0")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "umap" version))
       (sha256
        (base32
         "1abfddi0rq75b7nlx6550fx9nrqa62vb92xyp05ris25jf98ciwd"))))
    (build-system r-build-system)
    (propagated-inputs
     (list r-matrix r-openssl r-rcpp r-reticulate r-rspectra))
    (native-inputs
     (list r-knitr r-testthat))
    (home-page "https://github.com/tkonopka/umap")
    (synopsis "Uniform manifold approximation and projection")
    (description
     "Uniform manifold approximation and projection is a technique for
dimension reduction.  This package provides an interface to the UMAP algorithm
in R, including a translation of the original algorithm into R.")
    (license license:expat)))

(define-public r-uwot
  (package
    (name "r-uwot")
    (version "0.2.3")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "uwot" version))
       (sha256
        (base32
         "1k1fcyrk2dhdwx511s4025v54k6y4s20qyspcba63nv52ygf9fgf"))))
    (build-system r-build-system)
    (propagated-inputs
     (list r-dqrng
           r-fnn
           r-irlba
           r-matrix
           r-rcpp
           r-rcppannoy
           r-rcppprogress
           r-rspectra))
    (native-inputs (list r-knitr r-testthat))
    (home-page "https://github.com/jlmelville/uwot")
    (synopsis "Uniform manifold approximation and projection")
    (description
     "This package provides an implementation of the Uniform Manifold
Approximation and Projection dimensionality reduction by McInnes et
al. (2018).  It also provides means to transform new data and to carry out
supervised dimensionality reduction.  An implementation of the related
LargeVis method of Tang et al. (2016) is also provided.")
    (license license:gpl3)))

(define-public r-kableextra
  (package
    (name "r-kableextra")
    (version "1.4.0")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "kableExtra" version))
       (sha256
        (base32
         "02blaamz6xkdwgyvw6akjhn5fvwy8l24k7nwqj2id6g8qagwrqlg"))))
    (properties `((upstream-name . "kableExtra")))
    (build-system r-build-system)
    (propagated-inputs
     (list r-digest
           r-htmltools
           r-knitr
           r-magrittr
           r-rmarkdown
           r-rstudioapi
           r-scales
           r-stringr
           r-svglite
           r-viridislite
           r-xml2))
    (native-inputs
     (list r-knitr r-testthat))
    (home-page "https://haozhu233.github.io/kableExtra/")
    (synopsis "Construct complex tables with pipe syntax")
    (description
     "Build complex HTML or LaTeX tables using @code{kable()} from
@code{knitr} and the piping syntax from @code{magrittr}.  The function
@code{kable()} is a light weight table generator coming from @code{knitr}.
This package simplifies the way to manipulate the HTML or LaTeX codes
generated by @code{kable()} and allows users to construct complex tables and
customize styles using a readable syntax.")
    (license license:expat)))

(define-public r-glasso
  (package
    (name "r-glasso")
    (version "1.11")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "glasso" version))
       (sha256
        (base32 "02p3612rpydk195n2qr77lp1j2w8zsw1ckkk98c8angm4r5q8dsc"))))
    (build-system r-build-system)
    (native-inputs (list gfortran))
    (home-page "https://statweb.stanford.edu/~tibs/glasso/")
    (synopsis "Graphical Lasso: estimation of Gaussian graphical models")
    (description
     "This is a package for estimation of a sparse inverse covariance matrix
using a lasso (L1) penalty.  Facilities are provided for estimates along a
path of values for the regularization parameter.")
    (license license:gpl2)))

(define-public r-glassofast
  (package
    (name "r-glassofast")
    (version "1.0.1")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "glassoFast" version))
       (sha256
        (base32 "0nyvmmrw6cr5j1mkf1qv6hn3q24kyn6gn48q6r7az4vn1m141hzz"))))
    (properties `((upstream-name . "glassoFast")))
    (build-system r-build-system)
    (native-inputs (list gfortran))
    (home-page "https://cran.r-project.org/package=glassoFast")
    (synopsis "Fast graphical LASSO")
    (description
     "This package provides a fast and improved implementation of the
graphical LASSO.")
    (license license:gpl3+)))

(define-public r-gldex
  (package
    (name "r-gldex")
    (version "2.0.0.9.3")
    (source (origin
              (method url-fetch)
              (uri (cran-uri "GLDEX" version))
              (sha256
               (base32
                "0xv9w4kmivmmcnn19a6s6d1ilhi1misdgrp07ks7rbd177zjy5vs"))))
    (properties `((upstream-name . "GLDEX")))
    (build-system r-build-system)
    (propagated-inputs (list r-cluster r-spacefillr))
    (home-page "https://cran.r-project.org/package=GLDEX")
    (synopsis "Fitting single and mixture of generalised lambda distributions")
    (description
     "@code{GLDEX} offers fitting algorithms corresponding to two major
objectives.  One is to provide a smoothing device to fit distributions to data
using the weighted and unweighted discretised approach based on the bin width
of the histogram.  The other is to provide a definitive fit to the data set
using the maximum likelihood and quantile matching estimation.  Other methods
such as moment matching, starship method, and L moment matching are also
provided.  Diagnostics on goodness of fit can be done via qqplots, KS-resample
tests and comparing mean, variance, skewness and kurtosis of the data with the
fitted distribution.")
    (license license:gpl3+)))

(define-public r-rhandsontable
  (package
    (name "r-rhandsontable")
    (version "0.3.8")
    (source (origin
              (method url-fetch)
              (uri (cran-uri "rhandsontable" version))
              (sha256
               (base32
                "07fj6npq65pq836vdwblkhprdaq4i4f13cwdmm9gmxrnk72xj7lh"))
              (modules '((guix build utils)))
              (snippet
               '(with-directory-excursion "inst/htmlwidgets/lib"
                  (for-each delete-file
                            '("chroma/chroma.min.js"
                              "handsontable/all.min.js"
                              "handsontable/handsontable.full.min.js"
                              "jquery/jquery.min.js"
                              "numbro/languages.min.js"
                              "sparkline/jquery.sparkline.min.js"))))))
    (properties `((upstream-name . "rhandsontable")))
    (build-system r-build-system)
    (arguments
     (list
      #:modules '((guix build utils)
                  (guix build r-build-system)
                  (srfi srfi-1))
      #:phases
      '(modify-phases %standard-phases
         (add-after 'unpack 'process-javascript
           (lambda* (#:key inputs #:allow-other-keys)
             (with-directory-excursion "inst/htmlwidgets/lib"
               ;; Generate languages.js by importing all numbro language
               ;; files.
               (with-output-to-file "/tmp/languages.js"
                 (lambda ()
                   (for-each
                    (lambda (file)
                      (format (current-output-port)
                              "require(\"~a/~a\")~%"
                              (dirname file)
                              (basename file ".js")))
                    (find-files (string-append (assoc-ref inputs "js-numbro")
                                               "/languages/")
                                "\\.js$"))))
               ;; Then bundle and minify it.
               (invoke "esbuild"
                       "/tmp/languages.js"
                       "--bundle"
                       "--minify"
                       "--outfile=numbro/languages.min.js")

               ;; Minify the other source files.
               (call-with-values
                   (lambda ()
                     (unzip2
                      `((,(search-input-file inputs "/chroma.js")
                         "chroma/chroma.min.js")
                        (,(search-input-file inputs "/dist/languages/all.js")
                         "handsontable/all.min.js")
                        (,(search-input-file inputs "/dist/handsontable.full.js")
                         "handsontable/handsontable.full.min.js")
                        (,(assoc-ref inputs "js-jquery-sparkline")
                         "sparkline/jquery.sparkline.min.js")
                        (,(assoc-ref inputs "js-jquery")
                         "jquery/jquery.min.js"))))
                 (lambda (sources targets)
                   (for-each (lambda (source target)
                               (format #true "Processing ~a --> ~a~%"
                                       source target)
                               (invoke "esbuild" source "--minify"
                                       (string-append "--outfile=" target)))
                             sources targets)))))))))
    (propagated-inputs (list r-htmlwidgets r-jsonlite r-magrittr))
    (native-inputs
     `(("esbuild" ,esbuild)
       ("r-knitr" ,r-knitr)
       ("js-chroma"
        ,(origin
           (method git-fetch)
           (uri (git-reference
                 (url "https://github.com/gka/chroma.js")
                 (commit "v1.3.3")))
           (file-name (git-file-name "chroma" "1.3.3"))
           (sha256
            (base32
             "091xn40n868pgb76gdl5jpg5gqqqzhykgxsslni230jzgc0hh1vm"))))
       ("js-handsontable"
        ,(origin
           (method git-fetch)
           (uri (git-reference
                 (url "https://github.com/handsontable/handsontable")
                 (commit "6.2.2")))
           (file-name (git-file-name "handsontable" "6.2.2"))
           (sha256
            (base32
             "1rq4l24m9yz5r4sagdhq78jcjxlyh0ngryp43p5k33q2l77l4cp8"))))
       ("js-jquery-sparkline"
        ,(origin
           (method url-fetch)
           (uri
            "https://omnipotent.net/jquery.sparkline/2.1.2/jquery.sparkline.js")
           (sha256
            (base32
             "0d28qg5wlv44l02xafla6h6fvl3a71r5w7k0xhadagighh5wnarg"))))
       ("js-jquery"
        ,(origin
           (method url-fetch)
           (uri "https://code.jquery.com/jquery-3.2.1.js")
           (sha256
            (base32
             "08dv528xy8ksrg5qqw73bvpjrzxv66xq41sfidn9ypgskwl2g40d"))))
       ;; We guessed the version based on
       ;; 62993ac9be3a1a4188150f7a6502b48b899f075e in
       ;; https://github.com/jrowen/rhandsontable, which added numbro's
       ;; languages.min.js.  This was committed in Nov 2018, so the most
       ;; recent release of numbro at that time would have been 2.0.6 from May
       ;; 2018.
       ("js-numbro"
        ,(origin
           (method git-fetch)
           (uri (git-reference
                 (url "https://github.com/BenjaminVanRyseghem/numbro")
                 (commit "2.0.6")))
           (file-name (git-file-name "numbro" "2.0.6"))
           (sha256
            (base32
             "1gsswkd482p0id00yx4q67ay0jvvwwidj71v41mq1cws8v2jjywx"))))))
    (home-page "https://jrowen.github.io/rhandsontable/")
    (synopsis "Htmlwidget based on the handsontable.js library")
    (description
     "Handsontable is a data grid component with an Excel like appearance.
Built in JavaScript, it integrates with any data source with peak efficiency.
It comes with powerful features like data validation, sorting, grouping, data
binding, formula support or column ordering.")
    (license license:expat)))

(define-public r-rhpcblasctl
  (package
    (name "r-rhpcblasctl")
    (version "0.23-42")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "RhpcBLASctl" version))
       (sha256
        (base32
         "05b6jhmxdr1rdpbvf5gwi9dqb57m8z2860qzkw5hcr72d5drv22w"))))
    (properties `((upstream-name . "RhpcBLASctl")))
    (build-system r-build-system)
    (home-page "https://prs.ism.ac.jp/~nakama/Rhpc/")
    (synopsis "Control the number of threads on BLAS")
    (description
     "This package allows you to control the number of threads the BLAS
library uses.  It is also possible to control the number of threads in
OpenMP.")
    (license license:agpl3+)))

(define-public r-rhub
  (package
    (name "r-rhub")
    (version "2.0.1")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "rhub" version))
       (sha256
        (base32 "0fc291gy7zpx6mcpfw5sjjmx4y7lxhzh6n61mwwmz96nn4qb2m1q"))))
    (properties
     '((upstream-name . "rhub")
       (updater-extra-native-inputs . ("r-knitr"))))
    (build-system r-build-system)
    (propagated-inputs (list r-callr
                             r-cli
                             r-curl
                             r-desc
                             r-gert
                             r-gitcreds
                             r-glue
                             r-jsonlite
                             r-pkgbuild
                             r-processx
                             r-r6
                             r-rappdirs
                             r-rematch
                             r-rprojroot
                             r-whoami))
    (native-inputs
     (list r-knitr r-mockery r-pillar r-testthat r-webfakes r-withr))
    (home-page "https://github.com/r-hub/rhub")
    (synopsis "Tools for R package developers")
    (description
     "R-hub uses GitHub Actions to run @code{R CMD} check and similar package
checks. The @code{rhub} package helps you set up R-hub for your R package, and
start running checks.")
    (license license:expat)))

(define-public r-lda
  (package
    (name "r-lda")
    (version "1.5.2")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "lda" version))
       (sha256
        (base32
         "1m0g2mz7rhjsp6pm784qjngzrb6kp69zjb85fflm48q0drw59lwm"))))
    (build-system r-build-system)
    (home-page "https://cran.r-project.org/web/packages/lda/")
    (synopsis "Collapsed Gibbs sampling methods for topic models")
    (description
     "This package implements @dfn{latent Dirichlet allocation} (LDA) and
related models.  This includes (but is not limited to) sLDA, corrLDA, and the
mixed-membership stochastic blockmodel.  Inference for all of these models is
implemented via a fast collapsed Gibbs sampler written in C.  Utility
functions for reading/writing data typically used in topic models, as well as
tools for examining posterior distributions are also included.")
    ;; Any version of the LGPL
    (license license:lgpl3+)))

(define-public r-rann-l1
  (package
    (name "r-rann-l1")
    (version "2.5.2")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "RANN.L1" version))
       (sha256
        (base32
         "1hanh3my84mdr5wy6b89fawqzfc184vff1y65wy4l5ld9qza1n44"))))
    (properties `((upstream-name . "RANN.L1")))
    (build-system r-build-system)
    (native-inputs (list r-testthat))
    (home-page "https://github.com/jefferis/RANN/tree/master-L1")
    (synopsis "Fast nearest neighbour search using L1 metric")
    (description
     "This package provides tools to find the k nearest neighbours for every
point in a given dataset in O(N log N) time using Arya and Mount's ANN
library.  There is support for approximate as well as exact searches, fixed
radius searches and @code{bd} as well as @code{kd} trees.  The distance is
computed using the L1 (Manhattan, taxicab) metric.")
    (license license:gpl3+)))

(define-public r-leiden
  (package
    (name "r-leiden")
    (version "0.4.3.1")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "leiden" version))
       (sha256
        (base32
         "1qihzjrwcb09aga27frcdrdv4dp0g295dbrk07fqykbjlb7vpv59"))))
    (properties `((upstream-name . "leiden")))
    (build-system r-build-system)
    (propagated-inputs
     (list r-igraph r-matrix r-reticulate))
    (native-inputs
     (list r-bipartite r-data-table r-knitr r-multiplex r-testthat r-tibble))
    (home-page "https://github.com/TomKellyGenetics/leiden")
    (synopsis "R implementation of Leiden clustering algorithm")
    (description
     "This package implements the Python @code{leidenalg} module to be called
in R.  It enables clustering using the Leiden algorithm for partitioning a
graph into communities.  See also Traag et al (2018) \"From Louvain to Leiden:
guaranteeing well-connected communities.\" <arXiv:1810.08473>.")
    (license license:gpl3)))

(define-public r-leidenalg
  (package
    (name "r-leidenalg")
    (version "1.1.5")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "leidenAlg" version))
       (sha256
        (base32 "1jr37afb4h2lgkw60nkcp08f4qwpnac6y297dam34yry5sy9dz02"))))
    (properties
     `((upstream-name . "leidenAlg")
       (updater-extra-inputs . ("gmp"))))
    (build-system r-build-system)
    (inputs
     (list glpk gmp libxml2))
    (propagated-inputs
     (list r-igraph
           r-matrix
           r-rcpp
           r-rcpparmadillo
           r-rcppeigen
           r-sccore))
    (native-inputs (list gfortran r-testthat))
    (home-page "https://github.com/kharchenkolab/leidenAlg")
    (synopsis "Leiden algorithm via an R interface")
    (description
     "This package implements an R interface to the Leiden algorithm, an
iterative community detection algorithm on networks.  The algorithm is
designed to converge to a partition in which all subsets of all communities
are locally optimally assigned, yielding communities guaranteed to be
connected.  The implementation proves to be fast, scales well, and can be run
on graphs of millions of nodes (as long as they can fit in memory).")
    ;; The DESCRIPTION file says GPL-3, but the code was copied from
    ;; https://github.com/vtraag/leidenalg, which is under GPLv3+.
    (license license:gpl3+)))

(define-public r-leidenbase
  (package
    (name "r-leidenbase")
    (version "0.1.35")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "leidenbase" version))
       (sha256
        (base32 "0zc0kzycv4446jq38w1aii2rfmhc37cframh4b1fqvbvjvxf2f83"))))
    (properties `((upstream-name . "leidenbase")))
    (build-system r-build-system)
    (inputs (list libxml2 zlib))
    (propagated-inputs (list r-igraph))
    (native-inputs (list gfortran pkg-config r-devtools r-knitr r-testthat))
    (home-page "https://github.com/cole-trapnell-lab/leidenbase")
    (synopsis
     "R and C/C++ wrappers to run Leiden community detection algorithm")
    (description
     "This package provides an R to C/C++ interface that runs the
Leiden community detection algorithm to find a basic partition.  It
runs the equivalent of the leidenalg @code{find_partition()} function.
This package includes the required source code files from the official
leidenalg distribution and functions from the R igraph package.")
    (license license:gpl3)))

(define-public r-patchwork
  (package
    (name "r-patchwork")
    (version "1.3.0")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "patchwork" version))
       (sha256
        (base32
         "05ifwnrvlxk95nafvba09i7gq35i5xyxja51bfdvvkmalk26xbvp"))))
    (build-system r-build-system)
    (propagated-inputs
     (list r-cli r-farver r-ggplot2 r-gtable r-rlang))
    (native-inputs
     (list r-knitr r-testthat r-vdiffr))
    (home-page "https://github.com/thomasp85/patchwork")
    (synopsis "Compose ggplot2 plots")
    (description
     "The @code{ggplot2} package provides a strong API for sequentially
building up a plot, but does not concern itself with composition of multiple
plots.  Patchwork is a package that expands the API to allow for arbitrarily
complex composition of plots by providing mathematical operators for combining
multiple plots.")
    (license license:expat)))

(define-public r-patrick
  (package
    (name "r-patrick")
    (version "0.3.0")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "patrick" version))
       (sha256
        (base32 "1gyzida6wj3adcjj3rc7amch0mvwchm4jyz1dbfw3sn4m3d6520l"))))
    (properties `((upstream-name . "patrick")))
    (build-system r-build-system)
    ;; One test fails.
    (arguments (list #:tests? #false))
    (propagated-inputs (list r-dplyr
                             r-glue
                             r-purrr
                             r-rlang
                             r-testthat
                             r-tibble))
    (native-inputs (list r-testthat))
    (home-page "https://github.com/google/patrick")
    (synopsis "Parameterized Unit Testing")
    (description
     "This is an extension of the @code{testthat} package that lets you add
parameters to your unit tests.  Parameterized unit tests are often easier to
read and more reliable, since they follow the DNRY (do not repeat yourself)
rule.")
    (license license:asl2.0)))

(define-public r-rliger
  (package
    (name "r-rliger")
    (version "0.4.2")
    (source
     (origin
       (method git-fetch)
       (uri (git-reference
             (url "https://github.com/MacoskoLab/liger")
             (commit (string-append "v" version))))
       (file-name (git-file-name name version))
       (sha256
        (base32
         "16dzwwcpw6n78pxlc5w3kraigki35ix7zhd2cbx5f3y60bbkhlmx"))
       (modules '((guix build utils)))
       (snippet
        '(delete-file "inst/java/ModularityOptimizer.jar"))))
    (build-system r-build-system)
    (arguments
     (list
      #:modules '((guix build r-build-system)
                  ((guix build ant-build-system) #:prefix ant:)
                  (guix build utils))
      #:imported-modules `((guix build ant-build-system)
                           ,@%r-build-system-modules)
      #:phases
      '(modify-phases %standard-phases
         (add-after 'unpack 'delete-bad-tests
           (lambda _
             ;; One test fails with: could not find function "theme_bw"
             (delete-file "tests/testthat/test_post_factorization.R")))
         (add-after 'unpack 'build-java-part
           (lambda* (#:key inputs #:allow-other-keys)
             (invoke "unzip" (assoc-ref inputs "optimizer-src"))
             (for-each (lambda (file) (invoke "javac" file))
                       (find-files "." "\\.java$"))

             ;; Create a simple manifest.
             (mkdir-p "META-INF")
             (with-output-to-file "META-INF/MANIFEST.MF"
               (lambda _
                 (display "\
Manifest-Version: 1.0
Main-Class: ModularityOptimizer\n")))

             ;; It is important that the manifest appears first.
             (apply invoke "jar" "cfm" "inst/java/ModularityOptimizer.jar"
                    "META-INF/MANIFEST.MF"
                    (find-files "." "\\.class$"))))
         (add-after 'install 'strip-jar-timestamps
           (assoc-ref ant:%standard-phases 'strip-jar-timestamps)))))
    (propagated-inputs
     (list r-cowplot
           r-dosnow
           r-dplyr
           r-fnn
           r-foreach
           r-ggplot2
           r-ggrepel
           r-hmisc
           r-ica
           r-irlba
           r-matrix
           r-mclust
           r-patchwork
           r-plyr
           r-rann-l1
           r-rcpp
           r-rcpparmadillo
           r-riverplot
           r-rtsne
           r-snow))
    (native-inputs
     `(("jdk" ,icedtea "jdk")
       ;; See https://github.com/MacoskoLab/liger/issues/96
       ;; The optimizer is released under the Expat license.
       ("optimizer-src"
        ,(origin
           (method url-fetch)
           (uri "http://www.ludowaltman.nl/slm/modularity_optimizer_source.zip")
           (sha256
            (base32
             "01hmm6sapcmldvayknqx2w4cav3qv71mwwkdkwj4qgq6dss09g18"))))
       ("unzip" ,unzip)
       ("zip" ,zip)
       ("r-knitr" ,r-knitr)           ;for vignettes
       ("r-testthat" ,r-testthat)))
    (home-page "https://github.com/MacoskoLab/liger")
    (synopsis "Integrate and analyze multiple single-cell datasets")
    (description
     "LIGER is a package for integrating and analyzing multiple single-cell
datasets, developed and maintained by the Macosko lab.  It relies on
integrative non-negative matrix factorization to identify shared and
dataset-specific factors.")
    (license license:gpl3)))

(define-public r-liger
  (deprecated-package "r-liger" r-rliger))

(define-public r-harmony
  (package
    (name "r-harmony")
    (version "1.2.3")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "harmony" version))
       (sha256
        (base32 "1pdxdfk6xcaza66ibilspsn3db9w9kxf73dl5dmp59k00amibf4s"))))
    (properties `((upstream-name . "harmony")))
    (build-system r-build-system)
    (propagated-inputs (list r-cowplot
                             r-dplyr
                             r-ggplot2
                             r-matrix
                             r-rcpp
                             r-rcpparmadillo
                             r-rcppprogress
                             r-rhpcblasctl
                             r-rlang
                             r-tibble))
    (native-inputs (list r-knitr r-testthat))
    (home-page "https://cran.r-project.org/web/packages/harmony/index.html")
    (synopsis "Integration of single cell sequencing data")
    (description
     "This package provides an implementation of the Harmony algorithm for
single cell integration.  This package includes a standalone Harmony function
and interfaces to external frameworks.")
    (license license:gpl3)))

(define-public r-covr
  (package
    (name "r-covr")
    (version "3.6.4")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "covr" version))
       (sha256
        (base32 "0al6n4gnnvgxk968skqnajpqpqyl6kpam3fmn782kihhcl1h8qib"))
       (modules '((guix build utils)))
       ;; TODO: still need to replace highlight.js/highlight.pack.js
       (snippet
        '(with-directory-excursion "inst/www/shared"
           (for-each delete-file
                     '("bootstrap/js/bootstrap.min.js"
                       "bootstrap/shim/html5shiv.min.js"
                       "bootstrap/shim/respond.min.js"))))))
    (properties `((upstream-name . "covr")))
    (build-system r-build-system)
    (arguments
     (list
      #:modules '((guix build utils)
                  (guix build r-build-system)
                  (srfi srfi-1))
      #:phases
      #~(modify-phases %standard-phases
          (add-after 'unpack 'process-javascript
            (lambda* (#:key inputs #:allow-other-keys)
              (with-directory-excursion "inst/www/shared"
                (call-with-values
                    (lambda ()
                      (unzip2
                       `((,(search-input-file inputs "/dist/js/bootstrap.js")
                          "bootstrap/js/bootstrap.min.js")
                         (,(search-input-file inputs "/dist/html5shiv.js")
                          "bootstrap/shim/html5shiv.min.js")
                         (,(search-input-file inputs "/dest/respond.src.js")
                          "bootstrap/shim/respond.min.js"))))
                  (lambda (sources targets)
                    (for-each (lambda (source target)
                                (format #true "Processing ~a --> ~a~%"
                                        source target)
                                (invoke "esbuild" source "--minify"
                                        (string-append "--outfile=" target)))
                              sources targets)))))))))
    (propagated-inputs
     (list r-crayon
           r-digest
           r-httr
           r-jsonlite
           r-rex
           r-withr
           r-yaml))
    (native-inputs
     (list esbuild
           r-dt
           r-htmltools
           r-knitr  ;for vignettes
           r-memoise
           r-mockery
           r-rstudioapi
           r-testthat
           r-xml2
           (let ((version "3.3.5"))
             (origin
               (method git-fetch)
               (uri (git-reference
                     (url "https://github.com/twbs/bootstrap")
                     (commit (string-append "v" version))))
               (file-name (git-file-name "js-bootstrap" version))
               (sha256
                (base32
                 "1zxrjhnnd594rflnwzqhbx3rx0gjlh6hgx9v2nppgkmrkqb7y1a4"))))
           (let ((version "3.7.2"))
             (origin
               (method git-fetch)
               (uri (git-reference
                     (url "https://github.com/aFarkas/html5shiv")
                     (commit version)))
               (file-name (git-file-name "js-html5shiv" version))
               (sha256
                (base32
                 "0mw4bbl9a9d1ibywscjgmbky0jkj4081l1yd4x3ss0flwaa3fwsk"))))
           (let ((version "1.4.2"))
             (origin
               (method git-fetch)
               (uri (git-reference
                     (url "https://github.com/scottjehl/Respond")
                     (commit version)))
               (file-name (git-file-name "js-respond" version))
               (sha256
                (base32
                 "00xid731rirc7sdy1gc8qal3v9g0agr2qx15hm4x97l1lcbylyn2"))))))
    (home-page "https://github.com/r-lib/covr")
    (synopsis "Test coverage for R packages")
    (description
     "Thisp package enables you to track and report code coverage for your
package and (optionally) upload the results to a coverage service.  Code
coverage is a measure of the amount of code being exercised by a set of tests.
It is an indirect measure of test quality and completeness.  This package is
compatible with any testing methodology or framework and tracks coverage of
both R code and compiled C/C++/FORTRAN code.")
    (license license:gpl3)))

(define-public r-systemfonts
  (package
    (name "r-systemfonts")
    (version "1.2.3")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "systemfonts" version))
       (sha256
        (base32
         "1yly20fb45cjyxf92p1i41r9cfd2ar4f6rkcjq3rb03sflb1lv6s"))))
    (properties `((upstream-name . "systemfonts")))
    (build-system r-build-system)
    (propagated-inputs
     (list r-base64enc r-cpp11 r-jsonlite r-lifecycle))
    (inputs
     (list fontconfig freetype zlib))
    (native-inputs
     (list pkg-config r-knitr r-testthat))
    (home-page "https://github.com/r-lib/systemfonts")
    (synopsis "System native font finding")
    (description
     "This package provides system native access to the font catalogue.  As
font handling varies between systems it is difficult to correctly locate
installed fonts across different operating systems.  The 'systemfonts' package
provides bindings to the native libraries for finding font files that can then
be used further by e.g. graphic devices.")
    (license license:expat)))

(define-public r-graphlayouts
  (package
    (name "r-graphlayouts")
    (version "1.2.2")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "graphlayouts" version))
       (sha256
        (base32
         "0bz8q6pnjzvvy1ks883hz4h5dmr6sql47wnc2y18kfjkzq4g2j28"))))
    (properties `((upstream-name . "graphlayouts")))
    (build-system r-build-system)
    (propagated-inputs
     (list r-igraph r-rcpp r-rcpparmadillo))
    (native-inputs (list r-testthat))
    (home-page "https://github.com/schochastics/graphlayouts")
    (synopsis "Additional layout algorithms for network visualizations")
    (description
     "This package provides several layout algorithms to visualize networks
which are not part of the igraph library.  Most are based on the concept of
stress majorization by Gansner et al. (2004)
<doi:10.1007/978-3-540-31843-9_25>.  Some more specific algorithms
emphasize hidden group structures in networks or focus on specific nodes.")
    (license license:expat)))

(define-public r-terra
  (package
    (name "r-terra")
    (version "1.8-50")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "terra" version))
       (sha256
        (base32
         "1vsl8v2n57i4rpq4v29g2g5k0nba348qhiszdr9knqm9il9pq82y"))))
    (properties
     '((upstream-name . "terra")
       (updater-ignored-inputs . ("openssh" "openssl"))))
    (build-system r-build-system)
    (inputs
     (list curl
           gdal
           geos
           netcdf
           pcre2
           proj
           sqlite
           tbb
           zlib))
    (propagated-inputs
     (list r-rcpp))
    (native-inputs
     (list pkg-config r-tinytest))
    (home-page "https://rspatial.org/terra")
    (synopsis "Spatial data analysis")
    (description
     "This package provides methods for spatial data analysis, especially
raster data.  The included methods allow for low-level data manipulation as
well as high-level global, local, zonal, and focal computation.  The predict
and interpolate methods facilitate the use of regression type (interpolation,
machine learning) models for spatial prediction.  Processing of very large
files is supported.")
    (license license:gpl3+)))

(define-public r-tidygraph
  (package
    (name "r-tidygraph")
    (version "1.3.1")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "tidygraph" version))
       (sha256
        (base32
         "06mc31yb771midi8lq0zdfymcsm2s4y1mqdxxjz1n24njfxx9hda"))))
    (properties `((upstream-name . "tidygraph")))
    (build-system r-build-system)
    (propagated-inputs
     (list r-cli
           r-cpp11
           r-dplyr
           r-igraph
           r-lifecycle
           r-magrittr
           r-pillar
           r-r6
           r-rlang
           r-tibble
           r-tidyr))
    (native-inputs (list r-testthat))
    (home-page "https://github.com/thomasp85/tidygraph")
    (synopsis "Tidy API for graph manipulation")
    (description
     "This package provides a graph implementation that can be thought of as
two tidy data frames describing node and edge data respectively.  It provides
an approach to manipulate these two virtual data frames using the API defined
in the @code{dplyr} package, and it also provides tidy interfaces to a lot of
common graph algorithms.")
    (license license:expat)))

(define-public r-soupx
  (let ((commit "a3354be76fb52fd795be6ddf163cf056c05c6cb8")
        (revision "1"))
    (package
      (name "r-soupx")
      (version (git-version "0.3.1" revision commit))
      (source
       (origin
         (method git-fetch)
         (uri (git-reference
               (url "https://github.com/constantAmateur/SoupX")
               (commit commit)))
         (file-name (git-file-name name version))
         (sha256
          (base32
           "1zmlyzrl0fz6l79gn2wswid670p88mm3y292is89sa5p3h7frr99"))))
      (properties `((upstream-name . "SoupX")))
      (build-system r-build-system)
      (propagated-inputs
       (list r-ggplot2 r-matrix r-seurat))
      (home-page "https://github.com/constantAmateur/SoupX")
      (synopsis "Single cell mRNA Soup eXterminator")
      (description
       "This package provides a package for quantifying, profiling and
removing cell free mRNA contamination (the \"soup\") from droplet based single
cell RNA-seq experiments.")
      (license license:gpl2))))

(define-public r-assertr
  (package
    (name "r-assertr")
    (version "3.0.1")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "assertr" version))
       (sha256
        (base32
         "0g7h88kkls6v1nfzbar40y56yv3lkqb7vrcy63xqgc99zcf8k4bc"))))
    (build-system r-build-system)
    (propagated-inputs
     (list r-dplyr r-mass r-rlang))
    (native-inputs
     (list r-knitr r-testthat))           ; needed for vignette
    (home-page "https://github.com/ropensci/assertr")
    (synopsis "Assertive programming for R analysis pipelines")
    (description
     "This package provides functionality to assert conditions that have to be
met so that errors in data used in analysis pipelines can fail quickly.  It is
similar to @code{stopifnot()} but more powerful, friendly, and easier for use
in pipelines.")
    (license license:expat)))

(define-public r-parameters
  (package
    (name "r-parameters")
    (version "0.26.0")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "parameters" version))
       (sha256
        (base32
         "010qkk20bd8lr4gi1fawdjzghf6xczg7pb7cyfknjbc74lnl22kg"))))
    (properties `((upstream-name . "parameters")))
    (build-system r-build-system)
    (propagated-inputs
     (list r-bayestestr r-datawizard r-insight))
    (native-inputs
     ;; There are dozens of packages that the importer detects for tests, but
     ;; they don't actually seem to be required.
     (list r-knitr r-testthat))
    (home-page "https://cran.r-project.org/web/packages/parameters")
    (synopsis "Processing of model parameters")
    (description
     "This package provides utilities for processing the parameters of various
statistical models.  Beyond computing p values, CIs, and other indices for a
wide variety of models, this package implements features like standardization
or bootstrapping of parameters and models, feature reduction (feature
extraction and variable selection) as well as conversion between indices of
effect size.")
    (license license:gpl3)))

(define-public r-insol
  (package
    (name "r-insol")
    (version "1.2.2")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "insol" version))
       (sha256
        (base32
         "166kgxgzbh55y2qqya6c2si22x0v7asi70im054g6xxwc5187kh3"))))
    (properties `((upstream-name . "insol")))
    (build-system r-build-system)
    (propagated-inputs
     (list r-raster))
    (native-inputs
     (list gfortran))
    (home-page "https://meteoexploration.com/R/insol/index.html")
    (synopsis "Tools for calculating solar radiation")
    (description
     "This package provides functions to compute insolation on tilted
surfaces, computes atmospheric transmittance and related parameters such as:
Earth radius vector, declination, sunset and sunrise, daylength, equation of
time, vector in the direction of the sun, vector normal to surface, and some
atmospheric physics.")
    (license license:gpl2+)))

(define-public r-lifecycle
  (package
    (name "r-lifecycle")
    (version "1.0.4")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "lifecycle" version))
       (sha256
        (base32
         "1k4ibf2x90xgmzaq47vf9wrsh6a2fp2lg1l8bq89632bx33x795d"))))
    (properties
     ;; We can't add this here because via r-stringr this package ends up
     ;; being an input to r-knitr.
     '((updater-ignored-native-inputs . ("r-knitr" "r-testthat"))
       (upstream-name . "lifecycle")))
    (build-system r-build-system)
    ;; Tests require r-testthat, which uses this package.
    (arguments (list #:tests? #false))
    (propagated-inputs
     (list r-cli r-glue r-rlang))
    (home-page "https://github.com/r-lib/lifecycle")
    (synopsis "Manage the life cycle of your package functions")
    (description
     "Manage the life cycle of your exported functions with shared
conventions, documentation badges, and non-invasive deprecation warnings.  The
lifecycle package defines four development stages (experimental, maturing,
stable, and questioning) and three deprecation stages (soft-deprecated,
deprecated, and defunct).  It makes it easy to insert badges corresponding to
these stages in your documentation.  Usage of deprecated functions are
signalled with increasing levels of non-invasive verbosity.")
    (license license:gpl3)))

(define-public r-assertable
  (package
    (name "r-assertable")
    (version "0.2.8")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "assertable" version))
       (sha256
        (base32
         "1cciil1nzxd8gbj49w99jiv077lbpb59vx7bmb4p218aj2h5hqq4"))))
    (build-system r-build-system)
    (propagated-inputs
     (list r-data-table))
    (native-inputs
     (list r-knitr))
    (home-page "https://cran.r-project.org/web/packages/assertable/")
    (synopsis "Verbose assertions for tabular data (data.frames and data.tables)")
    (description "This package provides simple, flexible assertions on
data.frame or data.table objects with verbose output for vetting.  While other
assertion packages apply towards more general use-cases, @code{assertable} is
tailored towards tabular data.  It includes functions to check variable names
and values, whether the dataset contains all combinations of a given set of
unique identifiers, and whether it is a certain length.  In addition,
@code{assertable} includes utility functions to check the existence of target
files and to efficiently import multiple tabular data files into one
data.table.")
    (license license:gpl3)))

(define-public r-quadprog
  (package
    (name "r-quadprog")
    (version "1.5-8")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "quadprog" version))
       (sha256
        (base32 "1ka9g8zak8sg4y2xbz93dfrldznlk9qpd4pq9z21cdcdn3b8s4i2"))))
    (build-system r-build-system)
    (native-inputs
     (list gfortran))
    (home-page "https://cran.r-project.org/web/packages/quadprog")
    (synopsis "Functions to solve quadratic programming problems")
    (description
     "This package contains routines and documentation for solving quadratic
programming problems.")
    (license license:gpl3+)))

(define-public r-desolve
  (package
    (name "r-desolve")
    (version "1.40")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "deSolve" version))
       (sha256
        (base32 "1vq0yli1pkk3z92x1jgm4z19zwwhnwqdxvj4k2dmcnw7nrmsw2cc"))))
    (properties `((upstream-name . "deSolve")))
    (build-system r-build-system)
    (native-inputs
     (list gfortran))
    (home-page "https://desolve.r-forge.r-project.org/")
    (synopsis "Solvers for initial value problems of differential equations")
    (description "This package provides functions that solve initial value
problems of a system of first-order @dfn{ordinary differential
equations} (ODE), of @dfn{partial differential equations} (PDE), of
@dfn{differential algebraic equations} (DAE), and of delay differential
equations.  The functions provide an interface to the FORTRAN functions
@code{lsoda}, @code{lsodar}, @code{lsode}, @code{lsodes} of the ODEPACK
collection, to the FORTRAN functions @code{dvode} and @code{daspk} and a
C-implementation of solvers of the Runge-Kutta family with fixed or variable
time steps.  The package contains routines designed for solving ODEs resulting
from 1-D, 2-D and 3-D partial differential equations that have been converted
to ODEs by numerical differencing.")
    (license license:gpl2+)))

(define-public r-pmcmrplus
  (package
    (name "r-pmcmrplus")
    (version "1.9.12")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "PMCMRplus" version))
       (sha256
        (base32 "1ccmwpkr7vib7fflwmi45bgazsarnys9j1bsj10vn0kqw2ya3hay"))))
    (properties `((upstream-name . "PMCMRplus")))
    (build-system r-build-system)
    (inputs (list gmp))
    (propagated-inputs
     (list r-bwstest
           r-gmp
           r-ksamples
           r-mass
           r-multcompview
           r-mvtnorm
           r-rmpfr
           r-suppdists))
    (native-inputs (list gfortran r-knitr r-rmarkdown))
    (home-page "https://cran.r-project.org/package=PMCMRplus")
    (synopsis "Calculate pairwise multiple comparisons of mean rank sums extended")
    (description
     "This package provides multiple pairwise tests.")
    (license license:gpl3+)))

(define-public r-pracma
  (package
    (name "r-pracma")
    (version "2.4.4")
    (source (origin
              (method url-fetch)
              (uri (cran-uri "pracma" version))
              (sha256
               (base32 "0zxsqr7f4pcr1nmbbzliihyldv091ykzajv1mbdrkycp46pz6khs"))))
    (build-system r-build-system)
    (home-page "https://cran.r-project.org/web/packages/pracma/")
    (synopsis "Practical numerical math functions")
    (description "This package provides functions for numerical analysis and
linear algebra, numerical optimization, differential equations, plus some
special functions.  It uses Matlab function names where appropriate to simplify
porting.")
    (license license:gpl3+)))

(define-public r-subplex
  (package
    (name "r-subplex")
    (version "1.9")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "subplex" version))
       (sha256
        (base32
         "1dv9bpwm7ml662yrc2jnrjf4f8n1g5rfiipq6z0fx9j6pa6fma87"))))
    (build-system r-build-system)
    (native-inputs
     (list gfortran))
    (home-page "https://cran.r-project.org/web/packages/subplex")
    (synopsis "Unconstrained optimization using the subplex algorithm")
    (description
     "This package implements the Subplex optimization algorithm.
It solves unconstrained optimization problems using a simplex method on
subspaces.  The method is well suited for optimizing objective functions that
are noisy or are discontinuous at the solution.")
    (license license:gpl3+)))

(define-public r-txtplot
  (package
    (name "r-txtplot")
    (version "1.0-5")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "txtplot" version))
       (sha256
        (base32
         "01djrb9nz39bd470c8bgy1xi24nav12j9j44xzzdv5rbag4lkfyf"))))
    (build-system r-build-system)
    (propagated-inputs (list r-matrix))
    (home-page "https://cran.r-project.org/web/packages/txtplot/")
    (synopsis "Text-based plotting")
    (description "This package provides functions to produce rudimentary ASCII
graphics directly in the terminal window.  This package provides a basic
plotting function (and equivalents of curve, density, acf and barplot) as well
as a boxplot function.")
    (license license:lgpl3+)))

(define-public r-bio3d
  (package
    (name "r-bio3d")
    (version "2.4-5")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "bio3d" version))
       (sha256
        (base32
         "0k6ji9n0pbkbvrinx3x2av39gmkp9ik2bgf9nqx11nv49nkff9rx"))))
    (properties `((upstream-name . "bio3d")))
    (build-system r-build-system)
    (inputs (list zlib))
    (propagated-inputs (list r-rcpp))
    (native-inputs
     (list r-knitr r-testthat))
    (home-page "http://thegrantlab.org/bio3d/")
    (synopsis "Biological structure analysis")
    (description
     "This package provides utilities to process, organize and explore protein
structure, sequence and dynamics data.  Features include the ability to read
and write structure, sequence and dynamic trajectory data, perform sequence
and structure database searches, data summaries, atom selection, alignment,
superposition, rigid core identification, clustering, torsion analysis,
distance matrix analysis, structure and sequence conservation analysis, normal
mode analysis, principal component analysis of heterogeneous structure data,
and correlation network analysis from normal mode and molecular dynamics data.
In addition, various utility functions are provided to enable the statistical
and graphical power of the R environment to work with biological sequence and
structural data.")
    (license license:gpl2+)))

(define-public r-bios2cor
  (package
    (name "r-bios2cor")
    (version "2.2.2")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "Bios2cor" version))
       (sha256
        (base32
         "0y61g3l3g9918sa51imsk4kidyyrg7k1n3rdisrld1g6ckfarz62"))))
    (properties `((upstream-name . "Bios2cor")))
    (build-system r-build-system)
    (propagated-inputs
     (list r-bigmemory r-bio3d r-circular r-igraph))
    (home-page "https://cran.r-project.org/web/packages/Bios2cor/")
    (synopsis "From biological sequences and simulations to correlation analysis")
    (description
     "This package provides utilities for computation and analysis of
correlation/covariation in multiple sequence alignments and in side chain
motions during molecular dynamics simulations.  Features include the
computation of correlation/covariation scores using a variety of scoring
functions between either sequence positions in alignments or side chain
dihedral angles in molecular dynamics simulations and utilities to analyze the
correlation/covariation matrix through a variety of tools including network
representation and principal components analysis.  In addition, several
utility functions are based on the R graphical environment to provide friendly
tools for help in data interpretation.")
    (license license:gpl2+)))

;; This package includes minified JavaScript files.  When upgrading please
;; check that there are no new minified JavaScript files.
(define-public r-networkd3
  (package
    (name "r-networkd3")
    (version "0.4.1")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "networkD3" version))
       (sha256
        (base32
         "0kpn4n4n4b2myzdv9cnsn8a0gvyvy85cajd1ab6v28ipvnjnmqsv"))
       (snippet
        '(delete-file "inst/htmlwidgets/lib/d3-4.9.1/d3.min.js"))))
    (properties `((upstream-name . "networkD3")))
    (build-system r-build-system)
    (arguments
     (list
      #:modules '((guix build r-build-system)
                  (guix build minify-build-system)
                  (guix build utils)
                  (ice-9 match))
      #:imported-modules `(,@%r-build-system-modules
                           (guix build minify-build-system))
      #:phases
      #~(modify-phases (@ (guix build r-build-system) %standard-phases)
          (add-after 'unpack 'process-javascript
            (lambda* (#:key inputs #:allow-other-keys)
              (with-directory-excursion "inst/htmlwidgets/lib/"
                (minify (assoc-ref inputs "d3.v4.js")
                        #:target
                        "d3-4.9.1/d3.min.js")))))))
    (native-inputs
     `(("esbuild" ,esbuild)
       ;; NOTE: Make sure that this version of d3 is still valid when
       ;; upgrading the package.
       ("d3.v4.js"
        ,(origin
           (method url-fetch)
           (uri "https://web.archive.org/web/20170701121514id_/https://d3js.org/d3.v4.js")
           (sha256
            (base32
             "176a0n73rqqcsrjbp39c2jsl7hmprpwwggfm2skn9qywwyb79hp7"))))))
    (propagated-inputs
     (list r-data-tree r-htmlwidgets r-igraph r-jsonlite r-magrittr))
    (home-page "https://cran.r-project.org/package=networkD3")
    (synopsis "D3 JavaScript network graphs from R")
    (description
     "This package creates D3 JavaScript network, tree, dendrogram, and Sankey
graphs from R.")
    (license license:gpl3+)))

(define-public r-aasea
  (package
    (name "r-aasea")
    (version "1.1.0")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "aaSEA" version))
       (sha256
        (base32
         "0him4r8qyp0xssgrmdxjs45yn4d28h5anv4jyxxbbs9phb0m6j3h"))))
    (properties `((upstream-name . "aaSEA")))
    (build-system r-build-system)
    (propagated-inputs
     (list r-bios2cor
           r-dt
           r-hmisc
           r-magrittr
           r-networkd3
           r-plotly
           r-seqinr
           r-shiny
           r-shinydashboard))
    (home-page "https://cran.r-project.org/web/packages/aaSEA/")
    (synopsis "Amino acid substitution effect analyzer")
    (description
     "Given a protein multiple sequence alignment, it is a daunting task to
assess the effects of substitutions along sequence length.  The aaSEA package
is intended to help researchers to rapidly analyze property changes caused by
single, multiple and correlated amino acid substitutions in proteins.")
    (license license:gpl3)))

(define-public r-abacus
  (package
    (name "r-abacus")
    (version "1.0.0")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "ABACUS" version))
       (sha256
        (base32
         "0m1dnkwjr1522l9ddbzzx7ayxvli17sbmk6s28adpmzzjwh2kd1i"))))
    (properties `((upstream-name . "ABACUS")))
    (build-system r-build-system)
    (propagated-inputs
     (list r-ggplot2 r-shiny))
    (home-page "https://shiny.abdn.ac.uk/Stats/apps/")
    (synopsis "Apps-based activities for communicating and understanding statistics")
    (description
     "This package provides a set of Shiny apps for effective communication
and understanding in statistics.  The current version includes properties of
normal distribution, properties of sampling distribution, one-sample z and t
tests, two samples independent (unpaired) t test and analysis of variance.")
    (license license:gpl3)))

(define-public r-abc-rap
  (package
    (name "r-abc-rap")
    (version "0.9.0")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "ABC.RAP" version))
       (sha256
        (base32
         "1kdspln17v0krvahcd55vib4dv5azp60b3r1zf489x10qqbp1mxk"))))
    (properties `((upstream-name . "ABC.RAP")))
    (build-system r-build-system)
    (home-page "https://cran.r-project.org/web/packages/ABC.RAP/")
    (synopsis "Array-based CpG region analysis pipeline")
    (description
     "This package aims to identify candidate genes that are differentially
methylated between cases and controls.  It applies Student's t-test and delta
beta analysis to identify candidate genes containing multiple CpG sites.")
    (license license:gpl3)))

(define-public r-abcadm
  (package
    (name "r-abcadm")
    (version "1.0")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "abcADM" version))
       (sha256
        (base32
         "0vcabnnnwc0psv9v3rda5aap9s8cq1pjh02zva3ki64hlavf2a10"))))
    (properties `((upstream-name . "abcADM")))
    (build-system r-build-system)
    (propagated-inputs
     (list r-bh r-rcpp))
    (home-page "https://cran.r-project.org/web/packages/abcADM/")
    (synopsis "Fit accumulated damage models and estimate reliability using ABC")
    (description
     "This package provides tools to estimate parameters of accumulated
damage (load duration) models based on failure time data under a Bayesian
framework, using @dfn{Approximate Bayesian Computation} (ABC), and to assess
long-term reliability under stochastic load profiles.")
    (license license:gpl3)))

(define-public r-rglpk
  (package
    (name "r-rglpk")
    (version "0.6-5.1")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "Rglpk" version))
       (sha256
        (base32
         "1jdnkjzwbqmyg7fsay4rhscchg69gyhk9f73mlbfzpz9hz2bha75"))))
    (properties `((upstream-name . "Rglpk")))
    (build-system r-build-system)
    (propagated-inputs
     (list r-slam))
    (inputs
     (list glpk))
    (home-page "https://r-forge.r-project.org/projects/rglp/")
    (synopsis "R interface to the GNU Linear Programming Kit")
    (description
     "This package provides an R interface to the GNU Linear Programming Kit,
software for solving large-scale @dfn{linear programming} (LP), @dfn{mixed
integer linear programming} (MILP) and other related problems.")
    ;; Either license
    (license (list license:gpl2 license:gpl3))))

(define-public r-abcdefba
  (package
    (name "r-abcdefba")
    (version "0.4")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "abcdeFBA" version))
       (sha256
        (base32
         "1rxjripy8v6bxi25vdfjnbk24zkmf752qbl73cin6nvnqflwxkx4"))))
    (properties `((upstream-name . "abcdeFBA")))
    (build-system r-build-system)
    (propagated-inputs
     (list r-corrplot r-lattice r-rgl r-rglpk))
    (home-page "https://cran.r-project.org/web/packages/abcdeFBA/")
    (synopsis "A-Biologist-Can-Do-Everything of Flux Balance Analysis with this package")
    (description
     "This package provides functions for Constraint Based Simulation using
Flux Balance Analysis and informative analysis of the data generated during
simulation.")
    (license license:gpl2)))

(define-public r-abcrlda
  (package
    (name "r-abcrlda")
    (version "1.0.3")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "abcrlda" version))
       (sha256
        (base32
         "04pcdnk2szfpc2ylcw5ds7y895ivy03bycal03kxw7cwylzxasks"))))
    (properties `((upstream-name . "abcrlda")))
    (build-system r-build-system)
    (home-page "https://ieeexplore.ieee.org/document/8720003/")
    (synopsis "Asymptotically bias-corrected regularized linear discriminant analysis")
    (description
     "This package offers methods to perform @dfn{asymptotically
bias-corrected regularized linear discriminant analysis} (ABC_RLDA) for
cost-sensitive binary classification.  The bias-correction is an estimate of
the bias term added to regularized discriminant analysis that minimizes the
overall risk.")
    (license license:gpl3)))

(define-public r-abemus
  (package
    (name "r-abemus")
    (version "1.0.1")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "abemus" version))
       (sha256
        (base32
         "1dhllb184byp1yl15rg2w02zgw3iajag7cxshirg47mnmm7n70bb"))))
    (properties `((upstream-name . "abemus")))
    (build-system r-build-system)
    (propagated-inputs
     (list r-data-table))
    (home-page "https://cran.r-project.org/web/packages/abemus/")
    (synopsis "Adaptive base error model in ultra-deep sequencing data")
    (description
     "This package provides an implementation of @dfn{Adaptive Base Error
Model in Ultra-deep Sequencing data} (ABEMUS), which combines
platform-specific genetic knowledge and empirical signal to readily detect and
quantify somatic @dfn{single nucleotide variants} (SNVs) in @dfn{circulating
cell free DNA} (cfDNA).")
    (license license:gpl3)))

;; This package includes minified JavaScript files.  When upgrading please
;; check that there are no new minified JavaScript files.
(define-public r-rintrojs
  (package
    (name "r-rintrojs")
    (version "0.3.4")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "rintrojs" version))
       (sha256
        (base32
         "12944h3h6131l916bsz6vmccq8pvq831b52s3wb1hpwygqfj0a6l"))
       (snippet
        '(delete-file "inst/javascript/introjs/intro.min.js"))))
    (properties `((upstream-name . "rintrojs")))
    (build-system r-build-system)
    (arguments
     `(#:phases
       (modify-phases %standard-phases
         (add-after 'unpack 'process-javascript
           (lambda* (#:key inputs #:allow-other-keys)
             (with-directory-excursion "inst/javascript/introjs/"
               (let ((source (assoc-ref inputs "intro.js"))
                     (target "intro.min.js"))
                 (format #true "Processing ~a --> ~a~%"
                         source target)
                 (invoke "esbuild" source "--minify"
                         (string-append "--outfile=" target)))))))))
    (native-inputs
     `(("esbuild" ,esbuild)
       ("intro.js"
        ,(origin
           (method url-fetch)
           (uri "https://cdn.jsdelivr.net/npm/intro.js@3.2.1/intro.js")
           (sha256
            (base32
             "0vh5n7hqqyx2pdvlqq6xadfqibcn78h5961rwhpf817kpxfzv8v7"))))
       ("r-testthat" ,r-testthat)))
    (propagated-inputs
     (list r-jsonlite r-shiny))
    (home-page "https://github.com/carlganz/rintrojs")
    (synopsis "Wrapper for the Intro.js library")
    (description
     "This package provides a wrapper for the @url{http://www.introjs.com,
Intro.js} library.  This package makes it easy to include step-by-step
introductions, and clickable hints in a Shiny application.  It supports both
static introductions in the UI, and programmatic introductions from the
server-side.")
    ;; The intro.js library is licensed under Expat.
    (license (list license:agpl3+ license:expat))))

(define-public r-sysfonts
  (package
    (name "r-sysfonts")
    (version "0.8.9")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "sysfonts" version))
       (sha256
        (base32
         "124zcnw88xnlhx27qjm07mw59f98jiwspmm65v94k815lqs9qiaj"))))
    (properties `((upstream-name . "sysfonts")))
    (build-system r-build-system)
    (inputs
     (list freetype libpng zlib))
    (native-inputs
     (list pkg-config))
    (home-page "https://github.com/yixuan/sysfonts")
    (synopsis "Loading fonts into R")
    (description
     "This is a package to simplify loading of system fonts and Google Fonts
into R, in order to support other packages.")
    (license license:gpl2)))

(define-public r-showtextdb
  (package
    (name "r-showtextdb")
    (version "3.0")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "showtextdb" version))
       (sha256
        (base32
         "0hlnc3fhgrdkd46n7hb6id0gg1v0bf8s4679nrr7rchyp455szq2"))))
    (properties `((upstream-name . "showtextdb")))
    (build-system r-build-system)
    (propagated-inputs
     (list r-sysfonts))
    (home-page "https://cran.r-project.org/web/packages/showtextdb/")
    (synopsis "Font files for the 'showtext' package")
    (description
     "This package provides font files that can be used by the @code{showtext}
package.")
    (license license:asl2.0)))

(define-public r-showtext
  (package
    (name "r-showtext")
    (version "0.9-7")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "showtext" version))
       (sha256
        (base32
         "12a8j87ca39fd8vn9ixzfgkbffz8ajyslhsx2hqjry1gzbk864i5"))))
    (properties `((upstream-name . "showtext")))
    (build-system r-build-system)
    (inputs
     (list freetype libpng zlib))
    (propagated-inputs
     (list r-showtextdb r-sysfonts))
    (native-inputs
     (list pkg-config r-knitr r-rmarkdown))
    (home-page "https://github.com/yixuan/showtext")
    (synopsis "Using fonts more easily in R graphs")
    (description
     "This package aims to make it easy to use various types of
fonts (TrueType, OpenType, Type 1, web fonts, etc.) in R graphs, and supports
most output formats of R graphics including PNG, PDF and SVG.  Text glyphs
will be converted into polygons or raster images, hence after the plot has
been created, it no longer relies on the font files.  No external software
such as Ghostscript is needed to use this package.")
    (license license:asl2.0)))

(define-public r-emoa
  (package
    (name "r-emoa")
    (version "0.5-3")
    (source (origin
              (method url-fetch)
              (uri (cran-uri "emoa" version))
              (sha256
               (base32
                "1w287k5gjhgqcyq27xz0ybvhzkf1kydcnpcn30iziliw3xx71g2d"))))
    (properties `((upstream-name . "emoa")))
    (build-system r-build-system)
    (native-inputs (list r-testthat))
    (home-page "https://cran.r-project.org/web/packages/emoa/")
    (synopsis "Evolutionary multiobjective optimization algorithms")
    (description
     "This package provides building blocks for the design and analysis of
multiobjective optimization algorithms.")
    (license license:gpl2)))

(define-public r-emojifont
  (package
    (name "r-emojifont")
    (version "0.5.5")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "emojifont" version))
       (sha256
        (base32
         "1hhrwilv36hd9gs1kcl2zsi6519md0h9aixjrm6lfclxvz8r6k1i"))))
    (properties `((upstream-name . "emojifont")))
    (build-system r-build-system)
    (propagated-inputs
     (list r-ggplot2 r-proto r-showtext r-sysfonts))
    (native-inputs
     (list r-knitr))
    (home-page "https://guangchuangyu.github.io/emojifont")
    (synopsis "Emoji and Font Awesome in R graphics")
    (description
     "This package enables the use of emoji and the Font Awesome glyphs in
both base and ggplot2 graphics.")
    (license license:artistic2.0)))

(define-public r-abstractr
  (package
    (name "r-abstractr")
    (version "0.1.0")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "abstractr" version))
       (sha256
        (base32
         "1ymwp7syrynwd4i8aj2x5n8jdi9d96fjzl6jb09n0bnr5fgl7vig"))))
    (properties `((upstream-name . "abstractr")))
    (build-system r-build-system)
    (propagated-inputs
     (list r-colourpicker
           r-emojifont
           r-ggplot2
           r-gridextra
           r-rintrojs
           r-shiny
           r-shinythemes))
    (home-page "https://matt-kumar.shinyapps.io/portfolio")
    (synopsis "R-Shiny application for creating visual abstracts")
    (description
     "This package provides an R Shiny application to create visual abstracts
for original research.  A variety of user defined options and formatting are
included.")
    (license license:gpl3)))

(define-public r-qgam
  (package
    (name "r-qgam")
    (version "2.0.0")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "qgam" version))
       (sha256
        (base32
         "1s5cg6jjlr1m26ap4qh3aq7z5f7pqvgsdyg45bipb9mxvx2lh6jf"))))
    (properties `((upstream-name . "qgam")))
    (build-system r-build-system)
    (propagated-inputs
     (list r-doparallel r-mgcv r-plyr r-shiny))
    (native-inputs (list r-knitr r-testthat))
    (home-page "https://cran.r-project.org/web/packages/qgam/")
    (synopsis "Smooth additive quantile regression models")
    (description
     "This package provides smooth additive quantile regression models, fitted
using the methods of Fasiolo et al. (2017).  Differently from @code{quantreg},
the smoothing parameters are estimated automatically by marginal loss
minimization, while the regression coefficients are estimated using either
PIRLS or Newton algorithm.  The learning rate is determined so that the
Bayesian credible intervals of the estimated effects have approximately the
correct coverage.  The main function is @code{qgam()} which is similar to
@code{gam()} in the @code{mgcv} package, but fits non-parametric quantile
regression models.")
    (license license:gpl2+)))

(define-public r-abtest
  (package
    (name "r-abtest")
    (version "1.0.1")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "abtest" version))
       (sha256
        (base32
         "0jz2ry5364p8h8xlk5a5sycn8xlpxd1iasfg99bcr4jqzd92jfqg"))))
    (properties `((upstream-name . "abtest")))
    (build-system r-build-system)
    (propagated-inputs
     (list r-matrix
           r-mvtnorm
           r-plotrix
           r-qgam
           r-rcolorbrewer
           r-rcpp
           r-sn
           r-truncnorm))
    (native-inputs (list r-testthat))
    (home-page "https://cran.r-project.org/web/packages/abtest/")
    (synopsis "Bayesian A/B testing")
    (description
     "This package provides functions for Bayesian A/B testing including prior
elicitation options based on Kass and Vaidyanathan (1992)
@url{doi:10.1111/j.2517-6161.1992.tb01868.x}.")
    (license license:gpl2+)))

(define-public r-reldist
  (package
    (name "r-reldist")
    (version "1.7-2")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "reldist" version))
       (sha256
        (base32
         "1j99j9a0igb9nwkp7fkqqkmvyz770xmbi1d25pbnaz7d2jy6q26r"))))
    (properties `((upstream-name . "reldist")))
    (build-system r-build-system)
    (propagated-inputs
     (list r-densestbayes r-mgcv))
    (home-page "http://www.stat.ucla.edu/~handcock/RelDist")
    (synopsis "Relative distribution methods")
    (description
     "This package provides tools for the comparison of distributions.  This
includes nonparametric estimation of the relative distribution PDF and CDF and
numerical summaries as described in \"Relative Distribution Methods in the
Social Sciences\" by Mark S. Handcock and Martina Morris, Springer-Verlag,
1999, Springer-Verlag, ISBN 0387987789.")
    ;; See also https://cran.r-project.org/web/packages/reldist/LICENSE for
    ;; attribution requirements.
    (license license:gpl3)))

(define-public r-accept
  (package
    (name "r-accept")
    (version "1.0.0")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "accept" version))
       (sha256
        (base32
         "0yjihmgi94yfwhnvgw4v235yyr8n6w1ass2qbmvk0ia1hmjis8zq"))))
    (properties `((upstream-name . "accept")))
    (build-system r-build-system)
    (propagated-inputs
     (list r-dplyr r-reldist))
    (home-page "https://cran.r-project.org/web/packages/accept/")
    (synopsis "Acute COPD Exacerbation Prediction Tool (ACCEPT)")
    (description
     "This package allows clinicians to predict the rate and severity of
future acute exacerbation in @dfn{Chronic Obstructive Pulmonary
Disease} (COPD) patients, based on the clinical prediction model published in
Adibi et al. (2019) @url{doi:10.1101/651901}.")
    (license license:gpl3)))

(define-public r-smpracticals
  (package
    (name "r-smpracticals")
    (version "1.4-3.2")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "SMPracticals" version))
       (sha256
        (base32
         "1i63pphsz2vn20z8nrg3i51s1jghc89kaidgm18vxalnckapmi2j"))))
    (properties `((upstream-name . "SMPracticals")))
    (build-system r-build-system)
    (propagated-inputs
     (list r-ellipse r-mass r-nlme r-survival))
    (home-page "http://statwww.epfl.ch/davison/SM/")
    (synopsis "Practicals for use with Davison (2003) Statistical Models")
    (description
     "This package contains the datasets and a few functions for use with the
practicals outlined in Appendix A of the book Statistical Models (Davison,
2003, Cambridge University Press).  The practicals themselves can be found at
@url{http://statwww.epfl.ch/davison/SM/}.")
    (license license:gpl2+)))

(define-public r-fgui
  (package
    (name "r-fgui")
    (version "1.0-8")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "fgui" version))
       (sha256
        (base32
         "024fzd1c7iwqprn26hwjb9l2qlvvyzl449d7iixy0x69djwsrysv"))))
    (properties `((upstream-name . "fgui")))
    (build-system r-build-system)
    (home-page
     "https://sites.google.com/site/thomashoffmannproject/software/fgui")
    (synopsis "Create GUI for R functions")
    (description
     "Rapidly create a GUI for a function you created by automatically
creating widgets for arguments of the function.  This package automatically
parses help routines for context-sensitive help to these arguments.  The
interface is essentially a wrapper to some Tcl/Tk routines to both simplify
and facilitate GUI creation.  More advanced Tcl/Tk routines/GUI objects can be
incorporated into the interface for greater customization for the more
experienced.")
    ;; Any version of the GPL.
    (license (list license:gpl2+ license:gpl3+))))

(define-public r-tcltk2
  (package
    (name "r-tcltk2")
    (version "1.2-11")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "tcltk2" version))
       (sha256
        (base32
         "1ibxld379600xx7kiqq3fck083s8psry12859980218rnzikl65d"))))
    (properties `((upstream-name . "tcltk2")))
    (build-system r-build-system)
    (inputs
     (list tcl tk))
    (home-page "https://www.sciviews.org/SciViews-R")
    (synopsis "Tcl/Tk additions")
    (description
     "This package provides a series of additional Tcl commands and Tk widgets
with style and various functions to supplement the tcltk package")
    (license license:lgpl3)))

(define-public r-accrual
  (package
    (name "r-accrual")
    (version "1.4")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "accrual" version))
       (sha256
        (base32
         "0dygp8xar6dqx822ghjqvi8c597xjb7bqn57475fs4nw5zz709lk"))))
    (properties `((upstream-name . "accrual")))
    (build-system r-build-system)
    (propagated-inputs
     (list r-fgui r-smpracticals r-tcltk2))
    (home-page "https://cran.r-project.org/web/packages/accrual/")
    (synopsis "Bayesian accrual prediction")
    (description
     "Subject recruitment for medical research is challenging.  Slow patient
accrual leads to delay in research.  Accrual monitoring during the process of
recruitment is critical.  Researchers need reliable tools to manage the
accrual rate.  This package provides an implementation of a Bayesian method
that integrates researcher's experience on previous trials and data from the
current study, providing reliable prediction on accrual rate for clinical
studies.  It provides functions for Bayesian accrual prediction which can be
easily used by statisticians and clinical researchers.")
    (license license:gpl2)))

(define-public r-accrued
  (package
    (name "r-accrued")
    (version "1.4.1")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "accrued" version))
       (sha256
        (base32
         "05g1jb5914z18rcai1ahn7nihn27vr2rnadwv94gc1j7ivvikvs5"))))
    (properties `((upstream-name . "accrued")))
    (build-system r-build-system)
    (home-page "https://cran.r-project.org/web/packages/accrued/")
    (synopsis "Data quality visualization tools for partially accruing data")
    (description
     "This is a package for visualizing data quality of partially accruing
data.")
    (license license:gpl3)))

(define-public r-mda
  (package
    (name "r-mda")
    (version "0.5-5")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "mda" version))
       (sha256
        (base32
         "1kk28250mplv5dc12d2frp5wi19q4lf0sndlryiqnrsyqmxh8l9k"))))
    (properties `((upstream-name . "mda")))
    (build-system r-build-system)
    (propagated-inputs (list r-class))
    (native-inputs (list gfortran r-testthat))
    (home-page "https://cran.r-project.org/web/packages/mda/")
    (synopsis "Mixture and flexible discriminant analysis")
    (description
     "This is a package for mixture and flexible discriminant analysis,
@dfn{multivariate adaptive regression splines} (MARS), BRUTO, and so on.")
    (license license:gpl2)))

(define-public r-elasticnet
  (package
    (name "r-elasticnet")
    (version "1.3")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "elasticnet" version))
       (sha256
        (base32
         "0nxcw06d0cp2mbqzg2fm9yys5xm6xx7bfcfvr0avcs8afkvz29j8"))))
    (properties `((upstream-name . "elasticnet")))
    (build-system r-build-system)
    (propagated-inputs
     (list r-lars))
    (home-page "http://users.stat.umn.edu/~zouxx019/")
    (synopsis "Elastic-Net for sparse estimation and sparse PCA")
    (description
     "This package provides functions for fitting the entire solution path of
the Elastic-Net and also provides functions for estimating sparse Principal
Components.  The Lasso solution paths can be computed by the same function.")
    (license license:gpl2+)))

(define-public r-sparselda
  (package
    (name "r-sparselda")
    (version "0.1-9")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "sparseLDA" version))
       (sha256
        (base32
         "1k3sw9kc40yxnfss4vrsx34qxmv8ssddyhbfjhxrdldvblhbwchb"))))
    (properties `((upstream-name . "sparseLDA")))
    (build-system r-build-system)
    (propagated-inputs
     (list r-elasticnet r-mass r-mda))
    (home-page "https://www.imm.dtu.dk/~lkhc/")
    (synopsis "Sparse discriminant analysis")
    (description
     "This package performs sparse linear discriminant analysis for Gaussians
and mixture of Gaussian models.")
    (license license:gpl2+)))

(define-public r-spatest
  (package
    (name "r-spatest")
    (version "3.1.2")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "SPAtest" version))
       (sha256
        (base32 "1x5r4a6jnizhhazxywb2cf2jj2rx6rfynl6xcscmlix6n394xmxk"))))
    (properties `((upstream-name . "SPAtest")))
    (build-system r-build-system)
    (home-page "https://cran.r-project.org/package=SPAtest")
    (synopsis
     "Score test and meta-analysis based on Saddlepoint approximation")
    (description
     "This package performs score test using saddlepoint approximation to
estimate the null distribution.  It also prepares summary statistics for
meta-analysis and performs meta-analysis to combine multiple association
results.")
    (license license:gpl2+)))

(define-public r-accsda
  (package
    (name "r-accsda")
    (version "1.1.3")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "accSDA" version))
       (sha256
        (base32
         "1s0c4wy4bzrc2fkka7kl519z1yckp6s4ggzy1ik992ygyprdcs1q"))))
    (properties `((upstream-name . "accSDA")))
    (build-system r-build-system)
    (propagated-inputs
     (list r-ggplot2 r-gridextra r-mass))
    (home-page "https://github.com/gumeo/accSDA/wiki")
    (synopsis "Accelerated sparse discriminant analysis")
    (description
     "This package provides an implementation of sparse linear discriminant
analysis, which is a supervised classification method for multiple classes.
Various novel optimization approaches to this problem are implemented
including @dfn{alternating direction method of multipliers} (ADMM),
@dfn{proximal gradient} (PG) and @dfn{accelerated proximal gradient} (APG).
Functions for performing cross validation are also supplied along with basic
prediction and plotting functions.  @dfn{Sparse zero variance
discriminant} (SZVD) analysis is also included in the package.")
    (license license:gpl2+)))

(define-public r-ace2fastq
  (package
    (name "r-ace2fastq")
    (version "0.6.0")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "ace2fastq" version))
       (sha256
        (base32
         "09kk3yyqnr2xp820g0p3aai9a21figigjr9lxkr3zjq2d8gzwfic"))))
    (properties `((upstream-name . "ace2fastq")))
    (build-system r-build-system)
    (propagated-inputs
     (list r-stringr))
    (native-inputs (list r-knitr r-testthat))
    (home-page "https://github.com/c5sire/ace2fastq")
    (synopsis "ACE file to FASTQ converter")
    (description
     "The ACE file format is used in genomics to store contigs from sequencing
machines.  This tools converts it into FASTQ format.  Both formats contain the
sequence characters and their corresponding quality information.  Unlike the
FASTQ file, the ACE file stores the quality values numerically.  The
conversion algorithm uses the standard Sanger formula.  The package
facilitates insertion into pipelines, and content inspection.")
    (license license:gpl3)))

(define-public r-rngwell
  (package
    (name "r-rngwell")
    (version "0.10-10")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "rngWELL" version))
       (sha256
        (base32
         "0vspzmic0d1zjfywaa59a4hvp4p1mdifz818sjhmaab27379ji44"))))
    (properties `((upstream-name . "rngWELL")))
    (build-system r-build-system)
    (home-page "https://cran.r-project.org/web/packages/rngWELL/")
    (synopsis "Toolbox for WELL random number generators")
    (description
     "This is a dedicated package to WELL pseudo random generators, which were
introduced in Panneton et al. (2006), ``Improved Long-Period Generators Based
on Linear Recurrences Modulo 2'', ACM Transactions on Mathematical Software.")
    (license license:bsd-3)))

(define-public r-rnmf
  (package
   (name "r-rnmf")
   (version "0.5.0")
   (source (origin
            (method url-fetch)
            (uri (cran-uri "rNMF" version))
            (sha256
             (base32
              "1nz6h0j5ywdh48m0swmhp34hbkycd7n13rclrxaw85qi9wc42597"))))
   (build-system r-build-system)
   (propagated-inputs
    (list r-knitr r-nnls))
   (home-page "https://cran.r-project.org/web/packages/rNMF/")
   (synopsis "Robust nonnegative matrix factorization")
   (description
    "This package provides an implementation of robust nonnegative matrix
factorization (rNMF).  The rNMF algorithm decomposes a nonnegative high
dimension data matrix into the product of two low rank nonnegative matrices,
while detecting and trimming outliers.  The main function is @code{rnmf()}.
The package also includes a visualization tool, @code{see()}, that arranges
and prints vectorized images.")
   (license license:gpl2+)))

(define-public r-randtoolbox
  (package
    (name "r-randtoolbox")
    (version "2.0.5")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "randtoolbox" version))
       (sha256
        (base32
         "07ynzr9pp7c7wgjlq75610hivdzjprvxa7fjl42y4a5rzr9vjvmb"))))
    (properties `((upstream-name . "randtoolbox")))
    (build-system r-build-system)
    (propagated-inputs
     (list r-rngwell))
    (home-page "https://cran.r-project.org/web/packages/randtoolbox/")
    (synopsis "Toolbox for pseudo and quasi random number generation")
    (description
     "This package provides

@enumerate
@item pseudo random generators, such as general linear
congruential generators, multiple recursive generators and generalized
feedback shift register (SF-Mersenne Twister algorithm and WELL
generators)

@item quasi random generators, such as the Torus algorithm, the Sobol
sequence, the Halton sequence (including the Van der Corput sequence), and

@item some generator tests: the gap test, the serial test, the poker test.
@end enumerate

See e.g. Gentle (2003) @url{doi:10.1007/b97336}.")
    (license license:bsd-3)))

(define-public r-lhs
  (package
    (name "r-lhs")
    (version "1.2.0")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "lhs" version))
       (sha256
        (base32
         "0907icg9bl7h8a7wr8a60f59b8y89qj9rx1f7vxiybrjdcy7fjvb"))))
    (properties `((upstream-name . "lhs")))
    (build-system r-build-system)
    (propagated-inputs (list r-rcpp))
    (native-inputs
     (list r-knitr r-testthat))
    (home-page "https://github.com/bertcarnell/lhs")
    (synopsis "Latin Hypercube Samples")
    (description
     "This package provides a number of methods for creating and augmenting
Latin Hypercube Samples.")
    (license license:gpl3)))

(define-public r-acebayes
  (package
    (name "r-acebayes")
    (version "1.10")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "acebayes" version))
       (sha256
        (base32
         "11bffz430gdfdaxjx3simig66vhynmx6l1ylac4q2shcmj52nx73"))))
    (properties `((upstream-name . "acebayes")))
    (build-system r-build-system)
    (propagated-inputs
     (list r-compare r-lhs r-randtoolbox r-rcpp r-rcpparmadillo))
    (home-page "https://cran.r-project.org/web/packages/acebayes/")
    (synopsis "Optimal Bayesian experimental design using the ACE algorithm")
    (description
     "Finding an optimal Bayesian experimental design involves maximizing an
objective function given by the expectation of some appropriately chosen
utility function with respect to the joint distribution of unknown
quantities (including responses).  This objective function is usually not
available in closed form and the design space can be continuous and of high
dimensionality.  This package uses @dfn{Approximate Coordinate Exchange} (ACE)
to maximise an approximation to the expectation of the utility function.")
    (license license:gpl2)))

(define-public r-acet
  (package
    (name "r-acet")
    (version "1.9.0")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "ACEt" version))
       (sha256
        (base32
         "1071d75sw5bcfw1acjsg6bn81sapb5hkwrxjfrfxlz5r83w6213f"))))
    (properties `((upstream-name . "ACEt")))
    (build-system r-build-system)
    (propagated-inputs
     (list r-bh r-mass r-rcpp r-rcpparmadillo))
    (native-inputs (list r-knitr))
    (home-page "https://cran.r-project.org/web/packages/ACEt/")
    (synopsis "Estimating dynamic heritability and twin model comparison")
    (description
     "This package supports twin models that are able to estimate the dynamic
behaviour of the variance components in the classical twin models with respect
to age using B-splines and P-splines.")
    (license license:gpl2+)))

(define-public r-acfmperiod
  (package
    (name "r-acfmperiod")
    (version "1.0.0")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "acfMPeriod" version))
       (sha256
        (base32
         "1yww8isfrbs2v9s94hx7p2imyszcgadwafdgpj438n2ik0q6p9d5"))))
    (properties `((upstream-name . "acfMPeriod")))
    (build-system r-build-system)
    (propagated-inputs
     (list r-mass))
    (home-page "https://cran.r-project.org/web/packages/acfMPeriod/")
    (synopsis "Estimation of the ACF from the M-periodogram")
    (description
     "This package support non-robust and robust computations of the sample
autocovariance (ACOVF) and sample autocorrelation functions (ACF) of
univariate and multivariate processes.  The methodology consists in reversing
the diagonalization procedure involving the periodogram or the
cross-periodogram and the Fourier transform vectors, and, thus, obtaining the
ACOVF or the ACF as discussed in Fuller (1995)
@url{doi:10.1002/9780470316917}.  The robust version is obtained by fitting
robust M-regressors to obtain the M-periodogram or M-cross-periodogram as
discussed in Reisen et al. (2017) @url{doi:10.1016/j.jspi.2017.02.008}.")
    (license license:gpl2+)))

(define-public r-gamlss-data
  (package
    (name "r-gamlss-data")
    (version "6.0-6")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "gamlss.data" version))
       (sha256
        (base32
         "08mb154mz1kk19zb414i5mg1q1yv7nylwpc5kzsb602mv4cxpq5s"))))
    (properties `((upstream-name . "gamlss.data")))
    (build-system r-build-system)
    (home-page "http://www.gamlss.org/")
    (synopsis "GAMLSS data")
    (description
     "This package provides data used as examples to demonstrate GAMLSS
models.")
    ;; Either version of the license
    (license (list license:gpl2 license:gpl3))))

(define-public r-gamlss
  (package
    (name "r-gamlss")
    (version "5.4-22")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "gamlss" version))
       (sha256
        (base32
         "0bgya6jb462ggqnmlpwdymxqvqbkah15i3aai1xi9496z66r1rh1"))))
    (properties `((upstream-name . "gamlss")))
    (build-system r-build-system)
    (propagated-inputs
     (list r-gamlss-data r-gamlss-dist r-mass r-nlme r-survival))
    (home-page "http://www.gamlss.org/")
    (synopsis "Generalized additive models for location scale and shape")
    (description
     "This package provides functions for fitting the generalized additive
models for location scale and shape introduced by Rigby and
Stasinopoulos (2005), @url{doi:10.1111/j.1467-9876.2005.00510.x}.  The models
use a distributional regression approach where all the parameters of the
conditional distribution of the response variable are modelled using
explanatory variables.")
    ;; Either version of the license
    (license (list license:gpl2 license:gpl3))))

(define-public r-acid
  (package
    (name "r-acid")
    (version "1.1")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "acid" version))
       (sha256
        (base32
         "030i0y8s283ivbsmjccpbv9v7mgbcg2jk9df7vgcbbns74swf9hd"))))
    (properties `((upstream-name . "acid")))
    (build-system r-build-system)
    (propagated-inputs
     (list r-gamlss r-gamlss-dist r-hmisc))
    (home-page "https://cran.r-project.org/web/packages/acid/")
    (synopsis "Analysing conditional income distributions")
    (description
     "This package provides functions for the analysis of income distributions
for subgroups of the population as defined by a set of variables like age,
gender, region, etc.  This entails a Kolmogorov-Smirnov test for a mixture
distribution as well as functions for moments, inequality measures, entropy
measures and polarisation measures of income distributions.  This package thus
aides the analysis of income inequality by offering tools for the exploratory
analysis of income distributions at the disaggregated level.")
    (license license:gpl3)))

(define-public r-acm4r
  (package
    (name "r-acm4r")
    (version "1.0")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "acm4r" version))
       (sha256
        (base32
         "1wqzc35i1rshx0zlmas8y4qkkvy6h9r4i4apscjjv1xg2wjflzxa"))))
    (properties `((upstream-name . "acm4r")))
    (build-system r-build-system)
    (propagated-inputs (list r-mass))
    (home-page "https://cran.r-project.org/web/packages/acm4r/")
    (synopsis "Align-and-count method comparisons of RFLP data")
    (description
     "This is a package to compare sequence fragment lengths or molecular
weights from pairs of lanes.  The number of matching bands in the
@dfn{Restriction Fragment Length Polymorphism} (RFLP) data is calculated using
the align-and-count method.")
    ;; Any version of the GPL
    (license (list license:gpl2+ license:gpl3+))))

(define-public r-filelock
  (package
    (name "r-filelock")
    (version "1.0.3")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "filelock" version))
       (sha256
        (base32
         "0dqi0w92zq1f9542ma2nk5gkqzfmd4jlf34vysb4vv7mag20xk9d"))))
    (properties `((upstream-name . "filelock")))
    (build-system r-build-system)
    (native-inputs (list r-testthat))
    (home-page "https://github.com/r-lib/filelock")
    (synopsis "Portable file locking")
    (description
     "This library lets you place an exclusive or shared lock on a file using
the appropriate system call provided by the underlying operating system.")
    (license license:expat)))

(define-public r-filematrix
  (package
    (name "r-filematrix")
    (version "1.3")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "filematrix" version))
       (sha256
        (base32
         "1v3aj1ng742msb0sfdnjsbqb508mqjf8jlq2v33vxldhradw5w0b"))))
    (properties `((upstream-name . "filematrix")))
    (build-system r-build-system)
    ;; These inputs are needed for vignettes
    (native-inputs
     (list r-knitr r-rmarkdown))
    (home-page "https://github.com/andreyshabalin/filematrix")
    (synopsis "File-backed matrix class with convenient read and write access")
    (description
     "This package provides an interface for working with large matrices
stored in files, not in computer memory.  It supports multiple non-character
data types (double, integer, logical and raw) of various sizes (e.g.  8 and 4
byte real values).  Access to parts of the matrix is done by indexing, exactly
as with usual R matrices.  It supports very large matrices; the package has
been tested on multi-terabyte matrices.  It allows for more than 2^32 rows or
columns, ad allows for quick addition of extra columns to a filematrix.")
    (license license:lgpl3)))

(define-public r-filesstrings
  (package
    (name "r-filesstrings")
    (version "3.4.0")
    (source (origin
              (method url-fetch)
              (uri (cran-uri "filesstrings" version))
              (sha256
               (base32
                "0p5vgrzbvipja9lgarygqphnr1z8vy9kl9n83jnfyvf0gp4ansl2"))))
    (properties `((upstream-name . "filesstrings")))
    (build-system r-build-system)
    (propagated-inputs (list r-checkmate
                             r-magrittr
                             r-purrr
                             r-rlang
                             r-strex
                             r-stringi
                             r-stringr
                             r-withr))
    (native-inputs (list r-knitr r-testthat))
    (home-page "https://github.com/rorynolan/filesstrings")
    (synopsis "Handy file and string manipulation")
    (description
     "This started out as a package for file and string manipulation.  Since
then, the @code{fs} and @code{strex} packages emerged, offering functionality
previously given by this package.  Those packages have hence almost pushed
filesstrings into extinction.  However, it still has a small number of unique,
handy file manipulation functions which can be seen in the vignette.  One
example is a function to remove spaces from all file names in a directory.")
    (license license:gpl3)))

(define-public r-fillpattern
  (package
    (name "r-fillpattern")
    (version "1.0.2")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "fillpattern" version))
       (sha256
        (base32 "0qwrzxjw4br9sbh0zxry72j6rgvb1s8cwvwqigf7dg1zi4hk4i74"))))
    (properties `((upstream-name . "fillpattern")))
    (build-system r-build-system)
    (propagated-inputs (list r-ggplot2))
    (native-inputs (list r-testthat))
    (home-page "https://cmmr.github.io/fillpattern/")
    (synopsis "Patterned fills for ggplot2 and grid graphics")
    (description
     "This package adds distinctive yet unobtrusive geometric patterns where
solid color fills are normally used.  Patterned figures look just as
professional when viewed by colorblind readers or when printed in black and
white.  The dozen included patterns can be customized in terms of scale,
rotation, color, fill, line type, and line width.  It is compatible with the
@code{ggplot2} package as well as @code{grid} graphics.")
    (license license:expat)))

(define-public r-acmeeqtl
  (package
    (name "r-acmeeqtl")
    (version "1.6")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "ACMEeqtl" version))
       (sha256
        (base32
         "049xjv2ym35bbn43zwi68cq27fwdh404vp0r2ca5gxgmmx8kj1cz"))))
    (properties `((upstream-name . "ACMEeqtl")))
    (build-system r-build-system)
    (propagated-inputs
     (list r-filematrix))
    (home-page "https://github.com/andreyshabalin/ACMEeqtl")
    (synopsis "Estimation of interpretable eQTL effect sizes")
    (description
     "This package provides a non-linear model, termed ACME, that reflects a
parsimonious biological model for allelic contributions of cis-acting eQTLs.
With non-linear least-squares algorithm the maximum likelihood parameters can
be estimated.  The ACME model provides interpretable effect size estimates and
p-values with well controlled Type-I error.")
    (license license:lgpl3)))

(define-public r-acmer
  (package
    (name "r-acmer")
    (version "1.1.0")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "acmeR" version))
       (sha256
        (base32
         "000b2hqlhj93958nddw0fqb15ahigs08najv2miivym046x04mf7"))))
    (properties `((upstream-name . "acmeR")))
    (build-system r-build-system)
    (propagated-inputs (list r-foreign))
    (home-page "https://cran.r-project.org/web/packages/acmeR/")
    (synopsis "ACME estimator of bird and bat mortality by wind turbines")
    (description
     "This package provides an implementation of the ACME estimator, described
in Wolpert (2015), ACME: A Partially Periodic Estimator of Avian & Chiropteran
Mortality at Wind Turbines.  Unlike most other models, this estimator supports
decreasing-hazard Weibull model for persistence; decreasing search proficiency
as carcasses age; variable bleed-through at successive searches; and interval
mortality estimates.  The package provides, based on search data, functions
for estimating the mortality inflation factor in Frequentist and Bayesian
settings.")
    (license license:expat)))

(define-public r-r-huge
  (package
    (name "r-r-huge")
    (version "0.10.1")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "R.huge" version))
       (sha256
        (base32
         "1s3cg0kjaici6chgy21zhxwag9ldiif4103ajk121l8ambd1xjq5"))))
    (properties `((upstream-name . "R.huge")))
    (build-system r-build-system)
    (propagated-inputs
     (list r-r-methodss3 r-r-oo r-r-utils))
    (home-page "https://github.com/HenrikBengtsson/R.huge")
    (synopsis "Methods for accessing huge amounts of data")
    (description
     "This is a deprecated package for accessing huge amounts of data.
  Cross-platform alternatives are the following packages: bigmemory (CRAN),
ff (CRAN), or BufferedMatrix (Bioconductor).  The main usage of it was inside
the @code{aroma.affymetrix} package.")
    (license license:lgpl2.1+)))

(define-public r-r-filesets
  (package
    (name "r-r-filesets")
    (version "2.15.1")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "R.filesets" version))
       (sha256
        (base32
         "1qwxk3p56yq06nsdl0jwbw6j8r6qjakznsd3z63gnpsgkckfkx88"))))
    (properties `((upstream-name . "R.filesets")))
    (build-system r-build-system)
    (arguments
     '(#:phases
       (modify-phases %standard-phases
         (add-after 'unpack 'set-HOME
           (lambda _ (setenv "HOME" "/tmp"))))))
    (propagated-inputs
     (list r-digest r-r-cache r-r-methodss3 r-r-oo r-r-utils))
    (home-page "https://github.com/HenrikBengtsson/R.filesets")
    (synopsis "Easy handling of and access to files")
    (description
     "This package provides classes and methods to locate, setup, subset,
navigate and iterate file sets, i.e. sets of files located in one or more
directories on the file system.  The API is designed such that these classes
can be extended via inheritance to provide a richer API for special file
formats.  Moreover, a specific name format is defined such that filenames and
directories can be considered to have full names which consists of a name
followed by comma-separated tags.  This adds additional flexibility to
identify file sets and individual files.")
    (license license:lgpl2.1+)))

(define-public r-r-devices
  (package
    (name "r-r-devices")
    (version "2.17.2")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "R.devices" version))
       (sha256
        (base32
         "15gcvhmqwqyl3n299l9znwcjri8d8vixwwv915162sfxabsylgj0"))))
    (properties `((upstream-name . "R.devices")))
    (build-system r-build-system)
    (arguments
     (list
      #:phases
      '(modify-phases %standard-phases
         ;; This is needed for the vignette builder
         (add-after 'unpack 'set-HOME
           (lambda _ (setenv "HOME" "/tmp"))))))
    (propagated-inputs
     (list r-base64enc r-r-methodss3 r-r-oo r-r-utils))
    (native-inputs
     (list r-r-rsp))
    (home-page "https://github.com/HenrikBengtsson/R.devices")
    (synopsis "Unified handling of graphics devices")
    (description
     "This package provides functions for creating plots and image files in a
unified way regardless of output format (EPS, PDF, PNG, SVG, TIFF, WMF, etc.).
Default device options as well as scales and aspect ratios are controlled in a
uniform way across all device types.  Switching output format requires minimal
changes in code.  This package is ideal for large-scale batch processing,
because it will never leave open graphics devices or incomplete image files
behind, even on errors or user interrupts.")
    (license license:lgpl2.1+)))

(define-public r-acnr
  (package
    (name "r-acnr")
    (version "1.0.0")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "acnr" version))
       (sha256
        (base32
         "087hq4i7jp67ba2finzsqjfnqbiprl33na6ryjv9zqzsdawj9cym"))))
    (properties `((upstream-name . "acnr")))
    (build-system r-build-system)
    (native-inputs (list r-knitr r-testthat))
    (home-page "https://github.com/mpierrejean/acnr")
    (synopsis "Annotated copy-number regions")
    (description
     "This package provides SNP array data from different types of copy-number
regions.  These regions were identified manually by the authors of the package
and may be used to generate realistic data sets with known truth.")
    (license license:lgpl2.1+)))

(define-public r-acopula
  (package
    (name "r-acopula")
    (version "0.9.4")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "acopula" version))
       (sha256
        (base32
         "0asxfcjrsr9d7ab59pdajs0zvdjgwfswk9rdlpfdr51535wpjrfy"))))
    (properties `((upstream-name . "acopula")))
    (build-system r-build-system)
    (home-page "https://cran.r-project.org/web/packages/acopula/")
    (synopsis "Modelling dependence with multivariate Archimax copulas")
    (description
     "Archimax copulas are a mixture of Archimedean and EV copulas.  This
package provides definitions of several parametric families of generator and
dependence function, computes CDF and PDF, estimates parameters, tests for
goodness of fit, generates random sample and checks copula properties for
custom constructs.  In the 2-dimensional case explicit formulas for density
are used, contrary to higher dimensions when all derivatives are linearly
approximated.  Several non-archimax families (normal, FGM, Plackett) are
provided as well.")
    (license license:gpl2)))

(define-public r-tuner
  (package
    (name "r-tuner")
    (version "1.4.7")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "tuneR" version))
       (sha256
        (base32
         "02lnnsh2r22qg54ygdjjpd6986gqr5r3qbzxxrz34lq98jh58h9n"))))
    (properties `((upstream-name . "tuneR")))
    (build-system r-build-system)
    (propagated-inputs (list r-signal))
    (home-page "https://cran.r-project.org/web/packages/tuneR/")
    (synopsis "Analysis of music and speech")
    (description
     "This is a package for the analysis of music and speech.  Analyze music
and speech, extract features like MFCCs, handle wave files and their
representation in various ways, read MP3, read MIDI, perform steps of a
transcription, ...")
    ;; Either of these versions.
    (license (list license:gpl2 license:gpl3))))

(define-public r-seewave
  (package
    (name "r-seewave")
    (version "2.2.3")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "seewave" version))
       (sha256
        (base32
         "13c48sn453yp4j0ap8slnnr2gfhlxasz926p2pazkrg817w7m28z"))))
    (properties `((upstream-name . "seewave")))
    (build-system r-build-system)
    (inputs
     (list libsndfile))
    (propagated-inputs
     (list r-tuner))
    (home-page "https://rug.mnhn.fr/seewave")
    (synopsis "Sound analysis and synthesis")
    (description
     "This package provides functions for analysing, manipulating, displaying,
editing and synthesizing time waves (particularly sound).  This package
processes time analysis (oscillograms and envelopes), spectral content,
resonance quality factor, entropy, cross correlation and autocorrelation,
zero-crossing, dominant frequency, analytic signal, frequency coherence, 2D
and 3D spectrograms and many other analyses.")
    (license license:gpl2+)))

(define-public r-acousticndlcoder
  (package
    (name "r-acousticndlcoder")
    (version "1.0.2")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "AcousticNDLCodeR" version))
       (sha256
        (base32
         "1fgzgwanpv2pzy74xdk3hamc44p8qch467wh163dxby8jr9ik0sb"))))
    (properties
     `((upstream-name . "AcousticNDLCodeR")))
    (build-system r-build-system)
    (propagated-inputs
     (list r-seewave r-tuner r-zoo))
    (home-page "https://cran.r-project.org/web/packages/AcousticNDLCodeR/")
    (synopsis "Coding sound files for use with NDL")
    (description
     "Make acoustic cues to use with the R package @code{ndl}.
The package implements functions used in the PLoS ONE paper \"Words from
spontaneous conversational speech can be recognized with human-like accuracy
by an error-driven learning algorithm that discriminates between meanings
straight from smart acoustic features, bypassing the phoneme as recognition
unit.\" @url{doi:10.1371/journal.pone.0174623}")
    (license license:gpl2+)))

(define-public r-acp
  (package
    (name "r-acp")
    (version "2.1")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "acp" version))
       (sha256
        (base32
         "0lcwbjcyyr32m6qjmjqh25qjwrbyqj1n092xhgbhxzd8fslppnmn"))))
    (properties `((upstream-name . "acp")))
    (build-system r-build-system)
    (propagated-inputs
     (list r-quantmod r-tseries))
    (home-page "https://cran.r-project.org/web/packages/acp/")
    (synopsis "Autoregressive conditional Poisson")
    (description
     "This package supports the analysis of count data exhibiting
autoregressive properties, using the @dfn{Autoregressive Conditional Poisson}
model (ACP(p,q)) proposed by Heinen (2003).")
    (license license:gpl2)))

(define-public r-ada
  (package
    (name "r-ada")
    (version "2.0-5")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "ada" version))
       (sha256
        (base32
         "1h3a07czp0w3hrhjcg1fz721y8vsfclzqi3rq8qfzgpfb4h1f06r"))))
    (properties `((upstream-name . "ada")))
    (build-system r-build-system)
    (propagated-inputs (list r-rpart))
    (home-page "https://cran.r-project.org/web/packages/ada/")
    (synopsis "Stochastic boosting")
    (description
     "This package provides a straightforward, well-documented, and broad
boosting routine for classification, ideally suited for small to
moderate-sized data sets.  It performs discrete, real, and gentle boost under
both exponential and logistic loss on a given data set.")
    ;; Any version of the GPL.
    (license (list license:gpl2+ license:gpl3+))))

(define-public r-genalg
  (package
    (name "r-genalg")
    (version "0.2.1")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "genalg" version))
       (sha256
        (base32
         "1y4qz1s85zpd1r3259gr542arssf2vpd4drhy0wnq5q47ignrvna"))))
    (properties `((upstream-name . "genalg")))
    (build-system r-build-system)
    (home-page "https://github.com/egonw/genalg")
    (synopsis "R based genetic algorithm")
    (description
     "This package provides an R based genetic algorithm for binary and
floating point chromosomes.")
    (license license:gpl2)))

(define-public r-kernelfactory
  (package
    (name "r-kernelfactory")
    (version "0.3.0")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "kernelFactory" version))
       (sha256
        (base32
         "001kw9k3ivd4drd4mwqapkkk3f4jgljiaprhg2630hmll064s89j"))))
    (properties `((upstream-name . "kernelFactory")))
    (build-system r-build-system)
    (propagated-inputs
     (list r-auc r-genalg r-kernlab r-randomforest))
    (home-page "https://cran.r-project.org/web/packages/kernelFactory/")
    (synopsis "Ensemble of kernel machines")
    (description
     "Kernel factory is an ensemble method where each base classifier (random
forest) is fit on the kernel matrix of a subset of the training data.")
    (license license:gpl2+)))

(define-public r-duckdb
  (package
    (name "r-duckdb")
    (version "1.2.2")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "duckdb" version))
       (sha256
        (base32 "161zxianyssvsrd2345v4bi1m2z7wj614z8343jb73vhlk6s9yyi"))
       ;; This package bundles the duckdb sources and builds a custom variant
       ;; of duckdb.  I'd be happy to link it with our duckdb library instead,
       ;; but it does not seem possible to do that.
       #;
       (snippet
        '(delete-file "src/duckdb.tar.xz"))))
    (properties
     '((upstream-name . "duckdb")
       (updater-extra-native-inputs . ("tzdata-for-tests"))
       ;; We don't seem to need this and I don't want to package it now.
       (updater-ignored-native-inputs . ("r-dblog"))))
    (build-system r-build-system)
    (arguments (list #:tests? #false)) ;tests can time out on the build farm
    (propagated-inputs (list r-dbi))
    (native-inputs (list r-adbcdrivermanager
                         r-arrow
                         r-bit64
                         r-callr
                         r-clock
                         r-dbitest
                         r-dbplyr
                         r-dplyr
                         r-remotes
                         r-rlang
                         r-testthat
                         r-tibble
                         r-vctrs
                         r-withr
                         tzdata-for-tests))
    (home-page "https://r.duckdb.org/")
    (synopsis "DBI package for the DuckDB database management system")
    (description
     "The DuckDB project is an embedded analytical data management system with
support for the Structured Query Language (SQL).  This package includes all of
DuckDB and an R Database Interface (DBI) connector.")
    (license license:expat)))

(define-public r-dummies
  (package
    (name "r-dummies")
    (version "1.5.6")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "dummies" version))
       (sha256
        (base32
         "01f84crqx17xd6xy55qxlvsj3knm8lhw7jl26p2rh2w3y0nvqlbm"))))
    (properties `((upstream-name . "dummies")))
    (build-system r-build-system)
    (home-page "https://decisionpatterns.com")
    (synopsis "Create dummy/indicator variables flexibly and efficiently")
    (description
     "This package lets you expand factors, characters and other eligible
classes into dummy/indicator variables.")
    (license license:gpl2+)))

(define-public r-dunn-test
  (package
    (name "r-dunn-test")
    (version "1.3.6")
    (source (origin
              (method url-fetch)
              (uri (cran-uri "dunn.test" version))
              (sha256
               (base32
                "0z3qyq0lnflmsx41dbkr5lwgiqf3z8rn5wy54c93fwmahva0lqs9"))))
    (properties `((upstream-name . "dunn.test")))
    (build-system r-build-system)
    (home-page "https://cran.r-project.org/package=dunn.test")
    (synopsis "Dunn's test of multiple comparisons using rank sums")
    (description
     "Dunn's test computes stochastic dominance & reports pairwise comparisons.
This is done following a Kruskal-Wallis test (Kruskal and Wallis, 1952).  It
employs Dunn's z-test-statistic approximations for rank statistics, conducting
k(k-1)/2 comparisons.  The null hypothesis assumes that the probability of a
randomly selected value from the first group being larger than one from the
second group is one half, similar to the Wilcoxon-Mann-Whitney test.  Dunn's
test serves as a test for median difference and takes into account tied
ranks.")
    (license license:gpl2)))

(define-public r-acrm
  (package
    (name "r-acrm")
    (version "0.1.1")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "aCRM" version))
       (sha256
        (base32
         "0kzp568hd9c9a9qgniia5s5gv0q5f89xfvvwpzb197gqhs3x092v"))))
    (properties `((upstream-name . "aCRM")))
    (build-system r-build-system)
    (propagated-inputs
     (list r-ada r-dummies r-kernelfactory r-randomforest))
    (home-page "https://cran.r-project.org/web/packages/aCRM/")
    (synopsis "Convenience functions for analytical customer relationship management")
    (description
     "This package provides convenience functions for data preparation and
modeling often used in @dfn{analytical customer relationship
management} (aCRM).")
    (license license:gpl2+)))

(define-public r-tree
  (package
   (name "r-tree")
   (version "1.0-44")
   (source (origin
            (method url-fetch)
            (uri (cran-uri "tree" version))
            (sha256
             (base32
              "03zp9g2cwf6099l8xkvs9ab11i8a4iflh8afblqihcl4yrglnsfv"))))
   (build-system r-build-system)
   (properties
    '((updater-extra-native-inputs . ("r-mass"))))
   (native-inputs (list r-mass))
   (home-page "https://cran.r-project.org/web/packages/tree/")
   (synopsis "Classification and regression trees")
   (description "This package provides procedures to work with classification
and regression trees.")
   (license license:gpl2+)))

(define-public r-treeclust
  (package
    (name "r-treeclust")
    (version "1.1-7")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "treeClust" version))
       (sha256
        (base32
         "1s7kh6q0bkixsygrip95zf1bi10ihddsa5lq9dfxd68yh8rsby6z"))))
    (properties `((upstream-name . "treeClust")))
    (build-system r-build-system)
    (propagated-inputs
     (list r-cluster r-rpart))
    (home-page "https://cran.r-project.org/web/packages/treeClust/")
    (synopsis "Cluster distances through trees")
    (description
     "This package provides tools to create a measure of inter-point
dissimilarity useful for clustering mixed data, and, optionally, perform the
clustering.")
    (license license:gpl2+)))

(define-public r-treemap
  (package
    (name "r-treemap")
    (version "2.4-4")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "treemap" version))
       (sha256
        (base32 "1h3pas3kn8zrpdpvp9vs745q94kixw5lxkbq74l5lh0n3wkqnnn5"))))
    (properties `((upstream-name . "treemap")))
    (build-system r-build-system)
    (propagated-inputs
     (list r-colorspace
           r-data-table
           r-ggplot2
           r-gridbase
           r-igraph
           r-rcolorbrewer
           r-shiny))
    (native-inputs (list r-knitr))
    (home-page "https://cran.r-project.org/package=treemap")
    (synopsis "Treemap visualization")
    (description
     "A treemap is a space-filling visualization of hierarchical structures.
This package offers great flexibility to draw treemaps.")
    (license license:gpl3+)))

(define-public r-acrosstic
  (package
    (name "r-acrosstic")
    (version "1.0-3")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "AcrossTic" version))
       (sha256
        (base32
         "03180h79jhjd66ibrnsfp3yyp2jlfysp7cymw46phzj2palghsc0"))))
    (properties `((upstream-name . "AcrossTic")))
    (build-system r-build-system)
    (propagated-inputs
     (list r-lpsolve r-treeclust))
    (home-page "https://cran.r-project.org/web/packages/AcrossTic/")
    (synopsis "Cost-minimal regular spanning subgraph with TreeClust")
    (description
     "This is a package for constructing minimum-cost regular spanning
subgraph as part of a non-parametric two-sample test for equality of
distribution.")
    (license license:gpl2+)))

(define-public r-acrt
  (package
    (name "r-acrt")
    (version "1.0.1")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "acrt" version))
       (sha256
        (base32
         "0y9ndcq8ffpfrv7w9rikm4zn68jpsj6baqisq9kp2433xrwzdb6s"))))
    (properties `((upstream-name . "acrt")))
    (build-system r-build-system)
    (propagated-inputs
     (list r-rcpp r-rcppeigen r-sandwich))
    (home-page "https://cran.r-project.org/web/packages/acrt/")
    (synopsis "Autocorrelation robust testing")
    (description
     "This package provides functions for testing affine hypotheses on the
regression coefficient vector in regression models with autocorrelated
errors.")
    (license license:gpl2)))

(define-public r-acs
  (package
    (name "r-acs")
    (version "2.1.4")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "acs" version))
       (sha256
        (base32
         "0ajw9rf8l8akcvgqvbxjvryc6wjx74521xyxswz2b0bky3m6kah5"))))
    (properties `((upstream-name . "acs")))
    (build-system r-build-system)
    (propagated-inputs
     (list r-httr r-plyr r-stringr r-xml))
    (home-page "https://dusp.mit.edu/faculty/ezra-haber-glenn")
    (synopsis "Work with data from the US Census")
    (description
     "This package provides a general toolkit for downloading, managing,
analyzing, and presenting data from the
@url{https://www.census.gov/data/developers/data-sets.html, U.S.  Census},
including SF1 (Decennial short-form), SF3 (Decennial long-form), and the
American Community Survey (ACS).  Confidence intervals provided with ACS data
are converted to standard errors to be bundled with estimates in complex
@code{acs} objects.  The package provides new methods to conduct standard
operations on @code{acs} objects and present/plot data in statistically
appropriate ways.")
    (license license:gpl3)))

(define-public r-acss-data
  (package
    (name "r-acss-data")
    (version "1.2")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "acss.data" version))
       (sha256
        (base32
         "1b2p9p1bm3v93v7gr2rgjm1x9fhgd61ldzd4x6c1cxy1q865mwrc"))))
    (properties `((upstream-name . "acss.data")))
    (build-system r-build-system)
    (home-page "http://complexitycalculator.com/methodology.html")
    (synopsis "Data for algorithmic complexity of short strings")
    (description
     "This is a data only package providing the algorithmic complexity of
short strings, computed using the coding theorem method.  For a given set of
symbols in a string, all possible or a large number of random samples of
Turing machines with a given number of states (e.g., 5) and number of symbols
corresponding to the number of symbols in the strings were simulated until
they reached a halting state or failed to end.  This package contains data on
4.5 million strings from length 1 to 12 simulated on Turing machines with 2,
4, 5, 6, and 9 symbols.  The complexity of the string corresponds to the
distribution of the halting states.")
    (license license:gpl2+)))

(define-public r-acss
  (package
    (name "r-acss")
    (version "0.3-2")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "acss" version))
       (sha256
        (base32
         "1sxkbzlg6hhbpp1rg4lb2dhl2lmc8z8zbmjhi0dimxbp6am16mpn"))))
    (properties `((upstream-name . "acss")))
    (build-system r-build-system)
    (propagated-inputs
     (list r-acss-data r-zoo))
    (native-inputs (list r-knitr))
    (home-page "http://complexitycalculator.com/methodology.html")
    (synopsis "Algorithmic complexity for short strings")
    (description
     "The main purpose of this package is to provide the algorithmic
complexity for short strings, an approximation of the Kolmogorov Complexity of
a short string using the coding theorem method.  While the database containing
the complexity is provided in the data only package @code{acss.data}, this
package provides functions accessing the data such as @code{prob_random}
returning the posterior probability that a given string was produced by a
random process.  In addition, two traditional (but problematic) measures of
complexity are also provided: entropy and change complexity.")
    (license license:gpl2+)))

(define-public r-acswr
  (package
    (name "r-acswr")
    (version "1.0")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "ACSWR" version))
       (sha256
        (base32
         "195vjrkang5cl7gwsna0aq4p0h4jym9xg9yh94bnf8vq6wf8j83n"))))
    (properties `((upstream-name . "ACSWR")))
    (build-system r-build-system)
    (propagated-inputs
     (list r-mass))
    (home-page "https://cran.r-project.org/web/packages/ACSWR/")
    (synopsis "Companion package for the book \"A Course in Statistics with R\"")
    (description
     "This is a companion package for the book \"A Course in Statistics with
R\" (ISBN 978-1-119-15272-9.)")
    (license license:gpl2)))

(define-public r-alabama
  (package
    (name "r-alabama")
    (version "2023.1.0")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "alabama" version))
       (sha256
        (base32
         "075zqyarb970d4zpxsivaxhnmdg916ypfxrp0mqngnww5p3nfpwj"))))
    (properties `((upstream-name . "alabama")))
    (build-system r-build-system)
    (propagated-inputs (list r-numderiv))
    (home-page "https://cran.r-project.org/web/packages/alabama/")
    (synopsis "Constrained nonlinear optimization")
    (description
     "Alabama stands for Augmented Lagrangian Adaptive Barrier Minimization
Algorithm; it is used for optimizing smooth nonlinear objective functions with
constraints.  Linear or nonlinear equality and inequality constraints are
allowed.")
    (license license:gpl2+)))

(define-public r-gdina
  (package
    (name "r-gdina")
    (version "2.9.9")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "GDINA" version))
       (sha256
        (base32
         "0hlckphwyl8ncirqljsf014yzx7fz05zvmfjs3dybah89lb1apqh"))))
    (properties `((upstream-name . "GDINA")))
    (build-system r-build-system)
    (propagated-inputs
     (list r-alabama
           r-ggplot2
           r-mass
           r-nloptr
           r-numderiv
           r-rcpp
           r-rcpparmadillo
           r-rsolnp
           r-shiny
           r-shinydashboard))
    (native-inputs
     (list r-knitr r-testthat))
    (home-page "https://github.com/Wenchao-Ma/GDINA")
    (synopsis "Generalized DINA model framework")
    (description
     "This package provides a set of psychometric tools for cognitive
diagnosis modeling based on the generalized deterministic inputs, noisy and
gate (G-DINA) model by de la Torre (2011) @url{doi:10.1007/s11336-011-9207-7}
and its extensions, including the sequential G-DINA model by Ma and de la
Torre (2016) @url{doi:10.1111/bmsp.12070} for polytomous responses, and the
polytomous G-DINA model by Chen and de la Torre
@url{doi:10.1177/0146621613479818} for polytomous attributes.  Joint attribute
distribution can be independent, saturated, higher-order, loglinear smoothed
or structured.  Q-matrix validation, item and model fit statistics, model
comparison at test and item level and differential item functioning can also
be conducted.  A graphical user interface is also provided.")
    (license license:gpl3)))

(define-public r-actcd
  (package
    (name "r-actcd")
    (version "1.3-0")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "ACTCD" version))
       (sha256
        (base32
         "1a0gsznca5fv7i29xpcns4rkas5q88wv01rxvd4j66n64gw0ri4j"))))
    (properties `((upstream-name . "ACTCD")))
    (build-system r-build-system)
    (propagated-inputs
     (list r-gdina r-r-methodss3))
    (native-inputs
     (list gfortran))
    (home-page "https://cran.r-project.org/web/packages/ACTCD/")
    (synopsis "Asymptotic classification theory for cognitive diagnosis")
    (description
     "This is a package supporting cluster analysis for cognitive diagnosis
based on the Asymptotic Classification Theory (Chiu, Douglas & Li, 2009;
@url{doi:10.1007/s11336-009-9125-0}).  Given the sample statistic of
sum-scores, cluster analysis techniques can be used to classify examinees into
latent classes based on their attribute patterns.  In addition to the
algorithms used to classify data, three labeling approaches are proposed to
label clusters so that examinees' attribute profiles can be obtained.")
    (license license:gpl2+)))

(define-public r-ineq
  (package
    (name "r-ineq")
    (version "0.2-13")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "ineq" version))
       (sha256
        (base32
         "09fsxyrh0j7mwmb5hkhmrzgcy7kf85jxkh7zlwpgqgcsyl1n91z0"))))
    (properties `((upstream-name . "ineq")))
    (build-system r-build-system)
    (home-page "https://cran.r-project.org/web/packages/ineq/")
    (synopsis "Measuring inequality, concentration, and poverty")
    (description
     "This package provides tools for measuring inequality, concentration, and
poverty measures.  It provides both empirical and theoretical Lorenz curves.")
    ;; Either of these two versions.
    (license (list license:gpl2 license:gpl3))))

(define-public r-actfrag
  (package
    (name "r-actfrag")
    (version "0.1.1")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "ActFrag" version))
       (sha256
        (base32
         "08r3gwjz4fkyy85dxqix0ffm5xyq45032qv3snnzxnlqxslxbqn1"))))
    (properties `((upstream-name . "ActFrag")))
    (build-system r-build-system)
    (propagated-inputs
     (list r-accelerometry r-dplyr r-ineq r-survival r-tidyr))
    (native-inputs (list r-knitr r-testthat))
    (home-page "https://github.com/junruidi/ActFrag")
    (synopsis "Activity fragmentation metrics extraction")
    (description
     "This package provides functions to extract commonly used fragmentation
metrics to quantify time accumulation strategies based on minute level
actigraphy-measured activity counts data.")
    (license license:gpl3)))

(define-public r-ash
  (package
    (name "r-ash")
    (version "1.0-15")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "ash" version))
       (sha256
        (base32
         "1ay2a2agdmiz7zzvn26mli0x0iwk09g5pp4yy1r23knhkp1pn2lb"))))
    (properties `((upstream-name . "ash")))
    (build-system r-build-system)
    (native-inputs (list gfortran))
    (home-page "https://cran.r-project.org/web/packages/ash/")
    (synopsis "David Scott's ASH routines")
    (description
     "This package provides David Scott's ASH routines ported from S-PLUS to
R.")
    (license license:gpl2+)))

(define-public r-hdrcde
  (package
    (name "r-hdrcde")
    (version "3.4")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "hdrcde" version))
       (sha256
        (base32
         "16qlk44cjvn2s0vzaf915df65ksdx20dbxhy7fpdqins46hccha3"))))
    (properties `((upstream-name . "hdrcde")))
    (build-system r-build-system)
    (propagated-inputs
     (list r-ash
           r-ggplot2
           r-kernsmooth
           r-ks
           r-locfit
           r-rcolorbrewer))
    (native-inputs (list gfortran))
    (home-page "https://pkg.robjhyndman.com/hdrcde")
    (synopsis "Highest density regions and conditional density estimation")
    (description
     "This is a package for the computation of highest density regions in one
and two dimensions, kernel estimation of univariate density functions
conditional on one covariate, and multimodal regression.")
    (license license:gpl3)))

(define-public r-rainbow
  (package
    (name "r-rainbow")
    (version "3.8")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "rainbow" version))
       (sha256
        (base32
         "0gc25napmcgg1qr17z4zixzxcdiv9midi1x5fin4pzkhicl5d97c"))))
    (properties `((upstream-name . "rainbow")))
    (build-system r-build-system)
    (propagated-inputs
     (list r-cluster
           r-colorspace
           r-hdrcde
           r-ks
           r-mass
           r-pcapp))
    (home-page "https://cran.r-project.org/web/packages/rainbow/")
    (synopsis "Bagplots, boxplots and rainbow plots for functional data")
    (description
     "This is a package for visualizing functional data and identifying
functional outliers with bagplots, boxplots and rainbow plots.")
    (license license:gpl3)))

(define-public r-fds
  (package
    (name "r-fds")
    (version "1.8")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "fds" version))
       (sha256
        (base32
         "1284vncixrzrz9x6b52gslrbrbia07sd0xac7nwdqhp5f5v5wfi0"))))
    (properties `((upstream-name . "fds")))
    (build-system r-build-system)
    (propagated-inputs
     (list r-rainbow r-rcurl))
    (home-page "https://cran.r-project.org/web/packages/fds/")
    (synopsis "Functional data sets")
    (description "This package contains a list of functional time series,
sliced functional time series, and functional data sets.  Functional time
series is a special type of functional data observed over time.  Sliced
functional time series is a special type of functional time series with a time
variable observed over time.")
    (license license:gpl2+)))

(define-public r-fda
  (package
    (name "r-fda")
    (version "6.3.0")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "fda" version))
       (sha256
        (base32
         "0dv6ly1jb7b2yyrlqkhnsv3wabr1xfz33nnc1iinp637ha8n1zvk"))))
    (properties `((upstream-name . "fda")))
    (build-system r-build-system)
    (propagated-inputs
     (list r-desolve r-fds))
    (native-inputs
     (list r-knitr))
    (home-page "https://www.functionaldata.org")
    (synopsis "Functional data analysis")
    (description
     "These functions were developed to support functional data analysis as
described in Ramsay, J. O. and Silverman, B. W. (2005) Functional Data
Analysis.  The package includes data sets and script files working many
examples.")
    (license license:gpl2+)))

(define-public r-actigraphy
  (package
    (name "r-actigraphy")
    (version "1.4.0")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "Actigraphy" version))
       (sha256
        (base32
         "0bpmvszzv5fm72nar3wgnmfl5am7znqfajmlbv38ihkbi7jbwk20"))))
    (properties `((upstream-name . "Actigraphy")))
    (build-system r-build-system)
    (propagated-inputs
     (list r-fda))
    (home-page "https://cran.r-project.org/web/packages/Actigraphy/")
    (synopsis "Actigraphy data analysis")
    (description
     "This package provides tools for functional linear modeling and analysis
of actigraphy data.")
    (license license:asl2.0)))

(define-public r-activedriver
  (package
    (name "r-activedriver")
    (version "1.0.0")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "ActiveDriver" version))
       (sha256
        (base32
         "10c7ga48fwvpd5mc4dqiyw4kc2l0iz5qn4hg7xk15r1qmm5rsipa"))))
    (properties `((upstream-name . "ActiveDriver")))
    (build-system r-build-system)
    (propagated-inputs
     (list r-mass))
    (home-page "https://cran.r-project.org/web/packages/ActiveDriver/")
    (synopsis "Tools for finding cancer driver proteins")
    (description
     "This package provides a mutation analysis tool that discovers cancer
driver genes with frequent mutations in protein signalling sites such as
post-translational modifications (phosphorylation, ubiquitination, etc).  The
Poisson generalized linear regression model identifies genes where cancer
mutations in signalling sites are more frequent than expected from the
sequence of the entire gene.  Integration of mutations with signalling
information helps find new driver genes and propose candidate mechanisms to
known drivers.")
    (license license:gpl2+)))

(define-public r-activitycounts
  (package
    (name "r-activitycounts")
    (version "0.2.1")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "activityCounts" version))
       (sha256
        (base32
         "1m3pihq6xm4fvcvc44s06yil3l9iw9nhnh98jxky63ny1s8c75fq"))))
    (properties
     '((upstream-name . "activityCounts")
       (updater-extra-native-inputs . ("r-knitr" "r-testthat"))))
    (build-system r-build-system)
    (propagated-inputs
     (list r-lubridate r-magrittr r-seewave r-signal r-tibble))
    (native-inputs (list r-knitr r-testthat))
    (home-page "https://github.com/walkabillylab/activityCounts")
    (synopsis "Generate ActiLife counts")
    (description
     "ActiLife generates activity counts from data collected by Actigraph
accelerometers.  Actigraph is one of the most common research-grade
accelerometers.  There is considerable research validating and developing
algorithms for human activity using ActiLife counts.  Unfortunately, ActiLife
counts are proprietary and difficult to implement if researchers use different
accelerometer brands.  The code creates ActiLife counts from raw acceleration
data for different accelerometer brands.")
    (license license:gpl3)))

(define-public r-activityindex
  (package
    (name "r-activityindex")
    (version "0.3.7")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "ActivityIndex" version))
       (sha256
        (base32
         "1zj2b6x31a1kxl80rarmkrlm7ack4154mrkbqs3fpi48zpmjbgd5"))))
    (properties `((upstream-name . "ActivityIndex")))
    (build-system r-build-system)
    (propagated-inputs
     (list r-data-table r-matrixstats r-r-utils))
    (native-inputs
     (list r-knitr r-testthat))
    (home-page "https://cran.r-project.org/web/packages/ActivityIndex/")
    (synopsis "Activity Index calculation using raw accelerometry data")
    (description
     "This is a package to read raw accelerometry from GT3X+ accelerometry
data and plain table data to calculate the Activity Index from Bai et
al. (2016) @url{doi:10.1371/journal.pone.0160644}.")
    (license license:gpl3)))

(define-public r-activpal
  (package
    (name "r-activpal")
    (version "0.1.3")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "activPAL" version))
       (sha256
        (base32
         "1h6hp5z89ji73gdzxy1dgbfwjysiy5lvcqh90xagpb7sa7ahs3na"))))
    (properties `((upstream-name . "activPAL")))
    (build-system r-build-system)
    (propagated-inputs
     (list r-devtools
           r-dplyr
           r-ggplot2
           r-lubridate
           r-magrittr
           r-tidyr))
    (native-inputs (list r-testthat))
    (home-page "https://cran.r-project.org/web/packages/activPAL")
    (synopsis "Processing and chart generation from activPAL events files")
    (description
     "This package contains functions to generate pre-defined summary
statistics from activPAL events files.  The package also contains functions to
produce informative graphics that visualize physical activity behaviour and
trends.  This includes generating graphs that align physical activity
behaviour with additional time based observations described by other data
sets, such as sleep diaries and continuous glucose monitoring data.")
    (license license:gpl3)))

(define-public r-activpalprocessing
  (package
    (name "r-activpalprocessing")
    (version "1.0.2")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "activpalProcessing" version))
       (sha256
        (base32
         "1y0bjx2qx53iy930y9iww4q1yzjj8y16cwgixk1mq3w4g1f116d1"))))
    (properties
     `((upstream-name . "activpalProcessing")))
    (build-system r-build-system)
    (propagated-inputs
     (list r-chron))
    (home-page "https://cran.r-project.org/web/packages/activpalProcessing/")
    (synopsis "Process activPAL events files")
    (description
     "This package performs estimation of physical activity and sedentary
behavior variables from activPAL events files.")
    ;; Either version of the GPL.
    (license (list license:gpl2 license:gpl3))))

(define-public r-actogrammr
  (package
    (name "r-actogrammr")
    (version "0.2.3")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "actogrammr" version))
       (sha256
        (base32
         "1jzvarmd41yqlrkagzlc8m19n5mn0w0b36fy50lyvgrfsafjfbqa"))))
    (properties `((upstream-name . "actogrammr")))
    (build-system r-build-system)
    (propagated-inputs
     (list r-dplyr r-ggplot2 r-lubridate r-readr r-tidyr))
    (native-inputs (list r-testthat))
    (home-page "https://cran.r-project.org/web/packages/actogrammr/")
    (synopsis "Read in activity data and plot actograms")
    (description
     "Read in activity measurements from standard file formats used by
circadian rhythm researchers, currently only ClockLab format, and process and
plot the data.  The central type of plot is the actogram, as first described
in \"Activity and distribution of certain wild mice in relation to biotic
communities\" by MS Johnson (1926) @url{doi:10.2307/1373575}.")
    (license license:gpl3)))

(define-public r-expint
  (package
    (name "r-expint")
    (version "0.1-8")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "expint" version))
       (sha256
        (base32
         "1cn6c84pqf8bgk109qm4znn186h6s6cpll3d11cw144h0vh4yr8j"))))
    (properties `((upstream-name . "expint")))
    (build-system r-build-system)
    (home-page "https://gitlab.com/vigou3/expint")
    (synopsis "Exponential integral and incomplete Gamma function")
    (description
     "This package provides the exponential integrals @code{E_1(x)},
@code{E_2(x)}, @code{E_n(x)} and @code{Ei(x)}, and the incomplete gamma
function @code{G(a, x)} defined for negative values of its first argument.
The package also gives easy access to the underlying C routines through an
API; see the package vignette for details.")
    (license license:gpl2+)))

(define-public r-actuar
  (package
    (name "r-actuar")
    (version "3.3-5")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "actuar" version))
       (sha256
        (base32
         "0ymh4gx8nplw7acx9pg1gxwfjcnjx0zzpd9x4pf4hlzqwddaynqm"))))
    (properties `((upstream-name . "actuar")))
    (build-system r-build-system)
    (propagated-inputs (list r-expint))
    (native-inputs (list r-mass))
    (home-page "https://gitlab.com/vigou3/actuar")
    (synopsis "Actuarial functions and heavy tailed distributions")
    (description
     "This package provides functions and data sets for actuarial science:
modeling of loss distributions; risk theory and ruin theory; simulation of
compound models, discrete mixtures and compound hierarchical models;
credibility theory.  It boasts support for many additional probability
distributions to model insurance loss amounts and loss frequency: 19
continuous heavy tailed distributions; the Poisson-inverse Gaussian discrete
distribution; zero-truncated and zero-modified extensions of the standard
discrete distributions.  It also supports phase-type distributions commonly
used to compute ruin probabilities.")
    (license license:gpl2+)))

(define-public r-bmp
  (package
    (name "r-bmp")
    (version "0.3")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "bmp" version))
       (sha256
        (base32
         "0jd67r11bn98hjwgyr6gas423787xy7ji2hq7ay80blkkcj91xxx"))))
    (properties
     '((upstream-name . "bmp")
       (updater-extra-native-inputs . ("r-pixmap"))))
    (build-system r-build-system)
    (native-inputs (list r-pixmap r-testthat))
    (home-page "https://cran.r-project.org/web/packages/bmp/")
    (synopsis "Read Bitmap (BMP) images")
    (description
     "This package provides pure R tools to read BMP format images.  It is
currently limited to 8 bit greyscale images and 24, 32 bit (A)RGB images.")
    (license license:gpl2+)))

(define-public r-readbitmap
  (package
    (name "r-readbitmap")
    (version "0.1.5")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "readbitmap" version))
       (sha256
        (base32
         "14825906l326w59g6apy00j55jg3h5kx2r6s031f4gdkbrc7szbk"))))
    (properties `((upstream-name . "readbitmap")))
    (build-system r-build-system)
    (inputs
     (list libjpeg-turbo libpng))
    (propagated-inputs
     (list r-bmp r-jpeg r-png r-tiff))
    (native-inputs (list r-pixmap r-testthat))
    (home-page "https://github.com/jefferis/readbitmap")
    (synopsis "Unified interface to read bitmap images (BMP, JPEG, PNG, TIFF)")
    (description
     "This package provides tools to identify and read BMP, JPEG, PNG, and
TIFF format bitmap images.  Identification defaults to the use of the magic
number embedded in the file rather than the file extension.")
    (license license:gpl2+)))

(define-public r-imager
  (package
    (name "r-imager")
    (version "1.0.3")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "imager" version))
       (sha256
        (base32
         "00720nzksl6pfk35wmiznay5idi7cakdywi4pfvxffgslncvjl53"))))
    (properties `((upstream-name . "imager")))
    (build-system r-build-system)
    (inputs
     (list fftw libtiff libx11 zlib))
    (propagated-inputs
     (list r-downloader
           r-igraph
           r-jpeg
           r-magrittr
           r-png
           r-purrr
           r-rcpp
           r-readbitmap
           r-stringr))
    (native-inputs
     (list pkg-config r-knitr r-testthat))
    (home-page "https://dahtah.github.io/imager/")
    (synopsis "Image processing library")
    (description
     "This is a package for fast image processing for images in up to 4
dimensions (two spatial dimensions, one time/depth dimension, one color
dimension).  It provides most traditional image processing tools (filtering,
morphology, transformations, etc.) as well as various functions for easily
analyzing image data using R.  The package wraps @url{http://cimg.eu, CImg}, a
simple, modern C++ library for image processing.")
    (license license:lgpl3)))

(define-public r-acuityview
  (package
    (name "r-acuityview")
    (version "0.1")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "AcuityView" version))
       (sha256
        (base32
         "0f0iclmnwdc8ixiiai4svk4x1g3pjy7dhm3cm58fv6ckx12d3d2l"))))
    (properties `((upstream-name . "AcuityView")))
    (build-system r-build-system)
    (propagated-inputs
     (list r-fftwtools r-imager r-plotrix))
    (home-page "https://cran.r-project.org/web/packages/AcuityView/")
    (synopsis "Display scenes as seen by an animal with less acute vision")
    (description
     "This package provides a simple method for representing a visual scene as
it may be seen by an animal with less acute vision.")
    (license license:gpl2+)))

(define-public r-caret
  (package
    (name "r-caret")
    (version "7.0-1")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "caret" version))
       (sha256
        (base32
         "0p41k8r3sm8icfli14w6nzc9glwb8a2dmb2b8a5p2j0rrsl53sni"))))
    (build-system r-build-system)
    (propagated-inputs
     (list r-e1071
           r-foreach
           r-ggplot2
           r-lattice
           r-modelmetrics
           r-nlme
           r-plyr
           r-proc
           r-recipes
           r-reshape2
           r-withr))
    (native-inputs
     (list r-car
           r-dplyr
           r-fastica
           r-ipred
           r-kernlab
           r-knitr
           r-mass
           r-matrix
           r-rpart
           r-testthat
           r-themis))
    (home-page "https://github.com/topepo/caret")
    (synopsis "Classification and regression training")
    (description
     "This package provides miscellaneous functions for training and plotting
classification and regression models.")
    (license license:gpl2+)))

(define-public r-caretensemble
  (package
    (name "r-caretensemble")
    (version "4.0.1")
    (source (origin
              (method url-fetch)
              (uri (cran-uri "caretEnsemble" version))
              (sha256
               (base32
                "1iszidm3g24yi5g10wyx3vw03ka1ij4z3q4ng01v7ic863wp08gb"))))
    (properties
     '((upstream-name . "caretEnsemble")
       (updater-extra-native-inputs . ("r-gbm"))))
    (build-system r-build-system)
    (arguments
     (list
      #:phases
      '(modify-phases %standard-phases
         (add-after 'unpack 'disable-bad-tests
           (lambda _
             (substitute* "tests/testthat/test-caretList.R"
               ((".*caretList supports models that return an array.*" m)
                (string-append m "skip('skip');\n"))))))))
    (propagated-inputs (list r-caret
                             r-data-table
                             r-ggplot2
                             r-lattice
                             r-patchwork
                             r-pbapply
                             r-rlang))
    (native-inputs
     (list r-catools
           r-earth
           r-gbm
           r-glmnet
           r-knitr
           r-mlbench
           r-randomforest
           r-testthat))
    (home-page "https://github.com/zachmayer/caretEnsemble")
    (synopsis "Ensembles of caret models")
    (description
     "This is a framework for fitting multiple caret models.  It uses the same
re-sampling strategy as well as creating ensembles of such models.  Use
@code{caretList} to fit multiple models and then use @code{caretEnsemble} to
combine them greedily or @code{caretStack} to combine them using a caret
model.")
    (license license:expat)))

(define-public r-adabag
  (package
    (name "r-adabag")
    (version "5.0")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "adabag" version))
       (sha256
        (base32
         "03nnqgia61pavic9l6av0hh81wilxlkrx3g244ypar1fv9ppan7c"))))
    (properties `((upstream-name . "adabag")))
    (build-system r-build-system)
    (propagated-inputs
     (list r-caret
           r-consrank
           r-doparallel
           r-dplyr
           r-foreach
           r-rpart
           r-tidyr))
    (home-page "https://cran.r-project.org/web/packages/adabag/")
    (synopsis "Multiclass AdaBoost.M1, SAMME and Bagging")
    (description
     "This package implements Freund and Schapire's Adaboost.M1 algorithm and
Breiman's Bagging algorithm using classification trees as individual
classifiers.  Once these classifiers have been trained, they can be used to
predict on new data.  Also, cross validation estimation of the error can be
done.")
    (license license:gpl2+)))

(define-public r-adagio
  (package
    (name "r-adagio")
    (version "0.9.2")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "adagio" version))
       (sha256
        (base32
         "100mqwlzqml154d0hk7spi4sbwx9y3gh06vkls49kca2q1kf99qz"))))
    (properties `((upstream-name . "adagio")))
    (build-system r-build-system)
    (propagated-inputs
     (list r-lpsolve))
    (home-page "https://cran.r-project.org/web/packages/adagio/")
    (synopsis "Discrete and global optimization routines")
    (description
     "This package provides methods and algorithms for discrete optimization,
e.g. knapsack and subset sum procedures, derivative-free Nelder-Mead and
Hooke-Jeeves minimization, and some (evolutionary) global optimization
functions.")
    (license license:gpl3+)))

(define-public r-univoutl
  (package
    (name "r-univoutl")
    (version "0.4")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "univOutl" version))
       (sha256
        (base32
         "1kp014bhs8v02fp7misrj4fpfp2na9lg45p5zqvlfaypnm5imsr9"))))
    (properties `((upstream-name . "univOutl")))
    (build-system r-build-system)
    (propagated-inputs
     (list r-hmisc r-robustbase))
    (home-page "https://github.com/marcellodo/univOutl")
    (synopsis "Detection of univariate outliers")
    (description
     "This package provides well-known outlier detection techniques in the
univariate case.  Methods to deal with skewed distribution are included too.
The Hidiroglou-Berthelot (1986) method to search for outliers in ratios of
historical data is implemented as well.  When available, survey weights can be
used in outliers detection.")
    (license license:gpl2+)))

(define-public r-tolerance
  (package
    (name "r-tolerance")
    (version "3.0.0")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "tolerance" version))
       (sha256
        (base32
         "0pk75i0qmfrpm02jm4c0vvryq3f2drmj9dzj1q0zr3sbmp9w6mpf"))))
    (properties `((upstream-name . "tolerance")))
    (build-system r-build-system)
    (propagated-inputs
     (list r-mass r-plotly))
    (home-page "https://cran.r-project.org/web/packages/tolerance/")
    (synopsis "Statistical tolerance intervals and regions")
    (description
     "This package provides functions for estimating tolerance
limits (intervals) for various univariate distributions (binomial, Cauchy,
discrete Pareto, exponential, two-parameter exponential, extreme value,
hypergeometric, Laplace, logistic, negative binomial, negative hypergeometric,
normal, Pareto, Poisson-Lindley, Poisson, uniform, and Zipf-Mandelbrot),
Bayesian normal tolerance limits, multivariate normal tolerance regions,
nonparametric tolerance intervals, tolerance bands for regression
settings (linear regression, nonlinear regression, nonparametric regression,
and multivariate regression), and analysis of variance tolerance intervals.
Visualizations are also available for most of these settings.")
    (license license:gpl2+)))

(define-public r-topdom
  (package
    (name "r-topdom")
    (version "0.10.1")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "TopDom" version))
       (sha256
        (base32 "1rryfnwvdlpdrjgs6sciy91cxfp4jykll0swclasydjvj4n642i6"))))
    (properties `((upstream-name . "TopDom")))
    (build-system r-build-system)
    (propagated-inputs (list r-ggplot2 r-matrixstats r-reshape2 r-tibble))
    (home-page "https://github.com/HenrikBengtsson/TopDom")
    (synopsis "Efficient method for identifying genomic topological domains")
    (description
     "This method identifies topological domains in genomes from Hi-C sequence
data.  The authors published an implementation of their method as an R script.
This package originates from those original @code{TopDom} R scripts and
provides help pages adopted from the original @code{TopDom} PDF documentation.
It also provides a small number of bug fixes to the original code.")
    ;; Either version of the GPL
    (license (list license:gpl2 license:gpl3))))

;; Keep this in sync with the liblantern package.
(define-public r-torch
  (package
    (name "r-torch")
    (version "0.14.2")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "torch" version))
       (sha256
        (base32 "1j0wgxr25h91c7x48svmgd0pbjl2ljn8rv6rsgw5a56vdgr992nb"))))
    (properties
     '((upstream-name . "torch")
       (updater-ignored-native-inputs . ("r-aten"))
       (updater-extra-inputs . ("python-pytorch-for-r-torch" "liblantern"))))
    (build-system r-build-system)
    (arguments
     (list
      #:phases
      (let ((python-version (version-major+minor (package-version python))))
        #~(modify-phases %standard-phases
            (add-after 'install 'link-libraries
              (lambda* (#:key inputs #:allow-other-keys)
                (let ((deps (string-append #$output "/site-library/torch/deps"))
                      (site-packages (string-append "/lib/python"
                                                    #$python-version
                                                    "/site-packages")))
                  (mkdir-p deps)
                  (symlink
                   (search-input-file
                    inputs (string-append site-packages "/torch/lib/libtorch.so"))
                   (string-append deps "/libtorch.so"))
                  (symlink
                   (search-input-file
                    inputs "/lib/liblantern.so")
                   (string-append deps "/liblantern.so")))))))))
    (inputs
     (list python-pytorch-for-r-torch
           liblantern))
    (propagated-inputs
     (list r-bit64
           r-callr
           r-cli
           r-coro
           r-desc
           r-glue
           r-jsonlite
           r-magrittr
           r-r6
           r-rcpp
           r-rlang
           r-safetensors
           r-scales
           r-withr))
    (native-inputs (list r-dplyr
                         r-knitr
                         r-mvtnorm
                         r-numderiv
                         r-testthat))
    (home-page "https://torch.mlverse.org/docs")
    (synopsis "Tensors and neural networks with GPU acceleration")
    (description
     "This package provides functionality to define and train neural networks
similar to PyTorch but written entirely in R using the libtorch library.  It
also supports low-level tensor operations and GPU acceleration.")
    (license license:expat)))

(define-public r-additivitytests
  (package
    (name "r-additivitytests")
    (version "1.1-4.2")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "additivityTests" version))
       (sha256
        (base32
         "07fms1mf71ycq6w2k3hmgl6q3sc5x4qkm7d0diymbbgpbpxggwh8"))))
    (properties
     `((upstream-name . "additivityTests")))
    (build-system r-build-system)
    (native-inputs (list r-knitr))
    (home-page "https://github.com/simecek/additivityTests")
    (synopsis "Additivity tests in the two way Anova with single sub-class numbers")
    (description
     "This package provides an implementation of the Tukey, Mandel,
Johnson-Graybill, LBI, Tusell and modified Tukey non-additivity tests.")
    (license license:gpl3)))

(define-public r-flexclust
  (package
    (name "r-flexclust")
    (version "1.5.0")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "flexclust" version))
       (sha256
        (base32
         "18sz94pvsnnx8nhr08q04p3gzls9grdvbrnv1hqlsnwb6cn5zyzh"))))
    (properties
     '((upstream-name . "flexclust")
       (updater-extra-native-inputs . ("r-ellipse"))))
    (build-system r-build-system)
    (propagated-inputs
     (list r-class r-lattice r-modeltools))
    (native-inputs (list r-ellipse))
    (home-page "https://cran.r-project.org/web/packages/flexclust/")
    (synopsis "Flexible cluster algorithms")
    (description
     "The main function @code{kcca} implements a general framework for
k-centroids cluster analysis supporting arbitrary distance measures and
centroid computation.  Further cluster methods include hard competitive
learning, neural gas, and QT clustering.  There are numerous visualization
methods for cluster results (neighborhood graphs, convex cluster hulls,
barcharts of centroids, ...), and bootstrap methods for the analysis of
cluster stability.")
    (license license:gpl2)))

(define-public r-biclust
  (package
    (name "r-biclust")
    (version "2.0.3.1")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "biclust" version))
       (sha256
        (base32
         "11fcb6z5lzz6yl8hsa8ppr53i8yn8k4m19k55ynznhkw780184c7"))))
    (properties `((upstream-name . "biclust")))
    (build-system r-build-system)
    (propagated-inputs
     (list r-additivitytests
           r-colorspace
           r-flexclust
           r-ggplot2
           r-lattice
           r-mass
           r-tidyr))
    (home-page "https://cran.r-project.org/web/packages/biclust/")
    (synopsis "BiCluster algorithms")
    (description
     "The main function @code{biclust()} provides several algorithms to find
biclusters in two-dimensional data, spectral, plaid model, xmotifs, and bimax.
In addition, the package provides methods for data
preprocessing (normalization and discretization), visualization, and
validation of bicluster solutions.")
    (license license:gpl3)))

(define-public r-icge
  (package
    (name "r-icge")
    (version "0.4.2")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "ICGE" version))
       (sha256
        (base32
         "13p9v0g5qda8bpj3sj9p277l7idv4jscrsszg2kn080dapp3cppp"))))
    (properties `((upstream-name . "ICGE")))
    (build-system r-build-system)
    (propagated-inputs
     (list r-cluster r-fastcluster r-mass))
    (home-page "https://cran.r-project.org/web/packages/ICGE/")
    (synopsis "Cluster estimation and identification of atypical units")
    (description
     "ICGE is a package that helps to estimate the number of real clusters in
data as well as to identify atypical units.  The underlying methods are based
on distances rather than on unit x variables.")
    (license license:gpl2+)))

(define-public r-depth
  (package
    (name "r-depth")
    (version "2.1-1.1")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "depth" version))
       (sha256
        (base32
         "0szy0027nh4ps1z919i740i50app5q7cfyg1fj7pdyl45nbl8k6m"))))
    (properties `((upstream-name . "depth")))
    (build-system r-build-system)
    (propagated-inputs
     (list r-abind r-circular r-rgl))
    (native-inputs
     (list gfortran))
    (home-page "https://cran.r-project.org/web/packages/depth/")
    (synopsis "Nonparametric depth functions for multivariate analysis")
    (description
     "This package provides tools for depth functions methodology applied to
multivariate analysis.  Besides allowing calculation of depth values and
depth-based location estimators, the package includes functions or drawing
contour plots and perspective plots of depth functions.  Euclidean and
spherical depths are supported.")
    (license license:gpl2)))

(define-public r-archetypes
  (package
    (name "r-archetypes")
    (version "2.2-0.2")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "archetypes" version))
       (sha256
        (base32
         "1cj0pb0998h1xyz3b6470a294lrzxlc1hd2ac0lq24i5ak4357fg"))))
    (properties `((upstream-name . "archetypes")))
    (build-system r-build-system)
    (propagated-inputs
     (list r-modeltools r-nnls))
    (home-page "https://cran.r-project.org/web/packages/archetypes")
    (synopsis "Archetypal analysis")
    (description
     "The main function @code{archetypes} implements a framework for
archetypal analysis supporting arbitrary problem solving mechanisms for the
different conceptual parts of the algorithm.")
    (license license:gpl2+)))

(define-public r-shapes
  (package
    (name "r-shapes")
    (version "1.2.7")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "shapes" version))
       (sha256
        (base32
         "155q6asc9202f85snyjaxhm8qpj7swgzhg95sisjy506gvcb6c8z"))))
    (properties `((upstream-name . "shapes")))
    (build-system r-build-system)
    (propagated-inputs
     (list r-mass r-minpack-lm r-rgl r-scatterplot3d))
    (home-page "https://www.maths.nottingham.ac.uk/~ild/shapes")
    (synopsis "Statistical shape analysis")
    (description
     "This package provides routines for the statistical analysis of landmark
shapes, including Procrustes analysis, graphical displays, principal
components analysis, permutation and bootstrap tests, thin-plate spline
transformation grids and comparing covariance matrices.  See Dryden, I.L.  and
Mardia, K.V. (2016).  Statistical shape analysis, with Applications in R (2nd
Edition), John Wiley and Sons.")
    (license license:gpl2)))

(define-public r-shapviz
  (package
    (name "r-shapviz")
    (version "0.9.7")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "shapviz" version))
       (sha256
        (base32 "0x5kzw465688ibdpl97bddakscsza1mjrvkvg4w3rp01ssrln3dw"))))
    (properties `((upstream-name . "shapviz")))
    (build-system r-build-system)
    (propagated-inputs (list r-ggfittext
                             r-gggenes
                             r-ggplot2
                             r-ggrepel
                             r-patchwork
                             r-rlang
                             r-xgboost))
    (native-inputs (list r-knitr r-testthat))
    (home-page "https://github.com/ModelOriented/shapviz")
    (synopsis "SHAP visualizations")
    (description
     "This package provides visualizations for SHAP (SHapley Additive
exPlanations) such as waterfall plots, force plots, various types of
importance plots, dependence plots, and interaction plots.  These plots act on
a @code{shapviz} object created from a matrix of SHAP values and a
corresponding feature dataset.  Wrappers for the R packages @code{xgboost},
@code{lightgbm}, @code{fastshap}, @code{shapr}, @code{h2o}, @code{treeshap},
@code{DALEX}, and @code{kernelshap} are added for convenience.  By separating
visualization and computation, it is possible to display factor variables in
graphs, even if the SHAP values are calculated by a model that requires
numerical features.  The plots are inspired by those provided by the
@code{shap} package in Python, but there is no dependency on it.")
    (license license:gpl2+)))

(define-public r-animation
  (package
    (name "r-animation")
    (version "2.7")
    (source (origin
              (method url-fetch)
              (uri (cran-uri "animation" version))
              (sha256
               (base32
                "0sg4sz5lkn85yzpcg22xkr7921cbnh7g74nlp9imjy7c0hdqyhc8"))
              (snippet
               '(for-each delete-file
                          '("inst/misc/scianimator/js/jquery.scianimator.min.js"
                            "inst/misc/scianimator/js/jquery-1.4.4.min.js")))))
    (properties `((upstream-name . "animation")))
    (build-system r-build-system)
    (arguments
     (list
      #:phases
      '(modify-phases %standard-phases
         (add-after 'unpack 'process-javascript
           (lambda* (#:key inputs #:allow-other-keys)
             (with-directory-excursion "inst/misc/"
               (symlink (search-input-file
                         inputs
                         "share/javascript/jquery.scianimator.min.js")
                        "scianimator/js/jquery.scianimator.min.js")
               (invoke "esbuild" (assoc-ref inputs "js-jquery")
                       "--minify"
                       (string-append "--outfile="
                                      "scianimator/js/jquery-1.4.4.min.js"))))))))
    (propagated-inputs (list r-magick))
    (inputs (list js-scianimator))
    (native-inputs
     `(("esbuild" ,esbuild)
       ("js-jquery"
        ,(origin
           (method url-fetch)
           (uri "https://code.jquery.com/jquery-1.4.4.js")
           (sha256
            (base32
             "10nl4smq63vrfb0c3n0fknm1zw7ss8gicy6wc6jb6l3rmyad075k"))))
       ("r-testit" ,r-testit)))
    (home-page "https://yihui.org/animation/")
    (synopsis "Gallery of animations and utilities to create animations")
    (description
     "This package provides functions for animations in statistics, covering
topics in probability theory, mathematical statistics, multivariate
statistics, non-parametric statistics, sampling survey, linear models, time
series, computational statistics, data mining and machine learning.  These
functions may be helpful in teaching statistics and data analysis.  Also
provided in this package are a series of functions to save animations to
various formats, e.g. GIF, HTML pages, PDF, and videos.  PDF animations can be
inserted into Sweave / @code{knitr} easily.")
    (license (list license:gpl2+ license:gpl3+))))

(define-public r-anthropometry
  (package
    (name "r-anthropometry")
    (version "1.19")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "Anthropometry" version))
       (sha256
        (base32
         "0aj70wm37bd5i4gzajvs6lf3zg0bz3kkf4srrcslg6drqk6n5z5l"))))
    (properties `((upstream-name . "Anthropometry")))
    (build-system r-build-system)
    (propagated-inputs
     (list r-archetypes
           r-biclust
           r-cluster
           r-ddalpha
           r-fnn
           r-icge
           r-nnls
           r-rgl
           r-shapes))
    (native-inputs
     (list r-knitr))
    (home-page "https://cran.r-project.org/web/packages/Anthropometry/")
    (synopsis "Statistical methods for anthropometric data")
    (description
     "This package provides statistical methods especially developed to
analyze anthropometric data.  These methods are aimed at providing effective
solutions to some commons problems related to Ergonomics and Anthropometry.
They are based on clustering, the statistical concept of data depth,
statistical shape analysis and archetypal analysis.")
    (license license:gpl2+)))

(define-public r-anytime
  (package
    (name "r-anytime")
    (version "0.3.11")
    (source (origin
              (method url-fetch)
              (uri (cran-uri "anytime" version))
              (sha256
               (base32
                "1qvb568x99cy68855zsv28llhky1badz34gnp6mdkvz1998qsl7z"))))
    (properties `((upstream-name . "anytime")))
    (build-system r-build-system)
    (propagated-inputs
     (list r-bh
           r-rcpp))
    (native-inputs (list r-tinytest))
    (home-page "https://dirk.eddelbuettel.com/code/anytime.html")
    (synopsis "Converter of input to POSIXct or Date")
    (description
     "The package converts the input in any one of character, integer, numeric,
factor, or an ordered type into @code{POSIXct} (or @code{Date}) objects, using
one of a number of predefined formats, and relying on Boost facilities for date
and time parsing.")
    (license license:gpl2+)))

(define-public r-anndata
  (package
    (name "r-anndata")
    (version "0.8.0")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "anndata" version))
       (sha256
        (base32 "0d9g77d1fm9v8mxvrz032r07q7896xgwzz9gg8wd3nlxwld54mj6"))))
    (properties `((upstream-name . "anndata")))
    (build-system r-build-system)
    (propagated-inputs (list r-assertthat
                             r-cli
                             r-lifecycle
                             r-matrix
                             r-r6
                             r-reticulate))
    (native-inputs (list r-knitr r-testthat))
    (home-page "https://anndata.dynverse.org")
    (synopsis "Anndata for R")
    (description
     "This package provides a reticulate wrapper for the Python package
@code{anndata}.  It provides a scalable way of keeping track of data and
learned annotations.  It is used to read from and write to the h5ad file
format.")
    (license license:expat)))

(define-public r-adamethods
  (package
    (name "r-adamethods")
    (version "1.2.1")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "adamethods" version))
       (sha256
        (base32
         "150awbd3skb1mqca18bqjykhyycqw8crviw66s6qrcnmcsbk77pj"))))
    (properties `((upstream-name . "adamethods")))
    (build-system r-build-system)
    (propagated-inputs
     (list r-anthropometry
           r-archetypes
           r-fnn
           r-foreach
           r-nnls
           r-tolerance
           r-univoutl))
    (home-page "https://cran.r-project.org/web/packages/adamethods/")
    (synopsis "Archetypoid algorithms and anomaly detection")
    (description
     "This package is a collection of several algorithms to obtain
archetypoids with small and large databases and with both classical
multivariate data and functional data (univariate and multivariate).  Some of
these algorithms also detect anomalies (outliers).")
    (license license:gpl2+)))

(define-public r-idpmisc
  (package
    (name "r-idpmisc")
    (version "1.1.21")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "IDPmisc" version))
       (sha256
        (base32
         "1308z4i2glr1260zjjymm19g3d7nk8djhdwdfbh7ipvkgsp9b2s7"))))
    (properties `((upstream-name . "IDPmisc")))
    (build-system r-build-system)
    (propagated-inputs
     (list r-lattice))
    (home-page "https://cran.r-project.org/web/packages/IDPmisc/")
    (synopsis "Functions for data analyses and visualization")
    (description
     "This package provides different high-level graphics functions for
displaying large datasets, displaying circular data in a very flexible way,
finding local maxima, brewing color ramps, drawing nice arrows, zooming
2D-plots, creating figures with differently colored margin and plot region.
In addition, the package contains auxiliary functions for data manipulation
like omitting observations with irregular values or selecting data by logical
vectors, which include NAs.  Other functions are especially useful in
spectroscopy and analyses of environmental data: robust baseline fitting,
finding peaks in spectra, converting humidity measures.")
    (license license:gpl3+)))

(define-public r-qqconf
  (package
    (name "r-qqconf")
    (version "1.3.2")
    (source (origin
              (method url-fetch)
              (uri (cran-uri "qqconf" version))
              (sha256
               (base32
                "18wfvljd6gbf9am3hh14fgp06gpa04vw9nhl7q07li7rmlkxc1cl"))))
    (properties `((upstream-name . "qqconf")))
    (build-system r-build-system)
    (inputs (list fftw))
    (propagated-inputs
     (list r-mass
           r-rcpp
           r-robustbase))
    (native-inputs (list pkg-config r-knitr))
    (home-page "https://github.com/eweine/qqconf")
    (synopsis "Create simultaneous testing bands for QQ-plots")
    (description
     "This package provides functionality for creating Quantile-Quantile (QQ) and
Probability-Probability (PP) plots with simultaneous testing bands to asses
significance of sample deviation from a reference distribution.")
    (license license:gpl3)))

(define-public r-qqman
  (package
    (name "r-qqman")
    (version "0.1.9")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "qqman" version))
       (sha256
        (base32
         "04xwqp4bnblrn0qijqv9bjdyy7b0vlflf87jg15ifxfkf4br6siz"))))
    (properties `((upstream-name . "qqman")))
    (build-system r-build-system)
    (propagated-inputs
     (list r-calibrate))
    (native-inputs
     (list r-knitr))
    (home-page "https://cran.r-project.org/web/packages/qqman/")
    (synopsis "Q-Q and Manhattan plots for GWAS data")
    (description
     "This package allows you to create Q-Q and Manhattan plots for GWAS data
from PLINK results.")
    (license license:gpl3)))

(define-public r-gghighlight
  (package
    (name "r-gghighlight")
    (version "0.4.1")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "gghighlight" version))
       (sha256
        (base32 "1lsvy9ha4d8zs927h8jbdj5r39xqcy1n6g5prw4awiihdvcv9v66"))))
    (properties `((upstream-name . "gghighlight")))
    (build-system r-build-system)
    (propagated-inputs
     (list r-dplyr r-ggplot2 r-ggrepel r-lifecycle r-purrr r-rlang r-tibble))
    (native-inputs (list r-knitr r-testthat))
    (home-page "https://github.com/yutannihilation/gghighlight/")
    (synopsis "Highlight lines and points in ggplot2")
    (description "Suppose we have data that has so many series that it is hard
to identify them by their colors as the differences are so subtle.  With
gghighlight we can highlight those lines that match certain criteria.  The
result is a usual @code{ggplot} object, so it is fully customizable and can be
used with custom themes and facets.")
    (license license:expat)))

(define-public r-ggplot-multistats
  (package
    (name "r-ggplot-multistats")
    (version "1.0.1")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "ggplot.multistats" version))
       (sha256
        (base32
         "0pffgv7ddwswmiw9nbq907sx2bnwaq88bfiq0gjl2rnqywmh8jpw"))))
    (properties
     `((upstream-name . "ggplot.multistats")))
    (build-system r-build-system)
    (propagated-inputs
     (list r-ggplot2 r-hexbin r-rlang r-scales))
    (home-page "https://github.com/flying-sheep/ggplot.multistats")
    (synopsis "Multiple summary statistics for binned stats/geometries")
    (description
     "This package provides the ggplot binning layer @code{stat_summaries_hex()},
which functions similar to its singular form, but allows the use of multiple
statistics per bin.  Those statistics can be mapped to multiple bin
aesthetics.")
    (license license:gpl3)))

(define-public r-knn-covertree
  (package
    (name "r-knn-covertree")
    (version "1.0")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "knn.covertree" version))
       (sha256
        (base32
         "0msfcmwydws7q7m5jdb0dxab0nkbl7mq5llg6v3r4qrnlvrdggvz"))))
    (properties `((upstream-name . "knn.covertree")))
    (build-system r-build-system)
    (propagated-inputs
     (list r-matrix r-rcpp r-rcppeigen))
    (native-inputs
     (list r-testthat))
    (home-page "https://github.com/flying-sheep/knn.covertree")
    (synopsis "Accurate kNN Implementation with multiple distance measures")
    (description
     "Similarly to the FNN package, this package allows calculation of the k
nearest neighbors (kNN) of a data matrix.  The implementation is based on
cover trees introduced by Alina Beygelzimer, Sham Kakade, and John
Langford (2006) @url{doi:10.1145/1143844.1143857}.")
    (license license:agpl3+)))

(define-public r-poibin
  (package
    (name "r-poibin")
    (version "1.6")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "poibin" version))
       (sha256
        (base32
         "1y5wxpvp3nxn57lgnkmd92n2y5y5dh5mhk62kcv8dbly1gnpkl0a"))))
    (properties `((upstream-name . "poibin")))
    (build-system r-build-system)
    (home-page "https://cran.r-project.org/web/packages/poibin/")
    (synopsis "Poisson binomial distribution")
    (description
     "This package provides an implementation of both the exact and
approximation methods for computing the @dfn{cumulative distribution
function} (CDF) of the Poisson binomial distribution.  It also provides the
@dfn{probability mass function} (PMF), quantile function, and random number
generation for the Poisson binomial distribution.")
    (license license:gpl2)))

(define-public r-diagram
  (package
    (name "r-diagram")
    (version "1.6.5")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "diagram" version))
       (sha256
        (base32
         "1r3lyl0h7mk9cfg8smr3jydfkjdawaphnxibkxfjqa7029vkxh79"))))
    (properties `((upstream-name . "diagram")))
    (build-system r-build-system)
    (propagated-inputs
     (list r-shape))
    (home-page "https://cran.r-project.org/web/packages/diagram/")
    (synopsis "Visualize simple graphs (networks) and plot flow diagrams")
    (description
     "This package provides tools to visualize simple graphs (networks) based
on a transition matrix, utilities to plot flow diagrams, visualizing webs,
electrical networks, etc.  It also includes supporting material for the book
\"A practical guide to ecological modelling - using R as a simulation
platform\" by Karline Soetaert and Peter M.J. Herman (2009) and the book
\"Solving Differential Equations in R\" by Karline Soetaert, Jeff Cash and
Francesca Mazzia (2012).")
    (license license:gpl2+)))

(define-public r-lim
  (package
    (name "r-lim")
    (version "1.4.7.2")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "LIM" version))
       (sha256
        (base32
         "0yik2k09cspnacvglhfbhv2ppx3v0lh827qyz5s4y7qb155z27a6"))))
    (properties `((upstream-name . "LIM")))
    (build-system r-build-system)
    (propagated-inputs
     (list r-diagram r-limsolve))
    (home-page "https://cran.r-project.org/web/packages/LIM/")
    (synopsis "Linear inverse model examples and solution methods")
    (description
     "This package provides functions that read and solve linear inverse
problems (food web problems, linear programming problems).")
    (license license:gpl2+)))

(define-public r-shinycssloaders
  (package
    (name "r-shinycssloaders")
    (version "1.1.0")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "shinycssloaders" version))
       (sha256
        (base32
         "0w7gw81j5d2dvjdk49dd222bqd40ll3sl8mykg68vcz64ihdg2h3"))))
    (properties
     `((upstream-name . "shinycssloaders")))
    (build-system r-build-system)
    (propagated-inputs
     (list r-digest r-glue r-htmltools r-shiny))
    (home-page "https://github.com/andrewsali/shinycssloaders")
    (synopsis "Add CSS loading animations to Shiny outputs")
    (description
     "This package provides tools to create a lightweight Shiny wrapper for
the css-loaders created by Luke Hass
@url{https://github.com/lukehaas/css-loaders}.  Wrapping a Shiny output will
automatically show a loader when the output is (re)calculating.")
    (license license:gpl3)))

(define-public r-rsvg
  (package
    (name "r-rsvg")
    (version "2.6.2")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "rsvg" version))
       (sha256
        (base32
         "0syp6awq9p8x50d16csjnwv4jyi5dm5j6sy58s6r898hflf2c2ib"))))
    (properties `((upstream-name . "rsvg")))
    (build-system r-build-system)
    (inputs
     (list (librsvg-for-system) pcre2 zlib))
    (native-inputs
     (list pkg-config
           r-knitr
           r-magick
           r-png
           r-spelling
           r-testthat))
    (home-page "https://github.com/jeroen/rsvg#readme")
    (synopsis "Render SVG images into PDF, PNG, PostScript, or Bitmap arrays")
    (description
     "This package allows you to render vector-based SVG images into
high-quality custom-size bitmap arrays using the librsvg2 library.  The
resulting bitmap can be written to e.g. PNG, JPEG or WEBP format.  In
addition, the package can convert images directly to various formats such as
PDF or PostScript.")
    (license license:expat)))

(define-public r-influencer
  (package
    (name "r-influencer")
    (version "0.1.5")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "influenceR" version))
       (sha256
        (base32
         "137m40xs9xfqcm88gi7w86b310rysf3a973wp7x3543n1y1f8r41"))))
    (properties `((upstream-name . "influenceR")))
    (build-system r-build-system)
    (propagated-inputs
     (list r-igraph r-matrix))
    (native-inputs (list r-testthat))
    (home-page "https://github.com/rcc-uchicago/influenceR")
    (synopsis "Tools to quantify structural importance of nodes in a network")
    (description
     "This package provides functionality to compute various node centrality
measures on networks.  Included are functions to compute betweenness
centrality (by utilizing Madduri and Bader's SNAP library), implementations of
Burt's constraint and @dfn{effective network size} (ENS) metrics, Borgatti's
algorithm to identify key players, and Valente's bridging metric.  The
betweenness, Key Players, and bridging implementations are parallelized with
OpenMP.")
    (license license:gpl2)))

(define-public r-emplik
  (package
    (name "r-emplik")
    (version "1.3-2")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "emplik" version))
       (sha256
        (base32
         "1n36fxavkfx0ham5wglvlqgyi0c8l1g5jy2xv1a8kfd1r2r5zhbx"))))
    (properties `((upstream-name . "emplik")))
    (build-system r-build-system)
    (propagated-inputs
     (list r-quantreg))
    (native-inputs (list r-testthat))
    (home-page "https://www.ms.uky.edu/~mai/EmpLik.html")
    (synopsis "Empirical likelihood ratio for censored/truncated data")
    (description
     "This package provides empirical likelihood ratio tests for
means/quantiles/hazards from possibly censored and/or truncated data.  It also
does regression.")
    (license license:gpl2+)))

(define-public r-imputeyn
  (package
    (name "r-imputeyn")
    (version "1.3")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "imputeYn" version))
       (sha256
        (base32
         "1b21w1aa5f7yiq8k0wa86wvbg4ij7f6ldwn6asfqwb0b90rvsgvs"))))
    (properties `((upstream-name . "imputeYn")))
    (build-system r-build-system)
    (propagated-inputs
     (list r-boot r-emplik r-mvtnorm r-quadprog r-survival))
    (home-page "https://cran.r-project.org/web/packages/imputeYn/")
    (synopsis "Impute last largest censored observation under weighted least squares")
    (description
     "This package allows for the imputation of the last largest censored
observantions.  This method brings less bias and more efficient estimates for
AFT models.")
    (license license:gpl2)))

(define-public r-adapenetclass
  (package
    (name "r-adapenetclass")
    (version "1.2")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "AdapEnetClass" version))
       (sha256
        (base32
         "01k3mj4g1ckbng7wkzzn9h0k9yf01cpnnkly0sjda574c5jhj0rc"))))
    (properties `((upstream-name . "AdapEnetClass")))
    (build-system r-build-system)
    (propagated-inputs
     (list r-glmnet r-imputeyn r-lars r-quadprog))
    (home-page "https://cran.r-project.org/web/packages/AdapEnetClass/")
    (synopsis "Class of adaptive elastic net methods for censored data")
    (description
     "This package provides methods for variable selection for AFT models.")
    (license license:gpl2)))

(define-public r-flock
  (package
    (name "r-flock")
    (version "0.7")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "flock" version))
       (sha256
        (base32
         "1zg93p74icj4bhxnmnssj2xp6vw4yaksyavq03497v33xfpdxss7"))))
    (properties `((upstream-name . "flock")))
    (build-system r-build-system)
    (propagated-inputs (list r-rcpp))
    (home-page "https://cran.r-project.org/web/packages/flock/")
    (synopsis "Process synchronization using file locks")
    (description
     "This package implements synchronization between R processes (spawned by
using the @code{parallel} package for instance) using file locks.  It supports
both exclusive and shared locking.")
    (license license:asl2.0)))

(define-public r-archivist
  (package
    (name "r-archivist")
    (version "2.3.8")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "archivist" version))
       (sha256
        (base32
         "1qb8cim9acp4zz8rrl0drrzr2nj7msj6sghlzrll4jxgv2xi7nzi"))))
    (properties `((upstream-name . "archivist")))
    (build-system r-build-system)
    (propagated-inputs
     (list r-dbi
           r-digest
           r-flock
           r-httr
           r-lubridate
           r-magrittr
           r-rcurl
           r-rsqlite))
    (native-inputs (list r-testthat))
    (home-page "https://pbiecek.github.io/archivist/")
    (synopsis "Tools for storing, restoring and searching for R objects")
    (description
     "Data exploration and modelling is a process in which a lot of data
artifacts are produced.  Artifacts like: subsets, data aggregates, plots,
statistical models, different versions of data sets and different versions of
results.  Archivist helps to store and manage artifacts created in R.  It
allows you to store selected artifacts as binary files together with their
metadata and relations.  Archivist allows sharing artifacts with others.  It
can look for already created artifacts by using its class, name, date of the
creation or other properties.  It also makes it easy to restore such
artifacts.")
    (license license:gpl2)))

(define-public r-versions
  (package
    (name "r-versions")
    (version "0.3")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "versions" version))
       (sha256
        (base32
         "0zm49j785dgv7fyr1yl9q5f0dsk8hhpim5q5bpkgrkzv7pwjribd"))))
    (properties `((upstream-name . "versions")))
    (build-system r-build-system)
    (home-page "https://cran.r-project.org/web/packages/versions/")
    (synopsis "Query and install specific versions of CRAN packages")
    (description
     "This package allows you to install specified versions of R packages
hosted on CRAN and provides functions to list available versions and the
versions of currently installed packages.")
    (license license:bsd-3)))

(define-public r-adapr
  (package
    (name "r-adapr")
    (version "2.0.0")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "adapr" version))
       (sha256
        (base32
         "1s57jdbi5pik56xjz1d4438ax6cywg2yq2s47h5g6wrwvpgr1qfw"))))
    (properties `((upstream-name . "adapr")))
    (build-system r-build-system)
    (propagated-inputs
     (list r-archivist
           r-devtools
           r-digest
           r-doparallel
           r-gdata
           r-ggplot2
           r-git2r
           r-igraph
           r-knitr
           r-plotly
           r-plyr
           r-rmarkdown
           r-shiny
           r-shinydashboard
           r-versions))
    (home-page "https://cran.r-project.org/web/packages/adapr/")
    (synopsis "Implementation of an accountable data analysis process")
    (description
     "This package tracks reading and writing within R scripts that are
organized into a directed acyclic graph.  It contains an interactive Shiny
application @code{adaprApp()}.  It uses Git and file hashes to track version
histories of inputs and outputs.")
    (license license:lgpl2.0)))

(define-public r-adapsamp
  (package
    (name "r-adapsamp")
    (version "1.1.1")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "AdapSamp" version))
       (sha256
        (base32
         "1jayjrsiib2ij4rxxj59g71r3xhzl5yqh0lhi8k6cfy03i7dkvis"))))
    (properties `((upstream-name . "AdapSamp")))
    (build-system r-build-system)
    (propagated-inputs (list r-pracma))
    (home-page "https://cran.r-project.org/web/packages/AdapSamp/")
    (synopsis "Adaptive sampling algorithms")
    (description
     "For distributions whose probability density functions are log-concave,
the adaptive rejection sampling algorithm can be used to build envelope
functions for sampling.  For others, the modified adaptive rejection sampling
algorithm, the concave-convex adaptive rejection sampling algorithm, and the
adaptive slice sampling algorithm can be used.  This R package mainly includes
these four functions: @code{rARS()}, @code{rMARS()}, @code{rCCARS()}, and
@code{rASS()}.  These functions can realize sampling based on the algorithms
above.")
    (license license:gpl2)))

(define-public r-adaptalint
  (package
    (name "r-adaptalint")
    (version "0.2.4")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "adaptalint" version))
       (sha256
        (base32
         "15qdcvnnbgcps8j5k79354wsc9alswijv8lcafg2i3lghaw536yf"))))
    (properties `((upstream-name . "adaptalint")))
    (build-system r-build-system)
    (propagated-inputs
     (list r-dplyr r-lintr r-purrr))
    (native-inputs (list r-testthat))
    (home-page "https://cran.r-project.org/web/packages/adaptalint/")
    (synopsis "Check R code style")
    (description
     "This package provides tools to infer the code style (which style rules
are followed and which ones are not) from one package and use it to check
another.  This makes it easier to find and correct the most important problems
first.")
    (license license:gpl3)))

(define-public r-fracdiff
  (package
    (name "r-fracdiff")
    (version "1.5-3")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "fracdiff" version))
       (sha256
        (base32
         "1h3zpy6j6w4w09nfh42jb58q0z5l3g4s556hza9zzzlj81mr940g"))))
    (properties `((upstream-name . "fracdiff")))
    (build-system r-build-system)
    (home-page "https://github.com/mmaechler/fracdiff")
    (synopsis
     "Fractionally differenced ARIMA aka ARFIMA(P,d,q) models")
    (description
     "This package provides tools for the maximum likelihood estimation of the
parameters of a fractionally differenced ARIMA(p,d,q) model (Haslett and
Raftery, Appl.Statistics, 1989); it includes inference and basic methods.")
    (license license:gpl2+)))

(define-public r-forecast
  (package
    (name "r-forecast")
    (version "8.24.0")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "forecast" version))
       (sha256
        (base32
         "0ihnsrxz6y1ms4059ppdxyg854jdwvlvq7kaklvxzqx3pzqz22zv"))))
    (properties
     '((upstream-name . "forecast")
       (updater-ignored-native-inputs . ("r-seasonal"))))
    (build-system r-build-system)
    (propagated-inputs
     (list r-colorspace
           r-fracdiff
           r-generics
           r-ggplot2
           r-lmtest
           r-magrittr
           r-nnet
           r-rcpp
           r-rcpparmadillo
           r-timedate
           r-tseries
           r-urca
           r-withr
           r-zoo))
    (native-inputs
     (list r-knitr))
    (home-page "https://pkg.robjhyndman.com/forecast/")
    (synopsis "Forecasting functions for time series and linear models")
    (description
     "This package provides methods and tools for displaying and analysing
univariate time series forecasts including exponential smoothing via state
space models and automatic ARIMA modelling.")
    (license license:gpl3)))

(define-public r-forestplot
  (package
    (name "r-forestplot")
    (version "3.1.6")
    (source (origin
              (method url-fetch)
              (uri (cran-uri "forestplot" version))
              (sha256
               (base32
                "1ijy8lir8l2pwg4y2anfi84c47ssq26z97ixnswbssk9ih07r7qh"))))
    (properties
     '((upstream-name . "forestplot")
       ;; Avoid dependency cycles.
       (updater-ignored-native-inputs . ("r-gmisc" "r-greg"))))
    (build-system r-build-system)
    (arguments
     (list
      #:phases
      '(modify-phases %standard-phases
         (add-after 'unpack 'delete-bad-tests
           (lambda _
             ;; This depends on r-greg, which depends on this package.
             (delete-file "tests/test_visual_with_Greg.R"))))))
    (propagated-inputs
     (list r-abind r-checkmate))
    (native-inputs (list r-dplyr
                         r-knitr
                         r-rms
                         r-testthat
                         r-tibble
                         r-tidyverse))
    (home-page "https://gforge.se/packages/")
    (synopsis "Advanced forest plot using @code{grid} graphics")
    (description
     "This package provides a forest plot that allows for multiple
confidence intervals per row, custom fonts for each text element,
custom confidence intervals, text mixed with expressions, and more.
The aim is to extend the use of forest plots beyond meta-analyses.
This is a more general version of the original @code{rmeta} package's
@code{forestplot()} function and relies heavily on the @code{grid}
package.")
    (license license:gpl2)))

(define-public r-formattable
  (package
    (name "r-formattable")
    (version "0.2.1")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "formattable" version))
       (sha256
        (base32 "1vdxi0xmg019qyzjrp8bkjxciz245jcxsrkhfzd44ynqcwi4s3ag"))))
    (properties
     '((upstream-name . "formattable")
       (updater-extra-native-inputs . ("r-dt" "r-shiny"))))
    (build-system r-build-system)
    (propagated-inputs
     (list r-htmltools r-htmlwidgets r-knitr r-rmarkdown))
    (native-inputs
     (list r-dt r-knitr r-shiny r-testthat))
    (home-page "https://github.com/renkun-ken/formattable")
    (synopsis "Print vectors and data frames with text formatting")
    (description
     "This R package provides functions to create formattable vectors and data
frames.  @emph{Formattable} vectors are printed with text formatting, and
formattable data frames are printed with multiple types of formatting in HTML
to improve the readability of data presented in tabular form rendered in web
pages.")
    (license license:expat)))

(define-public r-formula-tools
  (package
    (name "r-formula-tools")
    (version "1.7.1")
    (source (origin
              (method url-fetch)
              (uri (cran-uri "formula.tools" version))
              (sha256
               (base32
                "15d3ikfmsh9zszfgfkrxb3jkipl41inm7n6bhs73kwlnklnygq2g"))))
    (properties `((upstream-name . "formula.tools")))
    (build-system r-build-system)
    (propagated-inputs (list r-operator-tools))
    (native-inputs (list r-testthat))
    (home-page "https://github.com/decisionpatterns/formula.tools")
    (synopsis
     "Utilities for manipulating formulas, calls, assignments and other R objects")
    (description
     "These utilities facilitate the programmatic manipulations of formulas,
expressions, calls, assignments and other R language objects.  These objects
all share the same structure: a left-hand side, operator and right-hand side.
This package provides methods for accessing and modifying this structures as
well as extracting and replacing names and symbols from these objects.")
    (license license:gpl2)))

(define-public r-proxyc
  (package
    (name "r-proxyc")
    (version "0.5.2")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "proxyC" version))
       (sha256
        (base32
         "1847iz54pg4mp3s4sd8rmzarc8rciz477k4sm324ykmh9l758lbj"))))
    (properties `((upstream-name . "proxyC")))
    (build-system r-build-system)
    (arguments
     (list
      #:phases
      '(modify-phases %standard-phases
         (add-after 'unpack 'patch-bad-tests
           (lambda _
             ;; Two tests produce harmless warnings.
             (substitute* '("tests/testthat/test-dist.R"
                            "tests/testthat/test-simil.R")
               ((".*use_nan is working.*" m)
                (string-append m "skip('skip');\n"))))))))
    (native-inputs (list r-entropy r-knitr r-proxy r-testthat))
    (inputs (list tbb))
    (propagated-inputs
     (list r-matrix r-rcpp r-rcpparmadillo))
    (home-page "https://cran.r-project.org/package=proxyC")
    (synopsis "Compute proximity in large sparse matrices")
    (description
     "This package provides efficient tools to compute the proximity between
rows or columns of large matrices.  Functions are optimised for large sparse
matrices using the Armadillo and Intel TBB libraries.  Among several built-in
similarity/distance measures, computation of correlation, cosine similarity
and Euclidean distance is particularly fast.")
    (license license:gpl3)))

(define-public r-isocodes
  (package
    (name "r-isocodes")
    (version "2025.05.18")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "ISOcodes" version))
       (sha256
        (base32
         "03av713l5szg9cp7kmhp2yplsi91l089yx2bb2xhjfxgpn9p3nnv"))))
    (properties `((upstream-name . "ISOcodes")))
    (build-system r-build-system)
    (home-page "https://cran.r-project.org/package=ISOcodes")
    (synopsis "Selected ISO codes")
    (description
     "This package provides ISO language, territory, currency, script and
character codes.  It provides ISO 639 language codes, ISO 3166 territory
codes, ISO 4217 currency codes, ISO 15924 script codes, and the ISO 8859
character codes as well as the UN M.49 area codes.")
    (license license:gpl2)))

(define-public r-stopwords
  (package
    (name "r-stopwords")
    (version "2.3")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "stopwords" version))
       (sha256
        (base32
         "1ci1cgxrcvlhhplximsfv0plvjdbcd5kv0nphxnpildsn5m1rv65"))))
    (properties `((upstream-name . "stopwords")))
    (build-system r-build-system)
    (propagated-inputs
     (list r-isocodes))
    (native-inputs (list r-testthat))
    (home-page "https://github.com/quanteda/stopwords")
    (synopsis "Multilingual stopword lists")
    (description
     "This package provides multiple sources of stopwords, for use in text
analysis and natural language processing.")
    (license license:expat)))

(define-public r-storr
  (package
    (name "r-storr")
    (version "1.2.6")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "storr" version))
       (sha256
        (base32 "1spfnizyjdn1idl293k07zcgb32h2wi444vas8hwvm7ngbc6m9y5"))))
    (properties
     `((upstream-name . "storr")
       ;; Avoid dependency cycle.
       (updater-ignored-native-inputs . ("r-redux"))))
    (build-system r-build-system)
    (propagated-inputs (list r-digest r-r6))
    (native-inputs (list r-dbi
                         r-knitr
                         r-mockr
                         r-rpostgres
                         r-rsqlite
                         r-testthat))
    (home-page "https://github.com/richfitz/storr")
    (synopsis "Simple key value stores")
    (description
     "This package creates and manages simple key-value stores.  These can use
a variety of approaches for storing the data.  This package implements the
base methods and support for file system, in-memory and DBI-based database
stores.")
    (license license:expat)))

(define-public r-spacyr
  (package
    (name "r-spacyr")
    (version "1.3.0")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "spacyr" version))
       (sha256
        (base32
         "1z4nx8phrc0l73xic2lkff03a54kjw343425h5mm2afz6zidcmf4"))))
    (properties `((upstream-name . "spacyr")))
    (build-system r-build-system)
    (arguments
     (list
      #:phases
      '(modify-phases %standard-phases
         ;; When there is no HOME directory, this package will fail to find
         ;; the vignette builder.
         (add-after 'unpack 'set-HOME
           (lambda _ (setenv "HOME" "/tmp"))))))
    (propagated-inputs
     (list r-data-table r-reticulate))
    (native-inputs
     (list r-r-rsp r-testthat))
    (home-page "https://spacyr.quanteda.io")
    (synopsis "R wrapper for the spaCy NLP library")
    (description
     "This package provides an R wrapper to the Python @dfn{natural language
processing} (NLP) library @code{spaCy}, from @url{http://spacy.io}.")
    (license license:gpl3)))

(define-public r-snowballc
  (package
    (name "r-snowballc")
    (version "0.7.1")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "SnowballC" version))
       (sha256
        (base32
         "0d60h5qpk0vahcxm1y6ryqj00s4yrsdz671vq1i1cx8668zz2g3m"))))
    (properties `((upstream-name . "SnowballC")))
    (build-system r-build-system)
    (home-page "https://r-forge.r-project.org/projects/r-temis/")
    (synopsis "Snowball stemmers based on the C libstemmer UTF-8 library")
    (description
     "This package provides an R interface to the C @code{libstemmer} library
that implements Porter's word stemming algorithm for collapsing words to a
common root to aid comparison of vocabulary.  Currently supported languages
are Danish, Dutch, English, Finnish, French, German, Hungarian, Italian,
Norwegian, Portuguese, Romanian, Russian, Spanish, Swedish and Turkish.")
    (license license:bsd-3)))

(define-public r-quanteda
  (package
    (name "r-quanteda")
    (version "4.3.0")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "quanteda" version))
       (sha256
        (base32
         "08h3ypxmk50haicvbyxkhk4wimx8d9ia133m67v4smhhyp5cb89b"))))
    (properties `((upstream-name . "quanteda")))
    (build-system r-build-system)
    (propagated-inputs
     (list r-fastmatch
           r-jsonlite
           r-lifecycle
           r-magrittr
           r-matrix
           r-rcpp
           r-snowballc
           r-stopwords
           r-stringi
           r-xml2
           r-yaml))
    (inputs (list tbb))
    (native-inputs
     (list pkg-config r-knitr r-testthat))
    (home-page "https://quanteda.io")
    (synopsis "Quantitative analysis of textual data")
    (description
     "This package provides a fast, flexible, and comprehensive framework for
quantitative text analysis in R.  It provides functionality for corpus
management, creating and manipulating tokens and ngrams, exploring keywords in
context, forming and manipulating sparse matrices of documents by features and
feature co-occurrences, analyzing keywords, computing feature similarities and
distances, applying content dictionaries, applying supervised and unsupervised
machine learning, visually representing text and text analyses, and more.")
    (license license:gpl3)))

(define-public r-topicmodels
  (package
    (name "r-topicmodels")
    (version "0.2-17")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "topicmodels" version))
       (sha256
        (base32
         "138nsmwgg3npk3i78xagpm6fw1g4ixmikan1jmv3066kymgy2rrq"))))
    (properties
     '((upstream-name . "topicmodels")
       (updater-extra-inputs . ("gsl"))))
    (build-system r-build-system)
    (inputs (list gsl))
    (propagated-inputs
     (list r-modeltools r-slam r-tm))
    (home-page "https://cran.r-project.org/package=topicmodels")
    (synopsis "Topic models")
    (description
     "This package provides an interface to the C code for @dfn{Latent
Dirichlet Allocation} (LDA) models and @dfn{Correlated Topics Models} (CTM) by
David M. Blei and co-authors and the C++ code for fitting LDA models using
Gibbs sampling by Xuan-Hieu Phan and co-authors.")
    (license license:gpl2)))

(define-public r-stm
  (package
    (name "r-stm")
    (version "1.3.7")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "stm" version))
       (sha256
        (base32
         "0cvv6q5r55iqk327rav25dymvnn77rj8chmgkbkwd0c1dpqf4x5q"))))
    (properties `((upstream-name . "stm")))
    (build-system r-build-system)
    ;; Disable vignettes because they need internet access.
    (arguments (list #:test-types '(list "tests")))
    (propagated-inputs
     (list r-data-table
           r-glmnet
           r-lda
           r-matrix
           r-matrixstats
           r-quadprog
           r-quanteda
           r-rcpp
           r-rcpparmadillo
           r-slam
           r-stringr))
    (native-inputs (list r-testthat r-tm))
    (home-page "https://www.structuraltopicmodel.com/")
    (synopsis "Estimation of the Structural Topic Model")
    (description
     "The @dfn{Structural Topic Model} (STM) allows researchers to estimate
topic models with document-level covariates.  The package also includes tools
for model selection, visualization, and estimation of topic-covariate
regressions.")
    (license license:expat)))

(define-public r-polycor
  (package
    (name "r-polycor")
    (version "0.8-1")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "polycor" version))
       (sha256
        (base32
         "0285rvx8238qp8dix0jq0cqq7ks8h6cjwsscbc7dx4n9nph56pzh"))))
    (properties `((upstream-name . "polycor")))
    (build-system r-build-system)
    (propagated-inputs
     (list r-admisc r-matrix r-mvtnorm))
    (home-page "https://r-forge.r-project.org/projects/polycor/")
    (synopsis "Polychoric and polyserial correlations")
    (description
     "This package provides tools to compute polychoric and polyserial
correlations by quick \"two-step\" methods or ML, optionally with standard
errors; tetrachoric and biserial correlations are special cases.")
    (license license:gpl2+)))

(define-public r-msm
  (package
    (name "r-msm")
    (version "1.8.2")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "msm" version))
       (sha256
        (base32
         "09my3vgj0d2w0g6dn0fh4clcqqh0xbyxp44nphap6kdmg0wkb5sv"))))
    (properties `((upstream-name . "msm")))
    (build-system r-build-system)
    (propagated-inputs
     (list r-expm r-generics r-mvtnorm r-survival r-tibble))
    (native-inputs (list r-testthat))
    (home-page "https://github.com/chjackson/msm")
    (synopsis "Multi-state Markov and hidden Markov models in continuous time")
    (description
     "This package provides functions for fitting continuous-time Markov and
hidden Markov multi-state models to longitudinal data.  It was designed for
processes observed at arbitrary times in continuous time (panel data) but some
other observation schemes are supported.  Both Markov transition rates and the
hidden Markov output process can be modelled in terms of covariates, which may
be constant or piecewise-constant in time.")
    (license license:gpl2+)))

(define-public r-ltm
  (package
    (name "r-ltm")
    (version "1.2-0")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "ltm" version))
       (sha256
        (base32
         "0vhgbk6j0z3limsrbjkjkpfn2whiaij5j4jf1gg66mjs9dlylap1"))))
    (properties `((upstream-name . "ltm")))
    (build-system r-build-system)
    (propagated-inputs
     (list r-mass r-msm r-polycor))
    (home-page "https://github.com/drizopoulos/ltm")
    (synopsis "Latent trait models under IRT")
    (description
     "This is a package supporting the analysis of multivariate dichotomous
and polytomous data using latent trait models under the Item Response Theory
approach.  It includes the Rasch, the Two-Parameter Logistic, the Birnbaum's
Three-Parameter, the Graded Response, and the Generalized Partial Credit
Models.")
    (license license:gpl2+)))

(define-public r-mi
  (package
    (name "r-mi")
    (version "1.1")
    (source
      (origin
        (method url-fetch)
        (uri (cran-uri "mi" version))
        (sha256
          (base32
            "11f75ivnax6p48mp2pasprws488cm2daym87sw2mcrywvf89fyjd"))))
    (properties `((upstream-name . "mi")))
    (build-system r-build-system)
    (propagated-inputs
     (list r-arm r-matrix))
    (native-inputs
     (list r-betareg r-knitr r-survival r-truncnorm))
    (home-page "http://www.stat.columbia.edu/~gelman/")
    (synopsis "Missing data imputation and model checking")
    (description
     "This package provides functions for data manipulation, imputing missing
values in an approximate Bayesian framework, diagnostics of the models used to
generate the imputations, confidence-building mechanisms to validate some of
the assumptions of the imputation algorithm, and functions to analyze multiply
imputed data sets with the appropriate degree of sampling uncertainty.")
    (license license:gpl2+)))

(define-public r-matrixcalc
  (package
    (name "r-matrixcalc")
    (version "1.0-6")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "matrixcalc" version))
       (sha256
        (base32
         "09pk0ym6qzribxc6v18cpb6478i4r4kzxpkljjbb3n323zqx5iqb"))))
    (properties `((upstream-name . "matrixcalc")))
    (build-system r-build-system)
    (home-page "https://cran.r-project.org/web/packages/matrixcalc/")
    (synopsis "Collection of functions for matrix calculations")
    (description
     "This package provides a collection of functions to support matrix
calculations for probability, econometric and numerical analysis.  There are
additional functions that are comparable to APL functions which are useful for
actuarial models such as pension mathematics.")
    (license license:gpl2+)))

(define-public r-matrixextra
  (package
    (name "r-matrixextra")
    (version "0.1.15")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "MatrixExtra" version))
       (sha256
        (base32 "0mp0si5923kfakwxcc08288zyx1nrrrpn9srcwax28vrz46l33z9"))))
    (properties `((upstream-name . "MatrixExtra")))
    (build-system r-build-system)
    (propagated-inputs
     (list r-float r-matrix r-rcpp r-rhpcblasctl))
    (native-inputs
     (list r-data-table r-knitr r-testthat))
    (home-page "https://github.com/david-cortes/MatrixExtra")
    (synopsis "Extra methods for sparse matrices")
    (description
     "This package extends sparse matrix and vector classes from the Matrix
package by providing:

@enumerate
@item Methods and operators that work natively on CSR formats (compressed
  sparse row, a.k.a. @code{RsparseMatrix}) such as slicing/sub-setting,
  assignment, @code{rbind()}, mathematical operators for CSR and COO such as
  addition or @code{sqrt()}, and methods such as @code{diag()};
@item Multi-threaded matrix multiplication and cross-product for many
  @code{<sparse, dense>} types, including the @code{float32} type from
  @code{float};
@item Coercion methods between pairs of classes which are not present in
  @code{Matrix}, such as from @code{dgCMatrix} to @code{ngRMatrix}, as well as
  convenience conversion functions;
@item Utility functions for sparse matrices such as sorting the indices or
  removing zero-valued entries;
@item Fast transposes that work by outputting in the opposite storage format;
@item Faster replacements for many @code{Matrix} methods for all sparse types,
  such as slicing and elementwise multiplication.
@item Convenience functions for sparse objects, such as @code{mapSparse} or a
  shorter @code{show} method.
@end enumerate
")
    (license license:gpl2+)))

(define-public r-sem
  (package
    (name "r-sem")
    (version "3.1-16")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "sem" version))
       (sha256
        (base32
         "0jy9hp85w3lnicymw9881qk7z7ypvz6iy7dd88qqxc6pknzkx7x3"))))
    (properties `((upstream-name . "sem")))
    (build-system r-build-system)
    (propagated-inputs
     (list r-boot r-mass r-mi))
    (home-page "https://cran.r-project.org/package=sem")
    (synopsis "Structural equation models")
    (description
     "This package provides functions for fitting general linear structural
equation models (with observed and latent variables) using the RAM approach,
and for fitting structural equations in observed-variable models by two-stage
least squares.")
    (license license:gpl2+)))

(define-public r-semtools
  (package
    (name "r-semtools")
    (version "0.5-7")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "semTools" version))
       (sha256
        (base32
         "1c76advnxh2vhnlr32ad590paixfk72vjsbnypyrnirzxq25xjrr"))))
    (properties `((upstream-name . "semTools")))
    (build-system r-build-system)
    (propagated-inputs
     (list r-lavaan r-pbivnorm))
    (home-page "https://github.com/simsem/semTools/wiki")
    (synopsis "Useful tools for structural equation modeling")
    (description
     "This package provides useful tools for structural equation modeling.")
    (license license:gpl2+)))

(define-public r-regsem
  (package
    (name "r-regsem")
    (version "1.9.5")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "regsem" version))
       (sha256
        (base32
         "0lvsy7byrhiizyhwnwr22v8g36735nb0liyzl1nzk0py9rjbv4kk"))))
    (properties `((upstream-name . "regsem")))
    (build-system r-build-system)
    (propagated-inputs
     (list r-lavaan r-rcpp r-rcpparmadillo r-rsolnp))
    (native-inputs
     (list r-knitr))
    (home-page "https://cran.r-project.org/package=regsem")
    (synopsis "Regularized structural equation modeling")
    (description
     "This package uses both ridge and lasso penalties (and extensions) to
penalize specific parameters in structural equation models.  The package
offers additional cost functions, cross validation, and other extensions
beyond traditional structural equation models.  It also contains a function to
perform @dfn{exploratory mediation} (XMed).")
    (license license:gpl2+)))

(define-public r-stanheaders
  (package
    (name "r-stanheaders")
    (version "2.32.10")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "StanHeaders" version))
       (sha256
        (base32
         "10l523sckx3jis5x1zw99iqy9hihjmngmcjq484bgin4gn6mn4n3"))))
    (properties `((upstream-name . "StanHeaders")))
    (build-system r-build-system)
    (inputs (list pandoc))
    (propagated-inputs
     (list r-rcppeigen r-rcppparallel))
    (native-inputs
     (list gfortran r-knitr)) ; for vignettes
    (home-page "https://mc-stan.org/")
    (synopsis "C++ header files for Stan")
    (description
     "The C++ header files of the Stan project are provided by this package.
There is a shared object containing part of the @code{CVODES} library, but it
is not accessible from R.  @code{r-stanheaders} is only useful for developers
who want to utilize the @code{LinkingTo} directive of their package's
DESCRIPTION file to build on the Stan library without incurring unnecessary
dependencies.

The Stan project develops a probabilistic programming language that implements
full or approximate Bayesian statistical inference via Markov Chain Monte
Carlo or variational methods and implements (optionally penalized) maximum
likelihood estimation via optimization.  The Stan library includes an advanced
automatic differentiation scheme, templated statistical and linear algebra
functions that can handle the automatically differentiable scalar types (and
doubles, ints, etc.), and a parser for the Stan language.  The @code{r-rstan}
package provides user-facing R functions to parse, compile, test, estimate,
and analyze Stan models.")
    (license license:bsd-3)))

(define-public r-rpf
  (package
    (name "r-rpf")
    (version "1.0.15")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "rpf" version))
       (sha256
        (base32
         "1pmwzdz1lhms80ycvmq907kzc9aabm56j6zfkvlxy980zsmjxhaz"))))
    (properties `((upstream-name . "rpf")))
    (build-system r-build-system)
    (propagated-inputs
     (list r-lifecycle r-mvtnorm r-rcpp r-rcppeigen))
    (native-inputs
     (list r-ggplot2
           r-knitr
           r-mirt
           r-numderiv
           r-reshape2
           r-testthat))
    (home-page "https://github.com/jpritikin/rpf")
    (synopsis "Response probability functions")
    (description
     "The purpose of this package is to factor out logic and math common to
Item Factor Analysis fitting, diagnostics, and analysis.  It is envisioned as
core support code suitable for more specialized IRT packages to build upon.
Complete access to optimized C functions is made available with
@code{R_RegisterCCallable()}.")
    (license license:gpl3+)))

(define-public r-openmx
  (package
    (name "r-openmx")
    (version "2.22.7")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "OpenMx" version))
       (sha256
        (base32
         "0hwc1zyfblfa249alwipnnjw2bqasa3a2vyq5l2bvvf12a5jdmrn"))))
    (properties
     '((upstream-name . "OpenMx")
       (updater-extra-native-inputs . ("r-numderiv"))))
    (build-system r-build-system)
    (propagated-inputs
     (list r-bh
           r-digest
           r-lifecycle
           r-mass
           r-matrix
           r-rcpp
           r-rcppeigen
           r-rcppparallel
           r-rpf
           r-stanheaders))
    (native-inputs (list gfortran r-knitr r-mvtnorm r-numderiv r-testthat))
    (home-page "http://openmx.ssri.psu.edu")
    (synopsis "Extended structural equation modelling")
    (description
     "This package allows for the estimation of a wide variety of advanced
multivariate statistical models.  It consists of a library of functions and
optimizers that allow you to quickly and flexibly define an SEM model and
estimate parameters given observed data.")
    (license license:asl2.0)))

(define-public r-kutils
  (package
    (name "r-kutils")
    (version "1.73")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "kutils" version))
       (sha256
        (base32
         "0xqg1s48afpn2w0mlqfwz3sj1gdjf05cpxq4z9r01k1476lvh6c9"))))
    (properties `((upstream-name . "kutils")))
    (build-system r-build-system)
    (propagated-inputs
     (list r-foreign r-openxlsx r-plyr r-runit r-xtable))
    (native-inputs (list r-runit))
    (home-page "https://cran.r-project.org/package=kutils")
    (synopsis "Project management tools")
    (description
     "This package provides tools for data importation, recoding, and
inspection.  There are functions to create new project folders, R code
templates, create uniquely named output directories, and to quickly obtain a
visual summary for each variable in a data frame.  The main feature here is
the systematic implementation of the \"variable key\" framework for data
importation and recoding.")
    (license license:gpl2)))

(define-public r-rockchalk
  (package
    (name "r-rockchalk")
    (version "1.8.157")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "rockchalk" version))
       (sha256
        (base32
         "13g2rdnxazqfgy653d7vj6w79b2vgnd7bbz0sqn9k4qiig59jh41"))))
    (properties `((upstream-name . "rockchalk")))
    (build-system r-build-system)
    (propagated-inputs
     (list r-cardata r-kutils r-lme4 r-mass))
    (home-page "https://cran.r-project.org/package=rockchalk")
    (synopsis "Regression estimation and presentation")
    (description
     "This package provides a collection of functions for interpretation and
presentation of regression analysis.  These functions are used to produce the
statistics lectures in @url{http://pj.freefaculty.org/guides}.  The package
includes regression diagnostics, regression tables, and plots of interactions
and \"moderator\" variables.  The emphasis is on \"mean-centered\" and
\"residual-centered\" predictors.  The vignette @code{rockchalk} offers a
fairly comprehensive overview.")
    (license license:gpl3+)))

(define-public r-lisreltor
  (package
    (name "r-lisreltor")
    (version "0.3")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "lisrelToR" version))
       (sha256
        (base32
         "19xl85dkvjpdsmi6y8789zlyccwjf265alsd7985vbkqdzfvpgkb"))))
    (properties `((upstream-name . "lisrelToR")))
    (build-system r-build-system)
    (home-page "https://cran.r-project.org/package=lisrelToR")
    (synopsis "Import output from LISREL into R")
    (description
     "This is an unofficial package aimed at automating the import of LISREL
output in R.")
    (license license:gpl2)))

(define-public r-bdgraph
  (package
    (name "r-bdgraph")
    (version "2.73")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "BDgraph" version))
       (sha256
        (base32
         "0bf1y35rc96l09pb4fyb693wkl20pyvmqav1rw2h3h8pyyvqkalh"))))
    (properties `((upstream-name . "BDgraph")))
    (build-system r-build-system)
    (propagated-inputs
     (list r-ggplot2 r-igraph r-proc))
    (native-inputs
     (list r-knitr))
    (home-page "https://www.uva.nl/profile/a.mohammadi")
    (synopsis "Bayesian structure learning in graphical models")
    (description
     "This package provides statistical tools for Bayesian structure learning
in undirected graphical models for continuous, discrete, and mixed data.  It
uses a trans-dimensional @dfn{Markov Chain Monte Carlo} (MCMC) approach based
on a continuous-time birth-death process.")
    (license license:gpl2+)))

(define-public r-bundesligr
  (package
    (name "r-bundesligr")
    (version "0.1.0")
    (source (origin
              (method url-fetch)
              (uri (cran-uri "bundesligR" version))
              (sha256
               (base32
                "0dnhbh9jh7dfbk7mfh8msq4ys5kakalr0kwkycycrb2q8rd049vp"))))
    (properties `((upstream-name . "bundesligR")))
    (build-system r-build-system)
    (home-page "https://github.com/ottlngr/bundesligR")
    (synopsis "All final tables of the Bundesliga")
    (description
     "This package provides all final tables of Germany's highest football
league, the Bundesliga.  It contains data from 1964 to 2016.")
    (license license:gpl3)))

(define-public r-butcher
  (package
    (name "r-butcher")
    (version "0.3.5")
    (source (origin
              (method url-fetch)
              (uri (cran-uri "butcher" version))
              (sha256
               (base32
                "1pdl2ckrj3l6ya8dgyz9832xvzbsvakas74v7am96zmmnvmnl2pf"))))
    (properties `((upstream-name . "butcher")))
    (build-system r-build-system)
    (propagated-inputs (list r-cli
                             r-lobstr
                             r-purrr
                             r-rlang
                             r-tibble
                             r-vctrs))
    ;; The importer adds lots of inputs that we don't actually need.
    (native-inputs (list r-knitr r-testthat))
    (home-page "https://butcher.tidymodels.org/")
    (synopsis "Model butcher")
    (description
     "This package provides a set of S3 generics to axe components of fitted
model objects and help reduce the size of model objects saved to disk.")
    (license license:expat)))

(define-public r-d3network
  (package
    (name "r-d3network")
    (version "0.5.2.1")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "d3Network" version))
       (sha256
        (base32
         "1gh979z9wksyxxxdzlfzibn0ysvf6h1ij7vwpd55fvbwr308syaw"))))
    (properties `((upstream-name . "d3Network")))
    (build-system r-build-system)
    (propagated-inputs
     (list r-plyr r-rjson r-whisker))
    (home-page "https://christophergandrud.github.io/d3Network/")
    (synopsis "Create D3 JavaScript network, tree, dendrogram, and Sankey graphs")
    (description
     "This package is intended to make it easy to create D3 JavaScript
network, tree, dendrogram, and Sankey graphs from R using data frames.")
    (license license:gpl3+)))

(define-public r-qgraph
  (package
    (name "r-qgraph")
    (version "1.9.8")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "qgraph" version))
       (sha256
        (base32
         "1m019j5nxc0184p0r2zgdn457g555nxsp2s08maa053nydj1va0l"))))
    (properties `((upstream-name . "qgraph")))
    (build-system r-build-system)
    (propagated-inputs
     (list r-abind
           r-colorspace
           r-corpcor
           r-fdrtool
           r-ggplot2
           r-glasso
           r-gtools
           r-hmisc
           r-igraph
           r-jpeg
           r-lavaan
           r-matrix
           r-pbapply
           r-plyr
           r-png
           r-psych
           r-rcpp
           r-reshape2))
    (home-page "http://sachaepskamp.com/qgraph/")
    (synopsis "Weighted network visualization and analysis")
    (description
     "This package implements tools for weighted network visualization and
analysis, as well as Gaussian graphical model computation.  It contains graph
plotting methods, and tools for psychometric data visualization and graphical
model estimation.  See Epskamp et al. (2012)
@url{doi:10.18637/jss.v048.i04}.")
    (license license:gpl2)))

(define-public r-semplot
  (package
    (name "r-semplot")
    (version "1.1.6")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "semPlot" version))
       (sha256
        (base32
         "0s9bp4pfsllg1k4x8a36yw82fw432dyz0xvmvi8dw9l12q3jkx8i"))))
    (properties `((upstream-name . "semPlot")))
    (build-system r-build-system)
    (propagated-inputs
     (list r-colorspace
           r-corpcor
           r-igraph
           r-lavaan
           r-lisreltor
           r-openmx
           r-plyr
           r-qgraph
           r-rockchalk
           r-sem
           r-xml))
    (home-page "https://github.com/SachaEpskamp/semPlot")
    (synopsis "Unified visualizations of structural equation models")
    (description
     "Structural equation modeling (SEM) has a long history of representing
models graphically as path diagrams.  The semPlot package for R fills the gap
between advanced, but time-consuming, graphical software and the limited
graphics produced automatically by SEM software.  In addition, semPlot offers
more functionality than drawing path diagrams: it can act as a common ground
for importing SEM results into R.  Any result usable as input to semPlot can
also be represented in any of the three popular SEM frame-works, as well as
translated to input syntax for the R packages @code{sem} and @code{lavaan}.")
    (license license:gpl2)))

(define-public r-cdm
  (package
    (name "r-cdm")
    (version "8.2-6")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "CDM" version))
       (sha256
        (base32
         "1lcq3i5rlyqkc12c26kj0x4fm2gh1jsisp6kbf59y3hjdkiqajhl"))))
    (properties `((upstream-name . "CDM")))
    (build-system r-build-system)
    (propagated-inputs
     (list r-mvtnorm r-polycor r-rcpp r-rcpparmadillo))
    (home-page
     "https://github.com/alexanderrobitzsch/CDM")
    (synopsis "Cognitive diagnosis modeling")
    (description
     "This package provides functions for cognitive diagnosis modeling and
multidimensional item response modeling for dichotomous and polytomous item
responses.  It enables the estimation of the DINA and DINO model, the multiple
group (polytomous) GDINA model, the multiple choice DINA model, the general
diagnostic model (GDM), the structured latent class model (SLCA), and
regularized latent class analysis.  See George, Robitzsch, Kiefer, Gross, and
Uenlue (2017) @url{doi:10.18637/jss.v074.i02} for further details on
estimation and the package structure.  For tutorials on how to use the CDM
package see George and Robitzsch (2015, @url{doi:10.20982/tqmp.11.3.p189}) as
well as Ravand and Robitzsch (2015).")
    (license license:gpl2+)))

(define-public r-tam
  (package
    (name "r-tam")
    (version "4.2-21")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "TAM" version))
       (sha256
        (base32
         "0s6mygm3sypjd393f7hsxslqwqp2s1hihb5iv8z8dhc95vj845qd"))))
    (properties `((upstream-name . "TAM")))
    (build-system r-build-system)
    (propagated-inputs
     (list r-cdm r-rcpp r-rcpparmadillo))
    (home-page "https://www.edmeasurementsurveys.com/TAM/Tutorials/")
    (synopsis "Test analysis modules")
    (description
     "This package includes tools for marginal maximum likelihood estimation
and joint maximum likelihood estimation for unidimensional and
multidimensional item response models.  The package functionality covers the
Rasch model, 2PL model, 3PL model, generalized partial credit model,
multi-faceted Rasch model, nominal item response model, structured latent
class model, mixture distribution IRT models, and located latent class models.
Latent regression models and plausible value imputation are also supported.")
    (license license:gpl2+)))

(define-public r-erm
  (package
    (name "r-erm")
    (version "1.0-10")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "eRm" version))
       (sha256
        (base32
         "0lnnvvrpk7gwpgzqz0yl9kwklhwm4hkzkp45mzr8x4gh5xffsig7"))))
    (properties `((upstream-name . "eRm")))
    (build-system r-build-system)
    (propagated-inputs
     (list r-colorspace r-lattice r-mass r-matrix r-psych))
    (native-inputs (list gfortran))
    (home-page "https://cran.r-project.org/package=eRm")
    (synopsis "Extended Rasch modeling")
    (description
     "This package provides tools to fit @dfn{Rasch models} (RM), @dfn{linear
logistic test models} (LLTM), @dfn{rating scale model} (RSM), @dfn{linear
rating scale models} (LRSM), @dfn{partial credit models} (PCM), and
@dfn{linear partial credit models} (LPCM).  Missing values are allowed in the
data matrix.  Additional features are the ML estimation of the person
parameters, Andersen's LR-test, item-specific Wald test, Martin-Loef-Test,
nonparametric Monte-Carlo Tests, itemfit and personfit statistics including
infit and outfit measures, ICC and other plots, automated stepwise item
elimination, and a simulation module for various binary data matrices.")
    (license license:gpl3)))

(define-public r-irtoys
  (package
    (name "r-irtoys")
    (version "0.2.2")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "irtoys" version))
       (sha256
        (base32
         "1qshz6czykgf53mq6xiswzv5xsjwrkrinpfkf1yavql4v08hs82b"))))
    (properties `((upstream-name . "irtoys")))
    (build-system r-build-system)
    (propagated-inputs
     (list r-ltm r-sm))
    (native-inputs
     (list r-knitr))
    (home-page "https://cran.r-project.org/package=irtoys")
    (synopsis "Collection of functions related to Item Response Theory (IRT)")
    (description
     "This package provides a collection of functions useful in learning and
practicing @dfn{Item Response Theory} (IRT), which can be combined into larger
programs.  It provides basic CTT analysis, a simple common interface to the
estimation of item parameters in IRT models for binary responses with three
different programs (ICL, BILOG-MG, and ltm), ability estimation (MLE, BME,
EAP, WLE, plausible values), item and person fit statistics, scaling
methods (MM, MS, Stocking-Lord, and the complete Hebaera method), and a rich
array of parametric and non-parametric (kernel) plots.  It estimates and plots
Haberman's interaction model when all items are dichotomously scored.")
    (license license:gpl2+)))

(define-public r-iheatmapr
  (package
    (name "r-iheatmapr")
    (version "0.7.1")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "iheatmapr" version))
       (sha256
        (base32
         "1c4dvp0mvw3m6x0kdw05yja2rm1mkrjjmjfj67f0vvs5sqyaqwhv"))
       (snippet
        '(delete-file
          "inst/htmlwidgets/lib/plotlyjs/plotly-latest.min.js"))))
    (properties `((upstream-name . "iheatmapr")))
    (build-system r-build-system)
    (arguments
     (list
      #:phases
      '(modify-phases %standard-phases
         (add-after 'unpack 'process-javascript
           (lambda* (#:key inputs #:allow-other-keys)
             (with-directory-excursion "inst/htmlwidgets/lib/plotlyjs/"
               (invoke "esbuild" (assoc-ref inputs "js-plotly")
                       "--minify"
                       "--outfile=plotly-latest.min.js")))))))
    (propagated-inputs
     (list r-fastcluster
           r-ggdendro
           r-htmlwidgets
           r-jsonlite
           r-knitr
           r-magrittr
           r-rcolorbrewer
           r-scales))
    (native-inputs
     `(("esbuild" ,esbuild)
       ("r-knitr" ,r-knitr)
       ("r-testthat" ,r-testthat)
       ("js-plotly"
        ,(let ((version "2.10.1"))
           (origin
             (method url-fetch)
             (uri (string-append "https://raw.githubusercontent.com/plotly/plotly.js/v"
                                 version "/dist/plotly.js"))
             (sha256
              (base32
               "1cg2q681yjsrpjmm4nkfia7752wxnszi3c94nq9a91zpnfkm22yb")))))))
    (home-page "https://docs.ropensci.org/iheatmapr")
    (synopsis "Interactive, Complex Heatmaps")
    (description
     "iheatmapr is an R package for building complex, interactive heatmaps
using modular building blocks.  \"Complex\" heatmaps are heatmaps in which
subplots along the rows or columns of the main heatmap add more information
about each row or column.  For example, a one column additional heatmap may
indicate what group a particular row or column belongs to.  Complex heatmaps
may also include multiple side by side heatmaps which show different types of
data for the same conditions.  Interactivity can improve complex heatmaps by
providing tooltips with information about each cell and enabling zooming into
interesting features. iheatmapr uses the plotly library for interactivity.")
    (license license:expat)))

(define-public r-productplots
  (package
    (name "r-productplots")
    (version "0.1.1")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "productplots" version))
       (sha256
        (base32 "1igs6d0qwgsfk0z3vxabgv5kva9w2kpzi535gjfdrbx34j4pf3gx"))))
    (properties `((upstream-name . "productplots")))
    (build-system r-build-system)
    (propagated-inputs (list r-ggplot2 r-plyr))
    (native-inputs (list r-reshape2 r-testthat))
    (home-page "https://github.com/hadley/productplots")
    (synopsis "Product plots for R")
    (description
     "Framework for visualising tables of counts, proportions and
probabilities.  The framework is called product plots, alluding to the
computation of area as a product of height and width, and the statistical
concept of generating a joint distribution from the product of conditional and
marginal distributions.  The framework, with extensions, is sufficient to
encompass over 20 visualisations previously described in fields of statistical
graphics and infovis, including bar charts, mosaic plots, treemaps, equal area
plots and fluctuation diagrams.")
    (license license:gpl2)))

(define-public r-packrat
  (package
    (name "r-packrat")
    (version "0.9.2")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "packrat" version))
       (sha256
        (base32
         "1mvj2s78n2r66nlqq5bjrvgdwlwbcqdj81yryc34sv3y4m1mkpv9"))))
    (properties
     '((upstream-name . "packrat")
       (updater-extra-native-inputs . ("r-mockery"))))
    (build-system r-build-system)
    (arguments
     (list
      #:phases
      '(modify-phases %standard-phases
         (add-after 'unpack 'disable-bad-tests
           ;; Requires Internet access.
           (lambda _ (delete-file "tests/testthat/test-downloader.R"))))))
    (native-inputs (list r-mockery r-testthat))
    (home-page "https://github.com/rstudio/packrat/")
    (synopsis "Dependency management R projects")
    (description
     "This package provides a dependency manager for R projects that allows
you to manage the R packages your project depends on in an isolated, portable,
and reproducible way.")
    (license license:gpl2)))

(define-public r-rsconnect
  (package
    (name "r-rsconnect")
    (version "1.4.1")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "rsconnect" version))
       (sha256
        (base32
         "0h5f1a4kazzw5mn5a3k9x0gmbvbf1pcx0nny034v8jn65p3agvhq"))))
    (properties
     '((upstream-name . "rsconnect")
       (updater-extra-native-inputs . ("tzdata-for-tests"))
       (updater-ignored-native-inputs . ("r-bioc" "r-pak"))))
    (build-system r-build-system)
    (propagated-inputs
     (list r-cli
           r-curl
           r-digest
           r-jose
           r-jsonlite
           r-lifecycle
           r-openssl
           r-packrat
           r-pki
           r-rcpptoml
           r-renv
           r-rlang
           r-rstudioapi
           r-yaml))
    (native-inputs
     (list r-biocmanager
           r-devtools
           r-knitr
           r-mass
           r-reticulate
           r-rmarkdown
           r-shiny
           r-testthat
           r-usethis
           r-webfakes
           r-withr
           tzdata-for-tests))
    (home-page "https://github.com/rstudio/rsconnect")
    (synopsis "Deployment interface for R Markdown documents and Shiny applications")
    (description
     "This package provides a programmatic deployment interface for RPubs,
shinyapps.io, and RStudio Connect.  Supported content types include R Markdown
documents, Shiny applications, Plumber APIs, plots, and static web content.")
    (license license:gpl2)))

;; This package includes minified JavaScript files.  When upgrading please
;; check that there are no new minified JavaScript files.
(define-public r-dygraphs
  (package
    (name "r-dygraphs")
    (version "1.1.1.6")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "dygraphs" version))
       (sha256
        (base32
         "022j007mzfa9k2n31yg4aizcsf571vv3jip092h23rqj03rk3ly3"))))
    (properties `((upstream-name . "dygraphs")))
    (build-system r-build-system)
    (arguments
     (list
      #:modules '((guix build r-build-system)
                  (guix build minify-build-system)
                  (guix build utils)
                  (ice-9 match))
      #:imported-modules `(,@%r-build-system-modules
                           (guix build minify-build-system))
      #:phases
      #~(modify-phases (@ (guix build r-build-system) %standard-phases)
          (add-after 'unpack 'process-javascript
            (lambda* (#:key inputs #:allow-other-keys)
              (with-directory-excursion "inst/htmlwidgets/lib"
                (for-each (match-lambda
                            ((source . target)
                             (minify source #:target target)))
                          `(("dygraphs/dygraph-combined-dev.js"
                             . "dygraph-combined.js")
                            (,(assoc-ref inputs "js-jquery")
                             . "jquery/jquery.min.js")
                            (,(assoc-ref inputs "js-fquarter")
                             . "fquarter/moment-fquarter.min.js")))))))))
    (native-inputs
     `(("esbuild" ,esbuild)
       ;; They actually use version 1.11.1, but this more recent version
       ;; should be just fine.
       ("js-jquery"
        ,(origin
           (method url-fetch)
           (uri "https://code.jquery.com/jquery-1.12.4.js")
           (sha256
            (base32
             "0x9mrc1668icvhpwzvgafm8xm11x9lfai9nwr66aw6pjnpwkc3s3"))))
       ("js-fquarter"
        ,(origin
           (method url-fetch)
           (uri (string-append "https://raw.githubusercontent.com/robgallen/"
                               "moment-fquarter/1.0.1/moment-fquarter.js"))
           (sha256
            (base32
             "01mdnsaibm9jy2f1qpbn692hpv309lhj5si9nagib4dawmrkffij"))))
       ("r-testthat" ,r-testthat)))
    (propagated-inputs
     (list r-htmltools r-htmlwidgets r-magrittr r-xts r-zoo))
    (home-page "https://github.com/rstudio/dygraphs")
    (synopsis "Interface to Dygraphs interactive time series charting library")
    (description
     "This package provides an R interface to the dygraphs JavaScript charting
library (a copy of which is included in the package).  It provides rich
facilities for charting time-series data in R, including highly configurable
series- and axis-display and interactive features like zoom/pan and
series/point highlighting.")
    (license license:expat)))

(define-public r-shinystan
  (package
    (name "r-shinystan")
    (version "2.6.0")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "shinystan" version))
       (sha256
        (base32
         "0afm703zriyqprz1zvypir80lq2ylfff3qvj5i7p9n365mm8b150"))))
    (properties `((upstream-name . "shinystan")))
    (build-system r-build-system)
    (arguments
     (list
      #:phases
      '(modify-phases %standard-phases
         (add-after 'unpack 'delete-bad-tests
           (lambda _
             ;; One test requires r-rstanarm, which depends on this very
             ;; package.
             (delete-file "tests/testthat/test_misc.R"))))))
    (propagated-inputs
     (list r-bayesplot
           r-colourpicker
           r-dt
           r-dygraphs
           r-ggplot2
           r-gridextra
           r-gtools
           r-markdown
           r-reshape2
           r-rstan
           r-shiny
           r-shinyjs
           r-shinythemes
           r-threejs
           r-xtable
           r-xts))
    (native-inputs (list r-coda r-testthat))
    (home-page "https://mc-stan.org/")
    (synopsis "Interactive visual and numerical analysis for Bayesian models")
    (description
     "This package provides a graphical user interface for interactive
@dfn{Markov chain Monte Carlo} (MCMC) diagnostics and plots and tables helpful
for analyzing a posterior sample.  The interface is powered by the Shiny web
application framework and works with the output of MCMC programs written in
any programming language (and has extended functionality for Stan models fit
using the @code{rstan} and @code{rstanarm} packages).")
    (license license:gpl3+)))

(define-public r-rstantools
  (package
    (name "r-rstantools")
    (version "2.4.0")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "rstantools" version))
       (sha256
        (base32
         "1ajg7g425cmw9h9a8225szmacwyvdwl3x0k851fnqb1my2i2rxxz"))))
    (properties `((upstream-name . "rstantools")))
    (build-system r-build-system)
    (inputs (list pandoc))
    (propagated-inputs
     (list r-desc r-rcpp r-rcppparallel))
    (native-inputs
     (list r-knitr r-rstan r-testthat r-usethis))
    (home-page "https://mc-stan.org/rstantools/")
    (synopsis "Tools for developing R packages interfacing with Stan")
    (description
     "This package provides various tools for developers of R packages
interfacing with @url{https://mc-stan.org, Stan}, including functions to set
up the required package structure, S3 generics and default methods to unify
function naming across Stan-based R packages, and vignettes with
recommendations for developers.")
    (license license:gpl3+)))

(define-public r-loo
  (package
    (name "r-loo")
    (version "2.8.0")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "loo" version))
       (sha256
        (base32 "0k14cf4mmviwslq931n5l1glalmsdsm7v3hq0m80w71fbaljgdxa"))))
    (properties `((upstream-name . "loo")))
    (build-system r-build-system)
    (inputs
     (list pandoc))
    (propagated-inputs
     (list r-checkmate r-matrixstats r-posterior))
    (native-inputs
     (list r-knitr r-testthat))
    (home-page "https://mc-stan.org/loo/")
    (synopsis "Leave-One-Out cross-validation and WAIC for Bayesian models")
    (description
     "This package provides an implementation of efficient approximate
@dfn{leave-one-out} (LOO) cross-validation for Bayesian models fit using
Markov chain Monte Carlo, as described in @url{doi:10.1007/s11222-016-9696-4}.
The approximation uses @dfn{Pareto smoothed importance sampling} (PSIS), a new
procedure for regularizing importance weights.  As a byproduct of the
calculations, we also obtain approximate standard errors for estimated
predictive errors and for the comparison of predictive errors between models.
The package also provides methods for using stacking and other model weighting
techniques to average Bayesian predictive distributions.")
    (license license:gpl3+)))

(define-public r-rstan
  (package
    (name "r-rstan")
    (version "2.32.7")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "rstan" version))
       (sha256
        (base32
         "0jhpf9dsbizhizsrgb1wamanzy088nxljg105jb2yrq1zdvwycar"))))
    (properties
     '((upstream-name . "rstan")
       (updater-extra-native-inputs . ("tzdata-for-tests"))
       (updater-ignored-native-inputs . ("r-io"))))
    (build-system r-build-system)
    (arguments
     `(#:phases
       (modify-phases %standard-phases
         (add-before 'install 'set-timezone
           ;; This package is picky about timezones.
           (lambda* (#:key inputs #:allow-other-keys)
             (setenv "TZ" "UTC+1")
             (setenv "TZDIR"
                     (search-input-directory inputs
                                             "share/zoneinfo")))))))
    (native-inputs
     (list r-knitr
           r-matrix
           r-testthat
           tzdata-for-tests))
    (propagated-inputs
     (list r-bh
           r-ggplot2
           r-gridextra
           r-inline
           r-loo
           r-pkgbuild
           r-quickjsr
           r-rcpp
           r-rcppeigen
           r-rcppparallel
           r-stanheaders))
    (inputs (list pandoc))
    (home-page "https://discourse.mc-stan.org/")
    (synopsis "R interface to Stan")
    (description
     "User-facing R functions are provided to parse, compile, test, estimate,
and analyze Stan models by accessing the header-only Stan library provided by
the StanHeaders package.  The Stan project develops a probabilistic
programming language that implements full Bayesian statistical inference via
Markov Chain Monte Carlo, rough Bayesian inference via 'variational'
approximation, and (optionally penalized) maximum likelihood estimation via
optimization.  In all three cases, automatic differentiation is used to
quickly and accurately evaluate gradients without burdening the user with the
need to derive the partial derivatives.")
    (license license:gpl3+)))

(define-public r-rstanarm
  (package
    (name "r-rstanarm")
    (version "2.32.1")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "rstanarm" version))
       (sha256
        (base32
         "1pj3s8yy8dwxfnxsd5rzd1hc7997bh5mg66zs83ljpbl0xi6qvaw"))))
    (properties `((upstream-name . "rstanarm")))
    (build-system r-build-system)
    (inputs
     (list pandoc))
    (propagated-inputs
     (list r-bayesplot
           r-bh
           r-ggplot2
           r-lme4
           r-loo
           r-matrix
           r-nlme
           r-posterior
           r-rcpp
           r-rcppeigen
           r-rcppparallel
           r-rstan
           r-rstantools
           r-shinystan
           r-stanheaders
           r-survival))
    (native-inputs
     (list r-knitr r-testthat))
    (home-page "https://mc-stan.org/rstanarm/")
    (synopsis "Bayesian applied regression modeling via Stan")
    (description
     "This package estimates previously compiled regression models using the
@code{rstan} package, which provides the R interface to the Stan C++ library
for Bayesian estimation.  Users specify models via the customary R syntax with
a formula and @code{data.frame} plus some additional arguments for priors.")
    (license license:gpl3+)))

(define-public r-kendall
  (package
    (name "r-kendall")
    (version "2.2.1")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "Kendall" version))
       (sha256
        (base32
         "1xmk95l4i3kj9jn0xh1chi2rj322k29jq14ra5pa7316gwf9vx2m"))))
    (properties `((upstream-name . "Kendall")))
    (build-system r-build-system)
    (propagated-inputs
     (list r-boot))
    (native-inputs
     (list gfortran))
    (home-page "https://cran.r-project.org/web/packages/Kendall/")
    (synopsis "Kendall rank correlation and Mann-Kendall trend test")
    (description
     "This package computes the Kendall rank correlation and Mann-Kendall
trend test.")
    (license license:gpl2+)))

(define-public r-keyring
  (package
    (name "r-keyring")
    (version "1.4.0")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "keyring" version))
       (sha256
        (base32
         "1s1msy82f76wkbchhrfxr072dzg93qnmcg017ymhdksmrjw7zxwk"))))
    (properties
     '((upstream-name . "keyring")
       (updater-extra-native-inputs . ("r-mockery"))))
    (build-system r-build-system)
    (propagated-inputs
     (list r-askpass r-filelock r-r6 r-yaml))
    (native-inputs (list pkg-config
                         r-callr
                         r-mockery
                         r-openssl
                         r-testthat
                         r-withr))
    (home-page "https://github.com/r-lib/keyring")
    (synopsis "Access the system credential store from R")
    (description
     "This package provides a platform-independent API to access the operating
system's credential store.  It currently supports Keychain on macOS,
Credential Store on Windows, the Secret Service API on GNU/Linux, and a
simple, platform independent store implemented with environment variables.
Additional storage back-ends can be added easily.")
    (license license:expat)))

(define-public r-zyp
  (package
    (name "r-zyp")
    (version "0.11-1")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "zyp" version))
       (sha256
        (base32
         "0gqds43ivbsi4770nxj5sf4mp51m410svnap0v1rh8vlk3gkb3l9"))))
    (properties `((upstream-name . "zyp")))
    (build-system r-build-system)
    (propagated-inputs
     (list r-kendall))
    (home-page "https://cran.r-project.org/web/packages/zyp/")
    (synopsis "Zhang + Yue-Pilon Trends Package")
    (description
     "This package contains an efficient implementation of Sen's slope
method (Sen, 1968) plus implementation of Xuebin Zhang's (Zhang, 1999) and
Yue-Pilon's (Yue, 2002) pre-whitening approaches to determining trends in
climate data.")
    (license license:lgpl2.1)))

(define-public r-rlecuyer
  (package
    (name "r-rlecuyer")
    (version "0.3-8")
    (source (origin
              (method url-fetch)
              (uri (cran-uri "rlecuyer" version))
              (sha256
               (base32
                "1jbm5h8zbsx1yw148piw9p0rj9a7cm0ywgidrzi5ylrp6dad7gk6"))))
    (properties `((upstream-name . "rlecuyer")))
    (build-system r-build-system)
    (home-page
     "https://www.iro.umontreal.ca/~lecuyer/myftp/papers/streams00.pdf")
    (synopsis "R interface to RNG with multiple streams")
    (description
     "This package provides an interface to the C implementation of the random
number generator with multiple independent streams developed by L'Ecuyer et
al (2002).  The main purpose of this package is to enable the use of this
random number generator in parallel R applications.")
    (license license:gpl2+)))

(define-public r-rlinsolve
  (package
    (name "r-rlinsolve")
    (version "0.3.2")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "Rlinsolve" version))
       (sha256
        (base32
         "1xv500n1480qyakw0isanw1s5ywykhc207hqja4804s5s2m8zfjw"))))
    (properties `((upstream-name . "Rlinsolve")))
    (build-system r-build-system)
    (propagated-inputs
     (list r-matrix r-rcpp r-rcpparmadillo r-rdpack))
    (home-page "https://cran.r-project.org/web/packages/Rlinsolve/")
    (synopsis "Iterative solvers for (sparse) linear system of equations")
    (description
     "Solving a system of linear equations is one of the most fundamental
computational problems for many fields of mathematical studies, such as
regression problems from statistics or numerical partial differential
equations.  This package provides basic stationary iterative solvers such as
Jacobi, Gauss-Seidel, Successive Over-Relaxation and SSOR methods.
Nonstationary, also known as Krylov subspace methods are also provided.
Sparse matrix computation is also supported in that solving large and sparse
linear systems can be manageable using the @code{Matrix} package along with
@code{RcppArmadillo}.")
    (license license:gpl3+)))

(define-public r-zvcv
  (package
    (name "r-zvcv")
    (version "2.1.2")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "ZVCV" version))
       (sha256
        (base32
         "0ws0v7i6r7skb8lv6j718k29v5qsy1b007jxidv81iv0jcz9zfpy"))))
    (properties `((upstream-name . "ZVCV")))
    (build-system r-build-system)
    (propagated-inputs
     (list r-abind
           r-bh
           r-dplyr
           r-glmnet
           r-magrittr
           r-mvtnorm
           r-rcpp
           r-rcpparmadillo
           r-rlinsolve))
    (home-page "https://cran.r-project.org/web/packages/ZVCV/")
    (synopsis "Zero-Variance Control Variates")
    (description
     "@dfn{Zero-variance control variates} (ZV-CV) is a post-processing method
to reduce the variance of Monte Carlo estimators of expectations using the
derivatives of the log target.  Once the derivatives are available, the only
additional computational effort is in solving a linear regression problem.
This method has been extended to higher dimensions using regularisation.  This
package can be used to easily perform ZV-CV or regularised ZV-CV when a set of
samples, derivatives and function evaluations are available.  Additional
functions for applying ZV-CV to two estimators for the normalising constant of
the posterior distribution in Bayesian statistics are also supplied.")
    (license license:gpl2+)))

(define-public r-ztype
  (package
    (name "r-ztype")
    (version "0.1.0")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "ztype" version))
       (sha256
        (base32
         "0brbq2rgkl4mhjbb70kkfv47lzs66k9ppfs2klavcbripirxn5fx"))))
    (properties `((upstream-name . "ztype")))
    (build-system r-build-system)
    (propagated-inputs
     (list r-assertthat
           r-dplyr
           r-ggplot2
           r-lubridate
           r-magrittr
           r-rvest
           r-stringr))
    (home-page "https://cran.r-project.org/web/packages/ztype/")
    (synopsis "Run a Ztype game loaded with R functions")
    (description
     "How fast can you type R functions on your keyboard?  Find out by running
a @code{zty.pe} game: export R functions as instructions to type to destroy
opponents' vessels.")
    (license license:gpl3)))

(define-public r-zseq
  (package
    (name "r-zseq")
    (version "0.2.1")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "Zseq" version))
       (sha256
        (base32
         "0xp7qi5kjg8xmci9wrfvmygjmz8gbhq60fl9bvk8rnka6s4ppkrc"))))
    (properties `((upstream-name . "Zseq")))
    (build-system r-build-system)
    (propagated-inputs
     (list r-gmp))
    (home-page "https://cran.r-project.org/web/packages/Zseq/")
    (synopsis "Integer sequence generator")
    (description
     "This package generates well-known integer sequences.  The @code{gmp}
package is adopted for computing with arbitrarily large numbers.  Every
function has a hyperlink to its corresponding item in the @dfn{On-Line
Encyclopedia of Integer Sequences} (OEIS) in the function help page.")
    (license license:gpl3+)))

(define-public r-isoband
  (package
    (name "r-isoband")
    (version "0.2.7")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "isoband" version))
       (sha256
        (base32
         "0qfzkkvh4a97qlifhdqjgdnzmnph93qqyqsv5gg8cnxl8crj54vn"))))
    (properties `((upstream-name . "isoband")))
    (build-system r-build-system)
    (native-inputs
     (list r-knitr r-testthat))
    (home-page "https://github.com/wilkelab/isoband")
    (synopsis "Generate isolines and isobands from regularly spaced elevation grids")
    (description
     "This package provides a fast C++ implementation to generate contour
lines (isolines) and contour polygons (isobands) from regularly spaced grids
containing elevation data.")
    (license license:expat)))

(define-public r-ppcor
  (package
    (name "r-ppcor")
    (version "1.1")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "ppcor" version))
       (sha256
        (base32
         "1x9b2kb8s0bp92b17gby0jwzzr3i4cf3ap9c4nq7m8fav72g0y3a"))))
    (properties `((upstream-name . "ppcor")))
    (build-system r-build-system)
    (propagated-inputs
     (list r-mass))
    (home-page "https://cran.r-project.org/web/packages/ppcor/")
    (synopsis "Partial and semi-partial correlation")
    (description
     "This package provides users not only with a function to readily
calculate the higher-order partial and semi-partial correlations but also with
statistics and p-values of the correlation coefficients.")
    (license license:gpl2)))

(define-public r-hrbrthemes
  (package
    (name "r-hrbrthemes")
    (version "0.8.7")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "hrbrthemes" version))
       (sha256
        (base32 "0vwrwcx3yp5yi1fw45zb5b3rhhbhrmzkl935s5apvf9lwjz2wjas"))))
    (properties
     '((upstream-name . "hrbrthemes")
       (updater-extra-native-inputs . ("r-hunspell" "r-stringi"))))
    (build-system r-build-system)
    (propagated-inputs
     (list r-extrafont r-gdtools r-ggplot2 r-magrittr r-scales))
    (native-inputs (list r-hunspell r-stringi r-testthat))
    (home-page "https://github.com/hrbrmstr/hrbrthemes/")
    (synopsis "Additional themes, theme components and utilities for @code{ggplot2}")
    (description
     "This package provides a compilation of extra @code{ggplot2} themes,
scales and utilities, including a spell check function for plot label fields
and an overall emphasis on typography.")
    (license license:expat)))

(define-public r-crochet
  (package
    (name "r-crochet")
    (version "2.3.0")
    (source
     (origin
      (method url-fetch)
      (uri (cran-uri "crochet" version))
      (sha256
       (base32
        "0zvjaf6cv0nrjb4l4llkr0mmgha7ig31p4ri2rlnqyjlxi5l8hyq"))))
    (build-system r-build-system)
    (native-inputs
     (list r-knitr))
    (home-page "https://github.com/agrueneberg/crochet")
    (synopsis "Implementation Helper for Matrix-Like Types")
    (description
     "Functions to help implement the extraction / subsetting / indexing
function @code{[} and replacement function @code{[<-} of custom matrix-like
types (based on S3, S4, etc.), modeled as closely to the base matrix class
as possible (with tests to prove it).")
    (license license:expat)))

(define-public r-boa
  (package
    (name "r-boa")
    (version "1.1.8-2")
    (source
     (origin
      (method url-fetch)
      (uri (cran-uri "boa" version))
      (sha256
       (base32
        "04lhqk5qfvaz1jk90glr2yi5vq7cdy0w8m6g2lnzk359l9y41zhp"))))
    (properties `((upstream-name . "boa")))
    (build-system r-build-system)
    (home-page "https://www.jstatsoft.org/v21/i11")
    (synopsis "Library for @dfn{Bayesian Output Analysis Program} (BOA) for MCMC")
    (description
     "This package provides a menu-driven program and library of functions for
carrying out convergence diagnostics and statistical and graphical analysis of
@dfn{Markov chain Monte Carlo} (MCMC) sampling output.")
    (license license:gpl2+)))

(define-public r-httpcode
  (package
    (name "r-httpcode")
    (version "0.3.0")
    (source (origin
              (method url-fetch)
              (uri (cran-uri "httpcode" version))
              (sha256
               (base32
                "0xig0rvc81hg7mw0iq9s0an1nw24fg0kfs2p2n6dzhwl9w506fjr"))))
    (build-system r-build-system)
    (native-inputs (list r-testthat))
    (home-page "https://github.com/sckott/httpcode")
    (synopsis "HTTP status code helper")
    (description "@code{httpcode} provides functionality for finding and
explaining the meaning of @code{HTTP} status codes.  Functions are included for
searching for codes by full or partial number, by message, and to get
appropriate dog and cat images for many status codes.")
    (license license:expat)))

(define-public r-latex2exp
  (package
    (name "r-latex2exp")
    (version "0.9.6")
    (source (origin
              (method url-fetch)
              (uri (cran-uri "latex2exp" version))
              (sha256
               (base32
                "1jp0l0hi5kv4yh28qg2yj2z5fj33gnfvdz2g2v4ibn516fj2d636"))))
    (build-system r-build-system)
    (propagated-inputs
     (list r-magrittr r-stringr))
    (native-inputs
     (list r-knitr r-testthat))
    (home-page "https://github.com/stefano-meschiari/latex2exp/")
    (synopsis "Use LaTeX expressions in plots")
    (description "@code{latex2exp} parses and converts LaTeX math formulas to
R's plotmath expressions, used to enter mathematical formulas and symbols to be
rendered as text, axis labels, etc. throughout R's plotting system.")
    (license license:expat)))

(define-public r-oai
  (package
    (name "r-oai")
    (version "0.4.0")
    (source (origin
              (method url-fetch)
              (uri (cran-uri "oai" version))
              (sha256
               (base32
                "0czf8f2qcjl9lh48svicpis09d3iwz9cndfm7hq8wlz5dl3dwh7m"))))
    (build-system r-build-system)
    (propagated-inputs
     (list r-httr r-plyr r-stringr r-tibble r-xml2))
    (native-inputs
     (list r-knitr r-testthat))
    (home-page "https://github.com/ropensci/oai/")
    (synopsis "General purpose OAI-PMH services client")
    (description "@code{oai} provides a general purpose client to work with
any @dfn{Open Archives Initiative Protocol for 'Metadata' Harvesting} (OAI-PMH)
service.  Functions are provided to work with the OAI-PMH verbs:
@code{GetRecord}, @code{Identify}, @code{ListIdentifiers},
@code{ListMetadataFormats}, @code{ListRecords}, and @code{ListSets}.")
    (license license:expat)))

(define-public r-argon2
  (package
    (name "r-argon2")
    (version "0.4-0")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "argon2" version))
       (sha256
        (base32
         "09hzl0wz0lw2v7g64rdv0lij2hq36zl37a6rmxwvinmjdzijcsyw"))))
    (properties `((upstream-name . "argon2")))
    (build-system r-build-system)
    (home-page "https://github.com/wrathematics/argon2")
    (synopsis "Secure password hashing based on the argon2 algorithm")
    (description
     "This package provides utilities for secure password hashing via the
argon2 algorithm.")
    (license license:bsd-2)))

(define-public r-getpass
  (package
    (name "r-getpass")
    (version "0.2-4")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "getPass" version))
       (sha256
        (base32
         "0a0q9v29z49s1iprs5di01wlflxj74sbizwsrzjfc538nkwfpnqm"))))
    (properties `((upstream-name . "getPass")))
    (build-system r-build-system)
    (propagated-inputs
     (list r-rstudioapi))
    (home-page "https://github.com/wrathematics/getPass")
    (synopsis "Masked user input")
    (description
     "This package provides a micro-package for reading \"passwords\", i.e.
reading user input with masking, so that the input is not displayed as it is
typed.  Currently, RStudio, the command line (every OS), and any platform
where tcltk is present are supported.")
    (license license:bsd-2)))

(define-public r-remoter
  (package
    (name "r-remoter")
    (version "0.4-0")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "remoter" version))
       (sha256
        (base32
         "1a7m63l8phv5jnazvdqdrqkaqjwqzaac5y4jm2jn0ypy4n8jvkfl"))))
    (properties `((upstream-name . "remoter")))
    (build-system r-build-system)
    (propagated-inputs
     (list r-argon2 r-getpass r-pbdzmq r-png))
    (home-page "https://github.com/RBigData/remoter")
    (synopsis "Control a remote R session from a local one")
    (description
     "This package provides a set of utilities for client/server computing
with R, controlling a remote R session (the server) from a local one (the
client).")
    (license license:bsd-2)))

(define-public r-asd
  (package
    (name "r-asd")
    (version "2.2")
    (source
      (origin
        (method url-fetch)
        (uri (cran-uri "asd" version))
        (sha256
          (base32
            "0p3r4qjam3sl3rpcilb0pgx4xx3ly71xqnvkv31vzjs885lgxz4l"))))
    (properties `((upstream-name . "asd")))
    (build-system r-build-system)
    (propagated-inputs
     (list r-mvtnorm))
    (home-page "https://cran.r-project.org/web/packages/asd")
    (synopsis "Simulations for Adaptive Seamless Designs")
    (description
     "This package provides means to run simulations for adaptive seamless
designs with and without early outcomes for treatment selection and
subpopulation type designs.")
    (license license:gpl3)))

(define-public r-nbconvertr
  (package
    (name "r-nbconvertr")
    (version "1.3.2")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "nbconvertR" version))
       (sha256
        (base32
         "0yhmz177r1miain65vspclahhz8cg7638ldbpsw8ylgf7a60l0sg"))))
    (properties `((upstream-name . "nbconvertR")))
    (build-system r-build-system)
    (inputs
     (list python-nbconvert pandoc))
    (native-inputs (list r-testthat))
    (home-page "https://cran.r-project.org/web/packages/nbconvertR/")
    (synopsis "Vignette engine wrapping Jupyter notebooks")
    (description
     "This package calls the Jupyter script @code{nbconvert} to create
vignettes from notebooks.  Those notebooks (@code{.ipynb} files) are files
containing rich text, code, and its output.  Code cells can be edited and
evaluated interactively.")
    (license license:gpl3)))

(define-public r-bridgesampling
  (package
    (name "r-bridgesampling")
    (version "1.1-2")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "bridgesampling" version))
       (sha256
        (base32
         "0sry1xwiv4y52k44hq6z8y2kysp5kxgl4dix3m94svg3ladd7v2l"))))
    (properties
     `((upstream-name . "bridgesampling")))
    (build-system r-build-system)
    (arguments
     (list
      #:phases
      '(modify-phases %standard-phases
         ;; When there is no HOME directory, this package will fail to find
         ;; the vignette builder.
         (add-after 'unpack 'set-HOME
           (lambda _ (setenv "HOME" "/tmp"))))))
    (propagated-inputs
     (list r-brobdingnag
           r-coda
           r-matrix
           r-mvtnorm
           r-scales
           r-stringr))
    (native-inputs
     (list r-knitr r-r-rsp r-testthat))
    (home-page "https://github.com/quentingronau/bridgesampling")
    (synopsis "Bridge sampling for marginal likelihoods and Bayes factors")
    (description
     "This package provides functions for estimating marginal likelihoods,
Bayes factors, posterior model probabilities, and normalizing constants in
general, via different versions of bridge sampling.")
    (license license:gpl2+)))

(define-public r-tea
  (package
    (name "r-tea")
    (version "1.1")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "tea" version))
       (sha256
        (base32
         "0ql7lrxk0ihm49kqsvz79ig8i54rwiy9nxav4v9hy72j9kj5bgjn"))))
    (properties
     `((upstream-name . "tea")))
    (build-system r-build-system)
    (propagated-inputs
     (list r-matrix))
    (home-page "https://cran.r-project.org/web/packages/tea/")
    (synopsis "Threshold estimation approaches")
    (description
     "This package provides different approaches for selecting the threshold
in generalized Pareto distributions.  Most of them are based on minimizing the
AMSE-criterion or at least by reducing the bias of the assumed GPD-model.
Others are heuristically motivated by searching for stable sample paths, i.e.
a nearly constant region of the tail index estimator with respect to k, which
is the number of data in the tail.  The third class is motivated by graphical
inspection.  In addition, a sequential testing procedure for GPD-GoF-tests
is also implemented here.")
    (license license:gpl3)))

(define-public r-awsmethods
  (package
    (name "r-awsmethods")
    (version "1.1-1")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "awsMethods" version))
       (sha256
        (base32
         "0hbmrcpdyg15zg4rysscsmxpxlpy0dkxx2aa63qibq7l1k14v4sh"))))
    (properties
     `((upstream-name . "awsMethods")))
    (build-system r-build-system)
    (home-page "http://www.wias-berlin.de/software/imaging/")
    (synopsis "Class and methods definitions")
    (description
     "This package defines the generic method @code{extract} and provides
@code{openMP} support as needed in several packages like
@code{aws}, @code{adimpro}, @code{fmri}, and @code{dwi}.")
    (license license:gpl2+)))

(define-public r-aws
  (package
    (name "r-aws")
    (version "2.5-6")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "aws" version))
       (sha256
        (base32
         "0b1rixkk4fn34hig39ayfiiidk4jdx035p2y1vhdn9dyj21cbcls"))))
    (properties
     `((upstream-name . "aws")))
    (build-system r-build-system)
    (propagated-inputs
     (list r-awsmethods r-gsl))
    (native-inputs
     (list gfortran))
    (home-page "https://cran.r-project.org/web/packages/aws/")
    (synopsis "Adaptive weights smoothing")
    (description
     "This package provides a collection of R-functions implementing adaptive
smoothing procedures in 1D, 2D and 3D.  This includes the
Propagation-Separation approach to adaptive smoothing, the @dfn{Intersecting
Confidence Intervals} (ICI), variational approaches, and a non-local means
filter.")
    (license license:gpl2+)))

(define-public r-grouped
  (package
    (name "r-grouped")
    (version "0.6-0")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "grouped" version))
       (sha256
        (base32
         "1glxgacpwk7yjbkwg5ci6bmb2il6hf5zhydwi5bbq6hc032m9976"))))
    (properties
     `((upstream-name . "grouped")))
    (build-system r-build-system)
    (propagated-inputs
     (list r-mass))
    (home-page "https://cran.r-project.org/web/packages/grouped/")
    (synopsis "Regression analysis of grouped and coarse data")
    (description
     "This package provides regression models for grouped and coarse data,
under the coarsened at random assumption.")
    (license license:gpl2+)))

(define-public r-stam
  (package
    (name "r-stam")
    (version "0.0-1")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "stam" version))
       (sha256
        (base32
         "1x1j45fir64kffny0nssb2hwn4rcp8gd2cjv6fw4yy0l4d0xi5iv"))))
    (properties
     `((upstream-name . "stam")))
    (build-system r-build-system)
    (propagated-inputs
     (list r-np r-sp))
    (home-page "https://cran.r-project.org/web/packages/stam")
    (synopsis "Spatio-temporal analysis and modelling")
    (description
     "This package provides various methods to conduct Spatio-Temporal
Analysis and Modelling, including Exploratory Spatio-Temporal Analysis and
Inferred Spatio-Temporal Modelling.")
    (license license:gpl2+)))

(define-public r-dcurver
  (package
    (name "r-dcurver")
    (version "0.9.2")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "dcurver" version))
       (sha256
        (base32 "1v4h480lff1cyjjwb80dksiffh0y4b3s07lq2l2r21rn1l4mav6c"))))
    (properties `((upstream-name . "dcurver")))
    (build-system r-build-system)
    (propagated-inputs (list r-rcpp r-rcpparmadillo))
    (native-inputs (list r-testthat))
    (home-page "https://github.com/oguzhanogreden/dcurver")
    (synopsis "Utility functions for Davidian curves")
    (description
     "This package provides a Davidian curve defines a seminonparametric density,
whose shape and flexibility can be tuned by easy to estimate parameters.  Since
a special case of a Davidian curve is the standard normal density, Davidian
curves can be used for relaxing normality assumption in statistical applications
(Zhang & Davidian, 2001) <doi:10.1111/j.0006-341X.2001.00795.x>.  This package
provides the density function, the gradient of the loglikelihood and a random
generator for Davidian curves.")
    (license license:gpl3)))

(define-public r-dcv
  (package
    (name "r-dcv")
    (version "0.1.1")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "dcv" version))
       (sha256
        (base32
         "12c716x8dnxnqksibpmyysqp2axggvy9dpd55s9bhnsvqvi6dshj"))))
    (properties
     `((upstream-name . "dcv")))
    (build-system r-build-system)
    (propagated-inputs
     (list r-lmtest))
    (home-page "https://cran.r-project.org/web/packages/dcv/")
    (synopsis "Conventional cross-validation statistics for climate-growth model")
    (description
     "This package performs several conventional cross-validation statistical
methods for climate-growth model in the climate reconstruction from tree
rings, including Sign Test statistic, Reduction of Error statistic, Product
Mean Test, Durbin-Watson statistic etc.")
    (license license:gpl2)))

(define-public r-rcdd
  (package
    (name "r-rcdd")
    (version "1.6")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "rcdd" version))
       (sha256
        (base32
         "0xfvfcjd9gpp6qaalkfkx2f11lyj4sm6n6b763lnk0rrmn6cv2lz"))))
    (properties
     `((upstream-name . "rcdd")))
    (build-system r-build-system)
    (inputs
     (list gmp))
    (home-page "https://www.stat.umn.edu/geyer/rcdd/")
    (synopsis "Computational geometry")
    (description
     "This package converts back and forth between two representations of a
convex polytope: as solution of a set of linear equalities and inequalities
and as convex hull of set of points and rays.  Also does linear programming
and redundant generator elimination.  All functions can use exact
infinite-precision rational arithmetic.")
    (license license:gpl2)))

(define-public r-rcdt
  (package
    (name "r-rcdt")
    (version "1.3.0")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "RCDT" version))
       (sha256
        (base32 "1k27kydqzxqdhjbygq5a8mdhwlvbc32j1hg4vr223rwwc94864w6"))))
    (properties `((upstream-name . "RCDT")))
    (build-system r-build-system)
    (propagated-inputs (list r-bh
                             r-colorsgen
                             r-gplots
                             r-polychrome
                             r-rcpp
                             r-rcpparmadillo
                             r-rgl
                             r-rvcg))
    (native-inputs (list r-knitr r-testthat))
    (home-page "https://github.com/stla/RCDT")
    (synopsis "Fast 2D constrained Delaunay triangulation")
    (description
     "This package performs 2D Delaunay triangulation, constrained or
unconstrained, with the help of the C++ library CDT.  A function to plot the
triangulation is provided.  The constrained Delaunay triangulation has
applications in geographic information systems.")
    (license license:gpl3)))

(define-public r-rxnat
  (package
    (name "r-rxnat")
    (version "1.0.15")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "Rxnat" version))
       (sha256
        (base32
         "0siylypjd8cgcmr2c443w8krg8sgr5gz4zapbinanp8vsfzivdv2"))))
    (properties
     `((upstream-name . "Rxnat")))
    (build-system r-build-system)
    (propagated-inputs
     (list r-httr r-rcurl r-tibble))
    (native-inputs
     (list r-knitr r-testthat))
    (home-page "https://cran.r-project.org/web/packages/Rxnat/")
    (synopsis "Queries and extracts images from neuroimaging datasets")
    (description
     "This package allows communication with the Extensible Neuroimaging
Archive Toolkit.  Rxnat uses the XNAT REST API to perform data queries and
download images.")
    (license license:gpl2)))

(define-public r-rserve
  (package
    (name "r-rserve")
    (version "1.8-6")
    (source
     (origin
       (method url-fetch)
       (uri (string-append "http://www.rforge.net/Rserve/snapshot/Rserve_"
                           version ".tar.gz"))
       (sha256
        (base32 "0z1xvx8ifvlwfl3rf1wwhpbwp4ivh7sn71xhlqihqpsclpmljg8p"))))
    (build-system r-build-system)
    (arguments
     `(#:phases
       (modify-phases %standard-phases
         (add-before 'install 'install-server-binary
           ;; Makevars tries to install to R's store directory.
           (lambda* (#:key outputs #:allow-other-keys)
             (let* ((out (assoc-ref outputs "out"))
                    (bin (string-append out "/bin")))
               (substitute* "src/Makevars.in"
                 (("\\$\\(R_HOME\\)") out))
               (mkdir-p bin)))))))
    (propagated-inputs
     (list r-checkmate
           r-mime
           r-jsonlite
           r-knitr
           r-r6
           r-rcpp
           r-uuid))
    (inputs
     (list openssl zlib))
    (home-page "https://github.com/s-u/Rserve")
    (synopsis
     "Server providing access to R from many languages and systems")
    (description
     "Rserve acts as a socket server (TCP/IP or local sockets) which allows
binary requests to be sent to R.  Every connection has a separate workspace
and working directory.  Client-side implementations are available for popular
languages such as C/C++ and Java, allowing any application to use facilities
of R without the need of linking to R code.  Rserve supports remote
connection, user authentication and file transfer.  A simple R client is
included in this package as well.")
    (license license:gpl2)))

(define-public r-gamm4
  (package
    (name "r-gamm4")
    (version "0.2-7")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "gamm4" version))
       (sha256
        (base32
         "1pxfmkja2vpzbqmsybh2rvldilidxsi48lrabzj58prr34y39k5s"))))
    (properties `((upstream-name . "gamm4")))
    (build-system r-build-system)
    (propagated-inputs
     (list r-lme4 r-matrix r-mgcv))
    (home-page "https://cran.r-project.org/web/packages/gamm4/")
    (synopsis "Generalized additive mixed models using mgcv and lme4")
    (description
     "Estimate generalized additive mixed models via a version of function
@code{gamm} from the @code{mgcv} package, using the @code{lme4} packagefor
estimation.")
    (license license:gpl2+)))

(define-public r-optimx
  (package
    (name "r-optimx")
    (version "2025-4.9")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "optimx" version))
       (sha256
        (base32
         "0m0q3miiqhv185y4my5ylschmwg1kibbihzlqb89zwp3f6rqmdhh"))))
    (properties `((upstream-name . "optimx")))
    (build-system r-build-system)
    ;; Tests require too many additional packages.
    (arguments (list #:tests? #false))
    (propagated-inputs (list r-nloptr r-numderiv r-pracma))
    (native-inputs (list r-r-rsp))
    (home-page "https://cran.r-project.org/web/packages/optimx/")
    (synopsis "Expanded replacement and extension of the optim function")
    (description
     "This package provides a replacement and extension of the @code{optim}
function to call to several function minimization codes in R in a single
statement.  These methods handle smooth, possibly box constrained functions of
several or many parameters.  Note that the function @code{optimr} was prepared
to simplify the incorporation of minimization codes going forward.  This
package also implements some utility codes and some extra solvers, including
safeguarded Newton methods.  Many methods previously separate are now included
here.")
    (license license:gpl2)))

(define-public r-projpred
  (package
    (name "r-projpred")
    (version "2.8.0")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "projpred" version))
       (sha256
        (base32
         "1xm1444qv0pkxdf2nacxnb2apx5lar1f3qz4jrxp6xd2xk2xv0xk"))))
    (properties `((upstream-name . "projpred")))
    (build-system r-build-system)
    (propagated-inputs
     (list r-abind
           r-gamm4
           r-ggplot2
           r-gtools
           r-lme4
           r-loo
           r-mass
           r-mclogit
           r-mgcv
           r-mvtnorm
           r-nnet
           r-ordinal
           r-rcpp
           r-rcpparmadillo
           r-rstantools
           r-scales))
    (native-inputs (list r-knitr r-rmarkdown r-testthat))
    (home-page "https://mc-stan.org/projpred/")
    (synopsis "Projection predictive feature selection")
    (description
     "This package performs projection predictive feature selection for
generalized linear models and generalized linear and additive multilevel
models.  The package is compatible with the @code{rstanarm} and @code{brms}
packages, but other reference models can also be used.  See the package
vignette for more information and examples.")
    (license license:gpl3)))

(define-public r-distributional
  (package
    (name "r-distributional")
    (version "0.5.0")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "distributional" version))
       (sha256
        (base32
         "1b3i5vgljpjcr8v2xrz20cd900q36rmijizfgcx7id3raj5dwp1l"))))
    (properties
     '((upstream-name . "distributional")
       (updater-extra-native-inputs . ("r-evd" "r-mvtnorm"))))
    (build-system r-build-system)
    (propagated-inputs
     (list r-generics
           r-lifecycle
           r-numderiv
           r-pillar
           r-rlang
           r-vctrs))
    (native-inputs (list r-evd r-mvtnorm r-testthat))
    (home-page "https://pkg.mitchelloharawild.com/distributional/")
    (synopsis "Vectorized probability distributions")
    (description
     "This package provides vectorized distribution objects with tools for
manipulating, visualizing, and using probability distributions.  It was
designed to allow model prediction outputs to return distributions rather than
their parameters, allowing users to directly interact with predictive
distributions in a data-oriented workflow.  In addition to providing generic
replacements for p/d/q/r functions, other useful statistics can be computed
including means, variances, intervals, and highest density regions.")
    (license license:gpl3)))

(define-public r-posterior
  (package
    (name "r-posterior")
    (version "1.6.1")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "posterior" version))
       (sha256
        (base32
         "16d7gfg8mfx89gz365a6cjc5zl0vs0wbr2gcn8n597sc7yyxf1z5"))))
    (properties `((upstream-name . "posterior")))
    (build-system r-build-system)
    (propagated-inputs
     (list r-abind
           r-checkmate
           r-distributional
           r-matrixstats
           r-pillar
           r-rlang
           r-tensora
           r-tibble
           r-vctrs))
    (native-inputs
     (list r-dplyr r-ggplot2 r-knitr r-testthat r-tidyr))
    (home-page "https://mc-stan.org/posterior/")
    (synopsis "Tools for working with posterior distributions")
    (description
     "This package provides useful tools for both users and developers of
packages for fitting Bayesian models or working with output from Bayesian
models.  The primary goals of the package are to:

@enumerate
@item Efficiently convert between many different useful formats of
draws (samples) from posterior or prior distributions.

@item Provide consistent methods for operations commonly performed on draws,
for example, subsetting, binding, or mutating draws.

@item Provide various summaries of draws in convenient formats.

@item Provide lightweight implementations of state of the art posterior
inference diagnostics.
@end enumerate
")
    (license license:bsd-3)))

(define-public r-brms
  (package
    (name "r-brms")
    (version "2.22.0")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "brms" version))
       (sha256
        (base32
         "1gl1pdna356mfrf9816rqx8q7a3h3xzkn75bjd2zylgqw49ss88p"))))
    (properties
     '((upstream-name . "brms")
       (updater-extra-native-inputs
        . ("r-extradistr" "r-mnormt" "r-rtdists" "r-rwiener" "r-splines2"))))
    (build-system r-build-system)
    (arguments
     (list
      #:phases
      '(modify-phases %standard-phases
         ;; When there is no HOME directory, this package will fail to find
         ;; the vignette builder.
         (add-after 'unpack 'set-HOME
           (lambda _ (setenv "HOME" "/tmp"))))))
    (propagated-inputs
     (list r-abind
           r-backports
           r-bayesplot
           r-bridgesampling
           r-coda
           r-future
           r-future-apply
           r-ggplot2
           r-glue
           r-loo
           r-matrix
           r-matrixstats
           r-mgcv
           r-nleqslv
           r-nlme
           r-posterior
           r-rcpp
           r-rlang
           r-rstan
           r-rstantools))
    (native-inputs (list r-extradistr
                         r-knitr
                         r-mnormt
                         r-r-rsp
                         r-rtdists
                         r-rwiener
                         r-splines2
                         r-testthat))
    (home-page "https://github.com/paul-buerkner/brms")
    (synopsis "Bayesian regression models using Stan")
    (description
     "Fit Bayesian generalized (non-)linear multivariate multilevel models
using @emph{Stan} for full Bayesian inference.  A wide range of distributions
and link functions are supported, allowing users to fit -- among others --
linear, robust linear, count data, survival, response times, ordinal,
zero-inflated, hurdle, and even self-defined mixture models all in a
multilevel context.  Further modeling options include non-linear and smooth
terms, auto-correlation structures, censored data, meta-analytic standard
errors, and quite a few more. In addition, all parameters of the response
distribution can be predicted in order to perform distributional
regression. Prior specifications are flexible and explicitly encourage users
to apply prior distributions that actually reflect their beliefs. Model fit
can easily be assessed and compared with posterior predictive checks and
leave-one-out cross-validation.")
    (license license:gpl2)))

(define-public r-mstate
  (package
    (name "r-mstate")
    (version "0.3.3")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "mstate" version))
       (sha256
        (base32
         "0vxfayp9d21hgihrb3bfn04y76qgvqx0mcwbw5w6izpbqcwxlcw5"))))
    (properties `((upstream-name . "mstate")))
    (build-system r-build-system)
    (propagated-inputs
     (list r-data-table
           r-lattice
           r-rcolorbrewer
           r-rlang
           r-survival
           r-viridislite))
    (native-inputs
     (list r-knitr))
    (home-page
     "https://www.lumc.nl/org/bds/research/medische-statistiek/survival-analysis/")
    (synopsis
     "Data Preparation, Estimation and Prediction in Multi-State Models")
    (description
     "Contains functions for data preparation, descriptives, hazard estimation
and prediction with Aalen-Johansen or simulation in competing risks and
multi-state models.")
    (license license:gpl2+)))

(define-public r-scatterpie
  (package
    (name "r-scatterpie")
    (version "0.2.4")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "scatterpie" version))
       (sha256
        (base32
         "165n0jay7aad5i10g520zrrcdx12m63mxg6d3a66gmash6sj2jsr"))))
    (properties `((upstream-name . "scatterpie")))
    (build-system r-build-system)
    (propagated-inputs
     (list r-dplyr
           r-ggforce
           r-ggfun
           r-ggplot2
           r-rlang
           r-tidyr
           r-yulab-utils))
    (native-inputs
     (list r-knitr))
    (home-page "https://cran.r-project.org/web/packages/scatterpie/")
    (synopsis "Scatter pie plot")
    (description
     "This package creates scatterpie plots, especially useful for plotting
pies on a map.")
    (license license:artistic2.0)))

(define-public r-scrypt
  (package
    (name "r-scrypt")
    (version "0.1.6")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "scrypt" version))
       (sha256
        (base32
         "11ncpv01a5lgbxl46g07a43ncjp7jdhrrciasxvxc1d56cz26jh1"))))
    (properties `((upstream-name . "scrypt")))
    (build-system r-build-system)
    (propagated-inputs
     (list r-rcpp))
    (home-page "https://github.com/rstudio/rscrypt")
    (synopsis "Key derivation functions for R based on Scrypt")
    (description
     "This package provides functions for working with the scrypt key
derivation functions.  Scrypt is a password-based key derivation function
created by Colin Percival.  The algorithm was specifically designed to make it
costly to perform large-scale custom hardware attacks by requiring large
amounts of memory.")
    (license license:bsd-2)))

(define-public r-boruta
  (package
    (name "r-boruta")
    (version "8.0.0")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "Boruta" version))
       (sha256
        (base32
         "1irx7qg1sw69ggsk4jgxfd3pp741kd944fipnda1qbcbphg5prrq"))))
    (properties
     '((upstream-name . "Boruta")
       (updater-extra-native-inputs
        . ("r-randomforest" "r-survival" "r-xgboost"))))
    (build-system r-build-system)
    (propagated-inputs (list r-ranger))
    (native-inputs (list r-randomforest
                         r-rferns
                         r-survival
                         r-testthat
                         r-xgboost))
    (home-page "https://gitlab.com/mbq/Boruta/")
    (synopsis "Wrapper algorithm for all relevant feature selection")
    (description
     "This package provides an all relevant feature selection wrapper
algorithm.  It finds relevant features by comparing original attributes'
importance with importance achievable at random, estimated using their
permuted copies (shadows).")
    (license license:gpl2+)))

(define-public r-directlabels
  (package
    (name "r-directlabels")
    (version "2025.5.20")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "directlabels" version))
       (sha256
        (base32
         "0rxydqyfqkqhk9m9f5vldspss5kc6cljpglpq18skrcrylv9z4zd"))))
    (build-system r-build-system)
    (propagated-inputs
     (list r-quadprog))
    (native-inputs
     (list r-knitr r-nlme r-testthat))
    (home-page "https://directlabels.r-forge.r-project.org/")
    (synopsis "Direct labels for multicolor plots")
    (description
     "This package provides an extensible framework for automatically placing
direct labels onto multicolor plots.  Label positions are described using
positioning methods that can be re-used across several different plots.  There
are heuristics for examining @code{trellis} and @code{ggplot} objects and
inferring an appropriate positioning method.")
    (license license:gpl3)))

(define-public r-lsd
  (package
    (name "r-lsd")
    (version "4.1-0")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "LSD" version))
       (sha256
        (base32 "17pbdlcbhzf3v7l42mjikln1ga5xjp5r78gjg6a88iahk0lwwlvm"))))
    (properties `((upstream-name . "LSD")))
    (build-system r-build-system)
    (home-page "https://cran.r-project.org/web/packages/LSD/")
    (synopsis "Lots of superior depictions tool creates colorful plots")
    (description
     "This package creates lots of colorful plots in a multitude of variations.
Try a demo of the LSD by running @code{demotour()}.")
    ;; Either version
    (license (list license:gpl2 license:gpl3))))

(define-public r-phylogram
  (package
    (name "r-phylogram")
    (version "2.1.0")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "phylogram" version))
       (sha256
        (base32 "1p4h5pirc0m5pzc18q0jk3mcmb5n48gdf9abz03vml3a209xxl2v"))))
    (properties `((upstream-name . "phylogram")))
    (build-system r-build-system)
    (propagated-inputs (list r-ape))
    (native-inputs (list r-knitr r-testthat))
    (home-page "https://github.com/ropensci/phylogram/")
    (synopsis "Dendrograms for evolutionary analysis")
    (description
     "The @code{r-phylogram} package is a tool for for developing phylogenetic
trees as deeply-nested lists known as \"dendrogram\" objects.  It provides
functions for conversion between \"dendrogram\" and \"phylo\" class objects,
as well as several tools for command-line tree manipulation and import/export
via Newick parenthetic text.  This improves accessibility to the comprehensive
range of object-specific analytical and tree-visualization functions found
across a wide array of bioinformatic R packages.")
    (license license:gpl3)))

(define-public r-phytools
  (package
    (name "r-phytools")
    (version "2.4-4")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "phytools" version))
       (sha256
        (base32 "1i25dlikdx9av5653ra2709sjm9fc3fsis1yfsb7zagivi408ph9"))))
    (properties `((upstream-name . "phytools")))
    (build-system r-build-system)
    (propagated-inputs (list r-ape
                             r-clustergeneration
                             r-coda
                             r-combinat
                             r-deoptim
                             r-doparallel
                             r-expm
                             r-foreach
                             r-maps
                             r-mass
                             r-mnormt
                             r-nlme
                             r-numderiv
                             r-optimparallel
                             r-phangorn
                             r-scatterplot3d))
    (home-page "https://github.com/liamrevell/phytools")
    (synopsis "Phylogenetic tools for comparative biology")
    (description
     "This package offers extensive tools for phylogenetic analysis.  It
focuses on phylogenetic comparative biology but also includes methods for
visualizing, analyzing, manipulating, reading, writing, and inferring
phylogenetic trees.  Functions for comparative biology include ancestral state
reconstruction, model fitting, and phylogeny and trait data simulation.  A
broad range of plotting methods includes mapping trait evolution on trees,
projecting trees into phenotype space or geographic maps, and visualizing
correlated speciation between trees.  Additional functions allow for reading,
writing, analyzing, inferring, simulating, and manipulating phylogenetic trees
and comparative data.  Examples include computing consensus trees, simulating
trees and data under various models, and attaching species or clades to a tree
either randomly or non-randomly.  This package provides numerous tools for
tree manipulations and analyses that are valuable for phylogenetic research.")
    (license license:gpl2+)))

(define-public r-kmer
  (package
    (name "r-kmer")
    (version "1.1.2")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "kmer" version))
       (sha256
        (base32 "0jimn9r0abglwxdl1zqz0lxa99cmj6haydkxjzqfbpx9by80wnww"))))
    (properties `((upstream-name . "kmer")))
    (build-system r-build-system)
    (propagated-inputs
     (list r-openssl r-phylogram r-rcpp))
    (native-inputs (list r-knitr r-testthat))
    (home-page "https://github.com/shaunpwilkinson/kmer/")
    (synopsis "Fast K-Mer counting and clustering for biological sequence analysis")
    (description
     "@code{r-kmer} is an R package for rapidly computing distance matrices
and clustering large sequence datasets using fast alignment-free k-mer
counting and recursive k-means partitioning.")
    (license license:gpl3)))

(define-public r-hardhat
  (package
    (name "r-hardhat")
    (version "1.4.1")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "hardhat" version))
       (sha256
        (base32
         "0hyymp5kbvkmns2ikv66xbyb962sz6lcbdxqwm009lggkvdzngcr"))))
    (properties
     '((upstream-name . "hardhat")
       (updater-ignored-native-inputs
        ;; r-recipes causes a dependency cycle; the others just aren't needed.
        . ("r-recipes" "r-here" "r-devtools" "r-usethis"))))
    (build-system r-build-system)
    (propagated-inputs
     (list r-cli
           r-glue
           r-rlang
           r-sparsevctrs
           r-tibble
           r-vctrs))
    (native-inputs
     (list r-fs r-matrix r-modeldata r-knitr r-testthat r-withr))
    (home-page "https://github.com/tidymodels/hardhat")
    (synopsis "Construct modeling packages")
    (description
     "Building modeling packages is hard.  A large amount of effort generally
goes into providing an implementation for a new method that is efficient,
fast, and correct, but often less emphasis is put on the user interface.  A
good interface requires specialized knowledge about S3 methods and formulas,
which the average package developer might not have.  The goal of
@code{hardhat} is to reduce the burden around building new modeling packages
by providing functionality for preprocessing, predicting, and validating
input.")
    (license license:expat)))

(define-public r-lightgbm
  (package
    (name "r-lightgbm")
    (version "4.6.0")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "lightgbm" version))
       (sha256
        (base32
         "1221rp3ml4dggk4i7w9f58437dm3myfwapll21i8fmnzjapl50zr"))))
    (properties `((upstream-name . "lightgbm")))
    (build-system r-build-system)
    (arguments
     (list
      #:phases
      '(modify-phases %standard-phases
         (add-after 'unpack 'disable-bad-test
           (lambda _
             ;; This test produces warnings.
             (substitute* "tests/testthat/test_parameters.R"
               ((".*training should warn if you use.*" m)
                (string-append m "skip('skip')\n"))))))))
    (propagated-inputs
     (list r-data-table r-jsonlite r-matrix r-r6))
    (native-inputs
     (list r-knitr r-testthat))
    (home-page "https://github.com/Microsoft/LightGBM")
    (synopsis "Light gradient boosting machine")
    (description
     "Tree based algorithms can be improved by introducing boosting
frameworks.  LightGBM is one such framework, based on Ke, Guolin et
al. (2017).  This package offers an R interface to work with it.  It is
designed to be distributed and efficient with the following goals:

@enumerate
@item Faster training speed and higher efficiency;
@item lower memory usage;
@item better accuracy;
@item parallel learning supported; and
@item capable of handling large-scale data.
@end enumerate
")
    (license license:expat)))

(define-public r-shapforxgboost
  (package
    (name "r-shapforxgboost")
    (version "0.1.3")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "SHAPforxgboost" version))
       (sha256
        (base32
         "0b3h6py80a0dmb8f8j4h7a7d0k6ld8l0qr24r8pxxy7dbqbyxh5x"))))
    (properties
     `((upstream-name . "SHAPforxgboost")))
    (build-system r-build-system)
    (propagated-inputs
     (list r-bbmisc
           r-data-table
           r-ggextra
           r-ggforce
           r-ggplot2
           r-ggpubr
           r-rcolorbrewer
           r-xgboost))
    (native-inputs
     (list r-knitr))
    (home-page "https://github.com/liuyanguu/SHAPforxgboost")
    (synopsis "SHAP Plots for XGBoost")
    (description
     "The aim of @code{SHAPforxgboost} is to aid in visual data investigations
using @dfn{SHAP} (Shapley additive explanation) visualization plots for
@code{XGBoost}.  It provides summary plot, dependence plot, interaction plot,
and force plot.  It relies on the @code{XGBoost} package to produce SHAP
values.")
    (license license:expat)))

(define-public r-rismed
  (package
    (name "r-rismed")
    (version "2.3.0")
    (source
      (origin
        (method url-fetch)
        (uri (cran-uri "RISmed" version))
        (sha256
          (base32
            "0vpi88gzi9r85v6nhjz9jbw671zkrmyazwna2z881346wfyr3l8b"))))
    (properties `((upstream-name . "RISmed")))
    (build-system r-build-system)
    (propagated-inputs
     (list r-httr r-xml2))
    (home-page "https://cran.r-project.org/web/packages/RISmed")
    (synopsis "Download content from NCBI databases")
    (description
      "This package provides a set of tools to extract bibliographic
content from the National Center for Biotechnology Information (NCBI)
databases, including PubMed.  The name RISmed is a portmanteau of
RIS (for Research Information Systems, a common tag format for
bibliographic data) and PubMed.")
    (license license:gpl2+)))

(define-public r-semver
  (package
    (name "r-semver")
    (version "0.2.0")
    (source
      (origin
        (method url-fetch)
        (uri (cran-uri "semver" version))
        (sha256
          (base32
            "10wpkyms2cix3bsin2q0qhkbl445pwwpa5gm2s4jjw1989namkxy"))))
    (properties `((upstream-name . "semver")))
    (build-system r-build-system)
    (propagated-inputs
      (list r-assertthat r-rcpp))
    (native-inputs (list r-knitr r-testthat))
    (home-page "https://github.com/johndharrison/semver")
    (synopsis "Parser for Semantic Versioning 2.0.0")
    (description
      "This package provides tools and functions for parsing, rendering and
operating on semantic version strings.  Semantic versioning is a simple set of
rules and requirements that dictate how version numbers are assigned and
incremented as outlined at @url{http://semver.org}.")
    (license license:expat)))

(define-public r-binman
  (package
    (name "r-binman")
    (version "0.1.3")
    (source
      (origin
        (method url-fetch)
        (uri (cran-uri "binman" version))
        (sha256
          (base32
            "1xz9ky3axidm0fp518rj80ma6q14ybyvashil79hhkk3iqmx0lhw"))))
    (properties `((upstream-name . "binman")))
    (build-system r-build-system)
    (propagated-inputs
      (list r-assertthat
            r-httr
            r-jsonlite
            r-rappdirs
            r-semver
            r-xml2
            r-yaml))
    (native-inputs (list r-knitr r-testthat))
    (home-page "https://github.com/ropensci/binman")
    (synopsis "Binary download manager")
    (description
      "This package provides tools and functions for managing the download of
binary files.  Binary repositories are defined in the YAML format.  Defining
new pre-download, download and post-download templates allow additional
repositories to be added.")
    (license license:expat)))

(define-public r-wdman
  (package
    (name "r-wdman")
    (version "0.2.6")
    (source
      (origin
        (method url-fetch)
        (uri (cran-uri "wdman" version))
        (sha256
          (base32
            "0n0wwb9ip6qc8qzdxn4dsqfbc8b3f607n8l6jigryd7g83ibnbp6"))))
    (properties `((upstream-name . "wdman")))
    (build-system r-build-system)
    (propagated-inputs
      (list r-assertthat r-binman r-processx r-semver r-yaml))
    (native-inputs (list r-knitr r-testthat))
    (home-page "https://docs.ropensci.org/wdman/")
    (synopsis "Webdriver/Selenium binary manager")
    (description
      "There are a number of binary files associated with the
Webdriver/Selenium project (see @url{http://www.seleniumhq.org/download/},
@url{https://sites.google.com/a/chromium.org/chromedriver/},
@url{https://github.com/mozilla/geckodriver},
@url{http://phantomjs.org/download.html}, and
@url{https://github.com/SeleniumHQ/selenium/wiki/InternetExplorerDriver} for
more information).  This package provides functions to download these binaries
and to manage processes involving them.")
    (license license:expat)))

(define-public r-rselenium
  (package
    (name "r-rselenium")
    (version "1.7.9")
    (source
      (origin
        (method url-fetch)
        (uri (cran-uri "RSelenium" version))
        (sha256
          (base32
            "18hd0gfpblg9ij99ik7ccc60q9dxha89n5rrwrrzx498c5sscjg2"))))
    (properties `((upstream-name . "RSelenium")))
    (build-system r-build-system)
    (propagated-inputs
     (list r-catools
           r-httr
           r-wdman))
    (native-inputs (list r-knitr r-testthat))
    (home-page "https://docs.ropensci.org/RSelenium/")
    (synopsis "R bindings for Selenium WebDriver")
    (description
      "This package provides a set of R bindings for the Selenium 2.0
WebDriver (see @url{https://selenium.dev/documentation/en/} for more
information) using the @code{JsonWireProtocol} (see
@url{https://github.com/SeleniumHQ/selenium/wiki/JsonWireProtocol} for more
information).  Selenium 2.0 WebDriver allows driving a web browser natively as
a user would either locally or on a remote machine using the Selenium server
it marks a leap forward in terms of web browser automation.  Selenium
automates web browsers (commonly referred to as browsers).  Using RSelenium
you can automate browsers locally or remotely.")
    (license license:agpl3+)))

(define-public r-conquer
  (package
    (name "r-conquer")
    (version "1.3.3")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "conquer" version))
       (sha256
        (base32
         "1fnyjym21i9hw2d1c9da0wvjzbi9abn46n0lg6if5w2asxg1bim2"))))
    (properties `((upstream-name . "conquer")))
    (build-system r-build-system)
    (propagated-inputs
     (list r-matrix r-matrixstats r-rcpp r-rcpparmadillo))
    (home-page "https://github.com/XiaoouPan/conquer")
    (synopsis "Convolution-type smoothed quantile regression")
    (description
     "This package provides fast and accurate convolution-type smoothed
quantile regression, implemented using Barzilai-Borwein gradient descent with
a Huber regression warm start.  Confidence intervals for regression
coefficients are constructed using multiplier bootstrap.")
    (license license:gpl3)))

(define-public r-consrank
  (package
    (name "r-consrank")
    (version "2.1.5")
    (source (origin
              (method url-fetch)
              (uri (cran-uri "ConsRank" version))
              (sha256
               (base32
                "06jcf832282irk11vxsynmaa28wjydrh9va7jwnq4l4znbv6ix32"))))
    (properties `((upstream-name . "ConsRank")))
    (build-system r-build-system)
    (propagated-inputs (list r-gtools r-proxy r-rgl r-rlist r-tidyr))
    (home-page "https://www.r-project.org/")
    (synopsis
     "Compute median rankings according to Kemeny's axiomatic approach")
    (description
     "This package lets you compute the median ranking according to Kemeny's
axiomatic approach.  Rankings can or cannot contain ties, rankings can be both
complete or incomplete.  The package contains both branch-and-bound algorithms
and heuristic solutions recently proposed.  The searching space of the
solution can either be restricted to the universe of the permutations or
unrestricted to all possible ties.  The package also provides some useful
utilities for deal with preference rankings, including both element-weight
Kemeny distance and correlation coefficient.")
    (license license:gpl3)))

(define-public r-fastshap
  (package
    (name "r-fastshap")
    (version "0.1.1")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "fastshap" version))
       (sha256
        (base32
         "1j6bnkv4q8n85xlvzm5p6p4yg8wdp6an6skbvdif5g9c376hzqb2"))))
    (properties `((upstream-name . "fastshap")))
    (build-system r-build-system)
    (propagated-inputs
     (list r-foreach r-rcpp r-rcpparmadillo))
    (native-inputs
     (list r-knitr))
    (home-page "https://github.com/bgreenwell/fastshap")
    (synopsis "Fast approximate Shapley values")
    (description
     "This package computes fast (relative to other implementations)
approximate Shapley values for any supervised learning model.  Shapley values
help to explain the predictions from any black box model using ideas from game
theory; see @url{Strumbel and Kononenko (2014),
doi.org/10.1007/s10115-013-0679-x} for details.")
    (license license:gpl2+)))

(define-public r-mediation
  (package
    (name "r-mediation")
    (version "4.5.0")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "mediation" version))
       (sha256
        (base32 "0i88wvqqw8cmxmh9i78rqzp4s16zhf12dgl9fsk9bhw7hxhhc0i1"))))
    (properties `((upstream-name . "mediation")))
    (build-system r-build-system)
    ;; One vignette overwrites the output of another vignette
    (arguments (list #:test-types '(list "tests")))
    (propagated-inputs (list r-boot
                             r-hmisc
                             r-lme4
                             r-lpsolve
                             r-mass
                             r-matrix
                             r-mvtnorm
                             r-sandwich))
    (native-inputs (list r-testthat))
    (home-page "https://imai.princeton.edu/projects/mechanisms.html")
    (synopsis "Causal mediation analysis")
    (description
     "This package implements parametric and non-parametric mediation
analysis.  This package performs the methods and suggestions in Imai, Keele
and Yamamoto (2010) <DOI:10.1214/10-STS321>, Imai, Keele and Tingley (2010)
<DOI:10.1037/a0020761>, Imai, Tingley and Yamamoto (2013)
<DOI:10.1111/j.1467-985X.2012.01032.x>, Imai and Yamamoto (2013)
<DOI:10.1093/pan/mps040> and Yamamoto (2013).  In addition to the estimation
of causal mediation effects, the software also allows researchers to conduct
sensitivity analysis for certain parametric models.")
    (license license:gpl2+)))

(define-public r-memisc
  (package
    (name "r-memisc")
    (version "0.99.31.8.3")
    (source (origin
              (method url-fetch)
              (uri (cran-uri "memisc" version))
              (sha256
               (base32
                "14mf01abhww2d2z1xyfz96cy0hai374dlzc5vnb9s7n4gpgigm8d"))))
    (properties `((upstream-name . "memisc")))
    (build-system r-build-system)
    (propagated-inputs (list r-data-table r-jsonlite r-lattice r-mass r-yaml))
    (native-inputs (list r-knitr))
    (home-page "https://www.elff.eu/software/memisc/")
    (synopsis "Management of survey data and presentation of analysis results")
    (description
     "This package provides infrastructure for the management of survey data
including value labels, definable missing values, recoding of variables,
production of code books, and import of (subsets of) SPSS and Stata files is
provided.  Further, the package produces tables and data frames of
arbitrary descriptive statistics and (almost) publication-ready tables of
regression model estimates, which can be exported to LaTeX and HTML.")
    ;; Either of these two version.
    (license (list license:gpl2 license:gpl3))))

(define-public r-memuse
  (package
    (name "r-memuse")
    (version "4.2-3")
    (source (origin
              (method url-fetch)
              (uri (cran-uri "memuse" version))
              (sha256
               (base32
                "0816s6airiqmn8faprpwmchxaay6llri4673ivlx1bp2cpvdyvwh"))))
    (properties `((upstream-name . "memuse")))
    (build-system r-build-system)
    (home-page "https://github.com/shinra-dev/memuse")
    (synopsis "Memory Estimation Utilities")
    (description
     "This package provides procedures to answer the following questions:
How much ram do you need to store a 100,000 by 100,000 matrix? How much ram is
your current R session using? How much ram do you even have?")
    (license license:bsd-2)))

(define-public r-metrics
  (package
    (name "r-metrics")
    (version "0.1.4")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "Metrics" version))
       (sha256
        (base32
         "0fh8qbjlwzagh272lgwr4bxcqcjb1qpz53mgs8rzlvncax6nk5bk"))))
    (properties `((upstream-name . "Metrics")))
    (build-system r-build-system)
    (native-inputs (list r-testthat))
    (home-page "https://github.com/mfrasco/Metrics")
    (synopsis "Evaluation metrics for machine learning")
    (description
     "This package provides an implementation of evaluation metrics in R that
are commonly used in supervised machine learning.  It implements metrics for
regression, time series, binary classification, classification, and
information retrieval problems.  It has zero dependencies and a consistent,
simple interface for all functions.")
    (license license:bsd-3)))

(define-public r-iml
  (package
    (name "r-iml")
    (version "0.11.4")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "iml" version))
       (sha256
        (base32
         "0r8p1s3mixzp9vsxwwksg3kc358cwkv0msydrjn6j8vl2kkjm6vd"))))
    (properties `((upstream-name . "iml")))
    (build-system r-build-system)
    (propagated-inputs
     (list r-checkmate
           r-data-table
           r-formula
           r-future
           r-future-apply
           r-ggplot2
           r-metrics
           r-r6))
    (native-inputs (list r-knitr))
    (home-page "https://github.com/christophM/iml")
    (synopsis "Interpretable machine learning")
    (description
     "This package provides interpretability methods to analyze the behavior
and predictions of any machine learning model.  Implemented methods are:

@itemize
@item Feature importance described by Fisher et al. (2018),
@item accumulated local effects plots described by Apley (2018),
@item partial dependence plots described by Friedman (2001),
@item individual conditional expectation ('ice') plots described by Goldstein
  et al. (2013) @url{https://doi.org/10.1080/10618600.2014.907095},
@item local models (variant of 'lime') described by Ribeiro et. al (2016),
@item the Shapley Value described by Strumbelj et. al (2014)
  @url{https://doi.org/10.1007/s10115-013-0679-x},
@item feature interactions described by Friedman et. al
  @url{https://doi.org/10.1214/07-AOAS148} and tree surrogate models.
@end itemize
")
    (license license:expat)))

(define-public r-goftest
  (package
    (name "r-goftest")
    (version "1.2-3")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "goftest" version))
       (sha256
        (base32
         "06bz6k7smr4jbvzmb73qc5fkf4my59w5gbl18wlmpkkymsv78prs"))))
    (properties `((upstream-name . "goftest")))
    (build-system r-build-system)
    (home-page "https://github.com/baddstats/goftest")
    (synopsis "Classical Goodness-of-Fit tests for univariate distributions")
    (description
     "This package provides Cramer-Von Mises and Anderson-Darling tests of
goodness-of-fit for continuous univariate distributions, using efficient
algorithms.")
    (license license:gpl2+)))

(define-public r-tensor
  (package
    (name "r-tensor")
    (version "1.5")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "tensor" version))
       (sha256
        (base32
         "19mfsgr6vz4lgwidm80i4yw0y1dr3n8i6qz7g4n2xa0k74zc5pp1"))))
    (properties `((upstream-name . "tensor")))
    (build-system r-build-system)
    (home-page "https://cran.r-project.org/web/packages/tensor/")
    (synopsis "Tensor product of arrays")
    (description
     "The tensor product of two arrays is notionally an outer product of the
arrays collapsed in specific extents by summing along the appropriate
diagonals.  This package allows you to compute the tensor product of arrays.")
    (license license:gpl2+)))

(define-public r-spatstat-explore
  (package
    (name "r-spatstat-explore")
    (version "3.4-3")
    (source (origin
              (method url-fetch)
              (uri (cran-uri "spatstat.explore" version))
              (sha256
               (base32
                "0jjfqvyiwxrn2zg1k4pzkbs8l2syf7c4klzyypy4nr9gbzwgwr3m"))))
    (properties `((upstream-name . "spatstat.explore")))
    (build-system r-build-system)
    (propagated-inputs
     (list r-abind
           r-goftest
           r-matrix
           r-nlme
           r-spatstat-data
           r-spatstat-geom
           r-spatstat-random
           r-spatstat-sparse
           r-spatstat-univar
           r-spatstat-utils))
    (home-page "https://spatstat.org/")
    (synopsis "Exploratory data analysis for the spatstat family")
    (description
     "This package implements functionality for exploratory data
analysis and nonparametric analysis of spatial data, mainly spatial
point patterns, in the @code{spatstat} family of packages.  Methods
include quadrat counts, K-functions and their simulation envelopes,
nearest neighbour distance and empty space statistics, Fry plots, pair
correlation function, kernel smoothed intensity, relative risk
estimation with cross-validated bandwidth selection, mark correlation
functions, segregation indices, mark dependence diagnostics, and
kernel estimates of covariate effects.  Formal hypothesis tests of
random pattern (chi-squared, Kolmogorov-Smirnov, Monte Carlo,
Diggle-Cressie-Loosmore-Ford, Dao-Genton, two-stage Monte Carlo) and
tests for covariate effects (Cox-Berman-Waller-Lawson,
Kolmogorov-Smirnov, ANOVA) are also supported.")
    (license license:gpl2+)))

(define-public r-spatstat-model
  (package
    (name "r-spatstat-model")
    (version "3.3-6")
    (source (origin
              (method url-fetch)
              (uri (cran-uri "spatstat.model" version))
              (sha256
               (base32
                "1581ai5dyklcc9jy3kyv0ylk91isa0wdrkzggz9yrk112fy8859n"))))
    (properties `((upstream-name . "spatstat.model")))
    (build-system r-build-system)
    (propagated-inputs
     (list r-abind
           r-goftest
           r-matrix
           r-mgcv
           r-nlme
           r-rpart
           r-spatstat-data
           r-spatstat-explore
           r-spatstat-geom
           r-spatstat-random
           r-spatstat-sparse
           r-spatstat-univar
           r-spatstat-utils
           r-tensor))
    (native-inputs (list r-random))
    (home-page "https://spatstat.org/")
    (synopsis "Parametric statistical modelling for the spatstat family")
    (description
     "This package implements functionality for exploratory data
analysis and nonparametric analysis of spatial data, mainly spatial
point patterns, in the spatstat family of packages.  Methods include
quadrat counts, K-functions and their simulation envelopes, nearest
neighbour distance and empty space statistics, Fry plots, pair
correlation function, kernel smoothed intensity, relative risk
estimation with cross-validated bandwidth selection, mark correlation
functions, segregation indices, mark dependence diagnostics, and
kernel estimates of covariate effects.  Formal hypothesis tests of
random pattern (chi-squared, Kolmogorov-Smirnov, Monte Carlo,
Diggle-Cressie-Loosmore-Ford, Dao-Genton, two-stage Monte Carlo) and
tests for covariate effects (Cox-Berman-Waller-Lawson,
Kolmogorov-Smirnov, ANOVA) are also supported.")
    (license license:gpl2+)))

(define-public r-spatstat-univar
  (package
    (name "r-spatstat-univar")
    (version "3.1-3")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "spatstat.univar" version))
       (sha256
        (base32 "0lc1a5x1gbf9sc810y7f6q5zr9gx2l4sy8xf8krwp5ylms3zvv3g"))))
    (properties `((upstream-name . "spatstat.univar")))
    (build-system r-build-system)
    (propagated-inputs (list r-spatstat-utils))
    (home-page "https://www.spatstat.org/")
    (synopsis
     "One-dimensional probability distribution support for spatstat")
    (description
     "This is a package for estimation of one-dimensional probability
distributions including kernel density estimation, weighted empirical
cumulative distribution functions, Kaplan-Meier and reduced-sample estimators
for right-censored data, heat kernels, kernel properties, quantiles and
integration.")
    (license license:gpl2+)))

(define-public r-spatstat-utils
  (package
    (name "r-spatstat-utils")
    (version "3.1-4")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "spatstat.utils" version))
       (sha256
        (base32
         "0vmk0r8424fnpydrqm9xyc1jbbv14qjykw9i8xf0pa354v5m4ka1"))))
    (properties
     `((upstream-name . "spatstat.utils")))
    (build-system r-build-system)
    (home-page "https://www.spatstat.org")
    (synopsis "Utility functions for spatstat")
    (description
     "This package contains utility functions for the @code{spatstat} package
which may also be useful for other purposes.")
    (license license:gpl2+)))

(define-public r-spatstat-sparse
  (package
    (name "r-spatstat-sparse")
    (version "3.1-0")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "spatstat.sparse" version))
       (sha256
        (base32
         "1sdv9d3f5xc87qiwbfjikl12h2vkmdfq2faal5wbhfc3h72mvgk3"))))
    (properties
     `((upstream-name . "spatstat.sparse")))
    (build-system r-build-system)
    (propagated-inputs
     (list r-abind r-matrix r-spatstat-utils r-tensor))
    (home-page "https://spatstat.org/")
    (synopsis "Sparse three-dimensional arrays and linear algebra utilities")
    (description
     "This package defines sparse three-dimensional arrays and supports
standard operations on them.  The package also includes utility functions for
matrix calculations that are common in statistics, such as quadratic forms.")
    (license license:gpl2+)))

(define-public r-spatstat-data
  (package
    (name "r-spatstat-data")
    (version "3.1-6")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "spatstat.data" version))
       (sha256
        (base32
         "1pllf900yvdzjh8zy310apanp8pqzifxrxkb862fvk5x4xyf7c7z"))))
    (properties `((upstream-name . "spatstat.data")))
    (build-system r-build-system)
    (propagated-inputs
     (list r-matrix r-spatstat-utils))
    (home-page "https://www.spatstat.org")
    (synopsis "Datasets for spatstat")
    (description
     "This package contains all the datasets for the @code{spatstat}
package.")
    (license license:gpl2+)))

(define-public r-spatstat-geom
  (package
    (name "r-spatstat-geom")
    (version "3.4-1")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "spatstat.geom" version))
       (sha256
        (base32
         "18nr7zlad0gpnpzjfgd7wyvdbz1cxnwb4krml4vfjnr3qnn0zcq7"))))
    (properties `((upstream-name . "spatstat.geom")))
    (build-system r-build-system)
    (propagated-inputs
     (list r-deldir r-polyclip r-spatstat-data r-spatstat-univar
           r-spatstat-utils))
    (home-page "https://spatstat.org/")
    (synopsis "Geometrical functionality of the spatstat package")
    (description
     "This is a subset of the original spatstat package, containing the
user-level code from spatstat which performs geometrical operations, except
for the geometry of linear networks.")
    (license license:gpl2+)))

(define-public r-spatstat-core
  (package
    (name "r-spatstat-core")
    (version "2.4-4")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "spatstat.core" version))
       (sha256
        (base32
         "0fyi8y1z919nzn47kaviln7gflhcp5qdi3gfvf7nwkdix3pkk373"))))
    (properties `((upstream-name . "spatstat.core")))
    (build-system r-build-system)
    (propagated-inputs
     (list r-abind
           r-goftest
           r-matrix
           r-mgcv
           r-nlme
           r-rpart
           r-spatstat-data
           r-spatstat-geom
           r-spatstat-random
           r-spatstat-sparse
           r-spatstat-utils
           r-tensor))
    (native-inputs (list r-spatstat-model))
    (home-page "https://spatstat.org/")
    (synopsis "Core functionality of the spatstat package")
    (description
     "This is a subset of the original spatstat package, containing all of the
user-level code from spatstat, except for the code for linear networks.")
    (license license:gpl2+)))

(define-public r-spatstat-linnet
  (package
    (name "r-spatstat-linnet")
    (version "3.2-6")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "spatstat.linnet" version))
       (sha256
        (base32
         "1fihp6qrkiivhc9i2d7371dfgsdb08xy9y0g5lfm6pxifyqfqvw2"))))
    (properties
     `((upstream-name . "spatstat.linnet")))
    (build-system r-build-system)
    (propagated-inputs
     (list r-matrix
           r-spatstat-data
           r-spatstat-explore
           r-spatstat-geom
           r-spatstat-model
           r-spatstat-random
           r-spatstat-sparse
           r-spatstat-univar
           r-spatstat-utils))
    (home-page "https://spatstat.org/")
    (synopsis "Linear networks functionality of the spatstat package")
    (description
     "This is a subset of the spatstat package, containing its functionality
for spatial data on a linear network.")
    (license license:gpl2+)))

(define-public r-spatstat-random
  (package
    (name "r-spatstat-random")
    (version "3.4-1")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "spatstat.random" version))
       (sha256
        (base32 "0jswr6hvqv9k631xy37mf0ffizi9dv8f4p1g7favx8n2vliab9dz"))))
    (properties `((upstream-name . "spatstat.random")))
    (build-system r-build-system)
    (propagated-inputs (list r-spatstat-data r-spatstat-geom r-spatstat-univar
                             r-spatstat-utils))
    (home-page "https://spatstat.org/")
    (synopsis "Random Generation Functionality for the 'spatstat' Family")
    (description
     "This package provides functionality for random generation of spatial
data in the spatstat family of packages.  It generates random spatial patterns
of points according to many simple rules (complete spatial randomness,
Poisson, binomial, random grid, systematic, cell), randomised alteration of
patterns (thinning, random shift, jittering), simulated realisations of random
point processes (simple sequential inhibition, Matern inhibition models,
Matern cluster process, Neyman-Scott cluster processes, log-Gaussian Cox
processes, product shot noise cluster processes) and simulation of Gibbs point
processes (Metropolis-Hastings birth-death-shift algorithm, alternating Gibbs
sampler).")
    (license license:gpl2+)))

(define-public r-spatstat
  (package
    (name "r-spatstat")
    (version "3.3-3")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "spatstat" version))
       (sha256
        (base32
         "1sg09hdzr9a327d3nwsvbz35s3mcdxy6gxbchmwwzqs6yagb1gh6"))))
    (properties `((upstream-name . "spatstat")))
    (build-system r-build-system)
    (propagated-inputs
     (list r-spatstat-data
           r-spatstat-explore
           r-spatstat-geom
           r-spatstat-linnet
           r-spatstat-model
           r-spatstat-random
           r-spatstat-univar
           r-spatstat-utils))
    (native-inputs (list r-sf))
    (home-page "https://www.spatstat.org")
    (synopsis "Spatial Point Pattern analysis, model-fitting, simulation, tests")
    (description
     "This package provides a comprehensive toolbox for analysing Spatial
Point Patterns.  It is focused mainly on two-dimensional point patterns,
including multitype/marked points, in any spatial region.  It also supports
three-dimensional point patterns, space-time point patterns in any number of
dimensions, point patterns on a linear network, and patterns of other
geometrical objects.  It supports spatial covariate data such as pixel images
and contains over 2000 functions for plotting spatial data, exploratory data
analysis, model-fitting, simulation, spatial sampling, model diagnostics, and
formal inference.")
    (license license:gpl2+)))

(define-public r-gaston
  (package
    (name "r-gaston")
    (version "1.6")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "gaston" version))
       (sha256
        (base32
         "1knjyw2dsarljj2zsqp3hi6hk6m90sfqp2l535h3arj70l3rq9x4"))))
    (properties `((upstream-name . "gaston")))
    (build-system r-build-system)
    (inputs (list zlib))
    (propagated-inputs
     (list r-rcpp r-rcppeigen r-rcppparallel))
    (native-inputs (list r-knitr))
    (home-page "https://cran.r-project.org/web/packages/gaston/")
    (synopsis "Genetic data handling (QC, GRM, LD, PCA) and linear mixed models")
    (description
     "This is a package for the manipulation of genetic data (SNPs).
Computation of @dfn{genetic relationship matrix} (GRM) and dominance matrix,
@dfn{linkage disequilibrium} (LD), and heritability with efficient algorithms
for linear mixed models (AIREML).")
    (license license:gpl3)))

(define-public r-cpp11
  (package
    (name "r-cpp11")
    (version "0.5.2")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "cpp11" version))
       (sha256
        (base32
         "06q9mx12d7ppayxfa15sn63yfnhjwn2d1y8im3kq56srkmzw12hf"))))
    (properties
     `((upstream-name . "cpp11")
       (updater-ignored-native-inputs
        . ("r-decor" "r-rprogress" "r-std" "r-tibble" "r-writable"))))
    (build-system r-build-system)
    ;; Tests also require these packages: r-decor, r-tibble, and r-vctrs.
    (arguments (list #:tests? #false))
    (native-inputs (list r-desc
                         r-glue
                         r-knitr
                         r-mockery
                         r-testthat
                         r-withr))
    (home-page "https://github.com/r-lib/cpp11")
    (synopsis "C++11 Interface for R's C Interface")
    (description
     "This package provides a header only, C++11 interface to R's C interface.
Compared to other approaches @code{cpp11} strives to be safe against long
jumps from the C API as well as C++ exceptions, conform to normal R function
semantics and supports interaction with @code{ALTREP} vectors.")
    (license license:expat)))

(define-public r-rcpptoml
  (package
    (name "r-rcpptoml")
    (version "0.2.3")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "RcppTOML" version))
       (sha256
        (base32 "0vwjyn68cildb6rs21jjahg246znjw8pjzg6cmqfyasn7hjr9m9f"))))
    (properties `((upstream-name . "RcppTOML")))
    (build-system r-build-system)
    (propagated-inputs (list r-rcpp))
    (home-page "https://dirk.eddelbuettel.com/code/rcpp.toml.html")
    (synopsis "Rcpp bindings to TOML parser")
    (description
     "The TOML configuration format specifies an excellent format suitable for
both human editing as well as the common uses of a machine-readable format.
This package provides Rcpp bindings to a TOML parser.")
    (license license:gpl2+)))

(define-public r-rcppziggurat
  (package
    (name "r-rcppziggurat")
    (version "0.1.8")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "RcppZiggurat" version))
       (sha256
        (base32
         "041ynqr8hkr59is5az6i53pzcvp6y7vpcix4kw4jylq1x9s9rc1f"))))
    (properties `((upstream-name . "RcppZiggurat")))
    (build-system r-build-system)
    (propagated-inputs
     (list r-rcpp r-rcppgsl))
    (native-inputs (list pkg-config))
    (home-page "https://cran.r-project.org/web/packages/RcppZiggurat/")
    (synopsis "Rcpp integration of different \"Ziggurat\" normal RNG implementations")
    (description
     "The Ziggurat generator for normally distributed random numbers,
originally proposed by Marsaglia and Tsang (2000,
@url{https://doi.org/10.18637/jss.v005.i08}) has been improved upon a few
times starting with Leong et al (2005,
@url{https://doi.org/10.18637/jss.v012.i07}).  This package provides an
aggregation for comparing different implementations in order to provide a
'faster but good enough' alternative for use with R and C++ code.")
    (license license:gpl2+)))

(define-public r-rfast
  (package
    (name "r-rfast")
    (version "2.1.5.1")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "Rfast" version))
       (sha256
        (base32
         "1fhjvabxq1r9zbkch36f5x0xf844a1z8l9njvyac5i9bxlmj9fzi"))))
    (properties `((upstream-name . "Rfast")))
    (build-system r-build-system)
    (arguments
     `(#:phases
       (modify-phases %standard-phases
         (add-before 'install 'relax-gcc-14-strictness
           (lambda _
             (substitute* "src/Makevars"
               (("PKG_CXXFLAGS =" all)
                (string-append all " -Wno-error=changes-meaning"))))))))
    (propagated-inputs
     (list r-rcpp r-rcpparmadillo r-rcppparallel r-zigg))
    (home-page "https://github.com/RfastOfficial/Rfast")
    (synopsis "Collection of efficient and fast R functions")
    (description
     "This package provides a collection of fast (utility) functions for data
analysis.  Column- and row- wise means, medians, variances, minimums,
maximums, many t, F and G-square tests, many regressions (normal, logistic,
Poisson), are some of the many fast functions.")
    (license license:gpl2+)))

(define-public r-rferns
  (package
    (name "r-rferns")
    (version "5.0.0")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "rFerns" version))
       (sha256
        (base32 "1yw3np5iamnr7f3nrd507dkyz76nxmzdpinwxncv87yw30g6gnkq"))))
    (properties `((upstream-name . "rFerns")))
    (build-system r-build-system)
    (home-page "https://gitlab.com/mbq/rFerns")
    (synopsis "Random ferns classifier")
    (description
     "This package provides the random ferns classifier by Ozuysal, Calonder,
Lepetit and Fua (2009) <doi:10.1109/TPAMI.2009.23>, modified for generic and
multi-label classification and featuring OOB error approximation and
importance measure as introduced in Kursa (2014)
<doi:10.18637/jss.v061.i10>.")
    (license license:gpl2+)))

(define-public r-rffc
  (package
   (name "r-rffc")
   (version "1.0")
   (source (origin
            (method url-fetch)
            (uri (string-append
                  "https://download.r-forge.r-project.org/src/contrib/"
                  "rfFC_" version ".tar.gz"))
            (sha256
             (base32
              "05x9wgzsmx4vb12lmcspymgmpb2xw8bwryb8ysg7vzg2nkh0ma3g"))))
   (build-system r-build-system)
   (propagated-inputs
    (list r-randomforest))
   (home-page "https://r-forge.r-project.org/projects/rffc/")
   (synopsis "Random Forest Feature Contributions")
   (description "This package provides functions for extracting feature
contributions from a random forest model from package @code{randomForest}.
Feature contributions provide detailed information about the relationship
between data variables and the predicted value returned by random forest
model.")
   (license license:gpl2)))

(define-public r-clusterr
  (package
    (name "r-clusterr")
    (version "1.3.3")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "ClusterR" version))
       (sha256
        (base32
         "0vmj0q6sjh8adr22mhm6hyfnzsw09dk1qn75rz5i3mmhrd7y7mr6"))))
    (properties `((upstream-name . "ClusterR")))
    (build-system r-build-system)
    (propagated-inputs
     (list r-ggplot2
           r-gmp
           r-lifecycle
           r-rcpp
           r-rcpparmadillo))
    (native-inputs (list r-knitr r-testthat))
    (home-page "https://github.com/mlampros/ClusterR")
    (synopsis "Clustering")
    (description
     "This package provides Gaussian mixture models, k-means,
mini-batch-kmeans, k-medoids and affinity propagation clustering with the
option to plot, validate, predict (new data) and estimate the optimal number
of clusters.  The package takes advantage of @code{RcppArmadillo} to speed up
the computationally intensive parts of the functions.  For more information,
see

@enumerate
@item \"Clustering in an Object-Oriented Environment\" by Anja Struyf, Mia
  Hubert, Peter Rousseeuw (1997), Journal of Statistical Software,
  @url{https://doi.org/10.18637/jss.v001.i04};
@item \"Web-scale k-means clustering\" by D. Sculley (2010), ACM Digital
  Library, @url{https://doi.org/10.1145/1772690.1772862};
@item \"Armadillo: a template-based C++ library
  for linear algebra\" by Sanderson et al (2016), The Journal of Open Source
  Software, @url{https://doi.org/10.21105/joss.00026};
@item \"Clustering by Passing Messages Between Data Points\" by Brendan
  J. Frey and Delbert Dueck, Science 16 Feb 2007: Vol. 315, Issue 5814,
  pp. 972-976, @url{https://doi.org/10.1126/science.1136800}.
@end enumerate
")
    (license license:gpl3)))

(define-public r-spectrum
  (package
    (name "r-spectrum")
    (version "1.1")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "Spectrum" version))
       (sha256
        (base32
         "0n38d360azkck6vvhr771zsh0gbvd9qsf9ygg5r18vhz0pb1xcfw"))))
    (properties `((upstream-name . "Spectrum")))
    (build-system r-build-system)
    (propagated-inputs
     (list r-clusterr r-diptest r-ggplot2 r-rfast))
    (native-inputs (list r-knitr))
    (home-page "https://cran.r-project.org/web/packages/Spectrum/")
    (synopsis "Fast adaptive spectral clustering for single and multi-view data")
    (description
     "This package provides a self-tuning spectral clustering method for
single or multi-view data.  Spectrum uses a new type of adaptive density aware
kernel that strengthens connections in the graph based on common nearest
neighbours.  It uses a tensor product graph data integration and diffusion
procedure to integrate different data sources and reduce noise.  Spectrum uses
either the eigengap or multimodality gap heuristics to determine the number of
clusters.  The method is sufficiently flexible so that a wide range of
Gaussian and non-Gaussian structures can be clustered with automatic selection
of K.")
    (license license:agpl3+)))

(define-public r-nabor
  (package
    (name "r-nabor")
    (version "0.5.0")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "nabor" version))
       (sha256
        (base32
         "1nj39cdfwrmhgsi3cq8imxv3n6xzc1v6dzdb2cf2hybjk368v4s7"))))
    (properties `((upstream-name . "nabor")))
    (build-system r-build-system)
    (propagated-inputs
     (list r-bh r-rcpp r-rcppeigen))
    (native-inputs (list r-rann r-testthat))
    (home-page "https://cran.r-project.org/web/packages/nabor/")
    (synopsis "Wrapper for K nearest neighbour library for low dimensions")
    (description
     "This package provides an R wrapper for libnabo, an exact or approximate
k nearest neighbour library which is optimised for low dimensional
spaces (e.g. 3D).  @code{nabor} includes a @code{knn} function that is
designed as a drop-in replacement for the RANN function @code{nn2}.  In
addition, objects which include the k-d tree search structure can be returned
to speed up repeated queries of the same set of target points.")
    (license license:bsd-3)))

(define-public r-nada
  (package
    (name "r-nada")
    (version "1.6-1.1")
    (source (origin
              (method url-fetch)
              (uri (cran-uri "NADA" version))
              (sha256
               (base32
                "0jp4mqr77cx7q5lff84s6wb0dwjy9mi0jyhbjc5fsx50bdczc3v7"))))
    (properties `((upstream-name . "NADA")))
    (build-system r-build-system)
    (propagated-inputs (list r-survival))
    (home-page "https://cran.r-project.org/package=NADA")
    (synopsis "Nondetects and data analysis for environmental data")
    (description
     "This package contains methods described by Dennis Helsel in his
book @emph{Nondetects and Data Analysis: Statistics for Censored
Environmental Data}.")
    (license license:gpl2+)))

(define-public r-nanoarrow
  (package
    (name "r-nanoarrow")
    (version "0.6.0-1")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "nanoarrow" version))
       (sha256
        (base32 "01daqxjxvs7p0j8jr2g44crmkzinkisgwa0dr289c2smhqzk5nwm"))))
    (properties `((upstream-name . "nanoarrow")))
    (build-system r-build-system)
    (native-inputs (list r-arrow
                         r-bit64
                         r-blob
                         r-hms
                         r-jsonlite
                         r-testthat
                         r-tibble
                         r-vctrs
                         r-withr))
    (home-page "https://arrow.apache.org/nanoarrow/latest/r/")
    (synopsis "Interface to the nanoarrow C library")
    (description
     "This package provides an R interface to the @code{nanoarrow} C library
and the Apache Arrow application binary interface.  Functions to import and
export @code{ArrowArray}, @code{ArrowSchema}, and @code{ArrowArrayStream} C
structures to and from R objects are provided alongside helpers to facilitate
zero-copy data transfer among R bindings to libraries implementing the Arrow C
data interface.")
    (license license:asl2.0)))

(define-public r-nanotime
  (package
    (name "r-nanotime")
    (version "0.3.12")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "nanotime" version))
       (sha256
        (base32 "197bycqypzsdabqdyf47l8qap1nysvxf0zcyfbhx4sbzfxwiflgv"))))
    (properties
     `((upstream-name . "nanotime")
       (updater-extra-native-inputs . ("tzdata-for-tests"))))
    (build-system r-build-system)
    (propagated-inputs (list r-bit64 r-rcpp r-rcppcctz r-rcppdate r-zoo))
    (native-inputs (list r-tinytest tzdata-for-tests))
    (home-page "https://github.com/eddelbuettel/nanotime")
    (synopsis "Nanosecond-resolution time support for R")
    (description
     "Full 64-bit resolution date and time functionality with nanosecond
granularity is provided, with easy transition to and from the standard POSIXct
type.  Three additional classes offer interval, period and duration
functionality for nanosecond-resolution timestamps.")
    (license license:gpl2+)))

(define-public r-naturalsort
  (package
   (name "r-naturalsort")
   (version "0.1.3")
   (source (origin
            (method url-fetch)
            (uri (cran-uri "naturalsort" version))
            (sha256
             (base32
              "0mz801y9mzld9ypp3xmsjw2d8l9q97sdnv09wrci9xi3yg2sjf6d"))))
   (build-system r-build-system)
   (native-inputs (list r-testthat))
   (home-page "https://cran.r-project.org/web/packages/naturalsort/")
   (synopsis "Natural ordering")
   (description "This package provides functions related to human natural
ordering.  It handles adjacent digits in a character sequence as a number
so that natural sort function arranges a character vector by their numbers,
not digit characters.")
   (license license:bsd-3)))

(define-public r-visdat
  (package
    (name "r-visdat")
    (version "0.6.0")
    (source (origin
              (method url-fetch)
              (uri (cran-uri "visdat" version))
              (sha256
               (base32
                "1675az0lfvmwzh9c3fknnk0n2kz1w7hy0kdj3a37n5j1knxwsjhh"))))
    (properties
     '((updater-extra-native-inputs . ("r-vdiffr"))))
    (build-system r-build-system)
    (propagated-inputs
     (list r-cli
           r-dplyr
           r-forcats
           r-ggplot2
           r-glue
           r-magrittr
           r-purrr
           r-readr
           r-scales
           r-tibble
           r-tidyr))
    (native-inputs
     (list r-knitr r-testthat r-vdiffr))
    (home-page "https://visdat.njtierney.com/")
    (synopsis "Preliminary Visualisation of Data")
    (description "This package provides procedures to create preliminary exploratory
data visualisations of an entire dataset to identify problems or unexpected features
using @code{ggplot2}.")
    (license license:expat)))

(define-public r-visnetwork
  (package
    (name "r-visnetwork")
    (version "2.1.2")
    (source
      (origin
        (method url-fetch)
        (uri (cran-uri "visNetwork" version))
        (sha256
          (base32
            "116w3l65lgv18xzav5zz1pbgwpwck66n9cjpja9axrl9zi19vja7"))
        (snippet
         '(for-each delete-file
                    '("inst/htmlwidgets/lib/vis/vis-network.min.js"
                      "inst/htmlwidgets/lib/export/FileSaver/FileSaver.min.js"
                      "inst/common-docs-files/js/jquery.url.min.js")))))
    (properties `((upstream-name . "visNetwork")))
    (build-system r-build-system)
    (arguments
     (list
      ;; FIXME Test break because %>% is undefined, yet it is defined by
      ;; r-magrittr.
      #:tests? #false
      #:modules '((guix build utils)
                  (guix build r-build-system)
                  (srfi srfi-1))
      #:phases
      '(modify-phases %standard-phases
         (add-after 'unpack 'process-javascript
           (lambda* (#:key inputs #:allow-other-keys)
             ;; The inst directory contains some minified JavaScript
             ;; files.  Regenerate them from sources.
             (with-directory-excursion "inst/"
               (call-with-values
                   (lambda ()
                     (unzip2
                      `((,(search-input-file inputs "/FileSaver.js")
                         "htmlwidgets/lib/export/FileSaver/FileSaver.min.js")
                        (,(search-input-file inputs "/url.js")
                         "common-docs-files/js/jquery.url.min.js")
                        (,(assoc-ref inputs "vis-network.js")
                         "htmlwidgets/lib/vis/vis-network.min.js"))))
                 (lambda (sources targets)
                   (for-each (lambda (source target)
                               (format #true "Processing ~a --> ~a~%"
                                       source target)
                               (invoke "esbuild" source "--minify"
                                       (string-append "--outfile=" target)))
                             sources targets)))))))))
    (propagated-inputs
     (list r-htmltools
           r-htmlwidgets
           r-jsonlite
           r-magrittr))
    (native-inputs
     `(("r-knitr" ,r-knitr)
       ("esbuild" ,esbuild)
       ;; The included file has no version information but was created
       ;; at around the same time as version 9.1.0.
       ("vis-network.js"
        ,(origin
           (method url-fetch)
           (uri "https://unpkg.com/vis-network@9.1.0/dist/vis-network.js")
           (sha256
            (base32
             "0vh2zf221ildsr5ly9idxi3jpqx61j3phbz5kdd801i0crqk4yj0"))))
       ;; Version 1.2.0 is a few months more recent than what
       ;; visNetwork bundles.
       ("filesaver.js"
        ,(origin
           (method git-fetch)
           (uri (git-reference
                 (url "https://github.com/eligrey/FileSaver.js/")
                 (commit "1.2.0")))
           (file-name (git-file-name "FileSaver.js" "1.2.0"))
           (sha256
            (base32
             "07mw01056fk36pganhs27y8rl5y5hrdsm945pwbbvmdjnzq4ijny"))))
       ("jquery-url.js"
        ,(origin
           (method git-fetch)
           (uri (git-reference
                 (url "https://github.com/websanova/js-url/")
                 (commit "v1.8.6")))
           (file-name (git-file-name "js-url.js" "1.8.6"))
           (sha256
            (base32
             "0pxqjwqf9avd4d99csgny8xf5c65kyqjnm24pwm4ca1zghsl9wyr"))))))
    (home-page "https://datastorm-open.github.io/visNetwork/")
    (synopsis "Network Visualization using vis.js Library")
    (description
      "This package provides an R interface to the vis.js JavaScript charting
library.  It allows an interactive visualization of networks.")
    (license license:expat)))

(define-public r-muhaz
  (package
    (name "r-muhaz")
    (version "1.2.6.4")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "muhaz" version))
       (sha256
        (base32
         "1ddy8ayr4rdhzcipdvxdwd7z5g9hfp0ppacl7xf6f2612cn1185g"))))
    (properties `((upstream-name . "muhaz")))
    (build-system r-build-system)
    (propagated-inputs
     (list r-survival))
    (native-inputs
     (list gfortran))
    (home-page "https://cran.r-project.org/web/packages/muhaz/")
    (synopsis "Hazard function estimation in survival analysis")
    (description
     "This package produces a smooth estimate of the hazard function for
censored data.")
    ;; Any version of the GPL.
    (license license:gpl3+)))

(define-public r-flexsurv
  (package
    (name "r-flexsurv")
    (version "2.3.2")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "flexsurv" version))
       (sha256
        (base32
         "1171m8rx98bdkij0vp1w87msfjvbqsrh4jkzpm39yz0vg8charsv"))))
    (properties
     '((upstream-name . "flexsurv")
       (updater-extra-native-inputs . ("r-splines2"))))
    (build-system r-build-system)
    (propagated-inputs
     (list r-assertthat
           r-desolve
           r-dplyr
           r-generics
           r-ggplot2
           r-magrittr
           r-matrix
           r-mstate
           r-muhaz
           r-mvtnorm
           r-numderiv
           r-purrr
           r-quadprog
           r-rcpp
           r-rlang
           r-rstpm2
           r-statmod
           r-survival
           r-tibble
           r-tidyr
           r-tidyselect))
    (native-inputs
     (list r-broom r-covr r-knitr r-splines2 r-testthat))
    (home-page "https://github.com/chjackson/flexsurv-dev")
    (synopsis "Flexible parametric survival and multi-state models")
    (description
     "This package provides flexible parametric models for time-to-event data,
including the Royston-Parmar spline model, generalized gamma and generalized F
distributions.  Any user-defined parametric distribution can be fitted, given
at least an R function defining the probability density or hazard.  There are
also tools for fitting and predicting from fully parametric multi-state
models.")
    (license license:gpl2+)))

(define-public r-transphylo
  (package
    (name "r-transphylo")
    (version "1.4.5")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "TransPhylo" version))
       (sha256
        (base32
         "0g92kwi1nlmpc8m4pc9kv9xhczryr2kn9icfr3js7da7vy8g50xy"))))
    (properties
     '((upstream-name . "TransPhylo")
       (updater-extra-native-inputs . ("r-coda" "r-purrr"))))
    (build-system r-build-system)
    (propagated-inputs
     (list r-ape r-rcpp))
    (native-inputs
     (list r-coda r-knitr r-purrr r-testthat))
    (home-page "https://cran.r-project.org/web/packages/TransPhylo/")
    (synopsis "Inference of transmission tree from a dated phylogeny")
    (description
     "This is a package to infer transmission trees from a dated phylogeny.
It includes methods to simulate and analyze outbreaks.  The methodology is
described in @url{https://doi.org/10.1093/molbev/msu121,Didelot et al. (2014)}
and @url{https://doi.org/10.1093/molbev/msw275,Didelot et al. (2017)}.")
    (license license:gpl2+)))

(define-public r-km-ci
  (package
    (name "r-km-ci")
    (version "0.5-6")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "km.ci" version))
       (sha256
        (base32
         "18sc9vhbdgks8lhk2nfxkkayh8j4j227hl63fm5p04f7z4wm6wc1"))))
    (properties `((upstream-name . "km.ci")))
    (build-system r-build-system)
    (propagated-inputs
     (list r-survival))
    (home-page "https://cran.r-project.org/web/packages/km.ci/")
    (synopsis "Confidence intervals for the Kaplan-Meier estimator")
    (description
     "This package computes various @dfn{confidence intervals} (CI) for the
Kaplan-Meier estimator, namely: Petos CI, Rothman CI, CIs based on Greenwoods
variance, Thomas and Grunkemeier CI and the simultaneous confidence bands by
Nair and Hall and Wellner.")
    (license license:gpl2+)))

(define-public r-kmsurv
  (package
    (name "r-kmsurv")
    (version "0.1-6")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "KMsurv" version))
       (sha256
        (base32
         "0cigcn8lzbg8pvkyb7viid7p0ia3k4hwygiiv9x2f9sb04m6zv22"))))
    (properties `((upstream-name . "KMsurv")))
    (build-system r-build-system)
    (home-page "https://cran.r-project.org/web/packages/KMsurv/")
    (synopsis "Data sets from Klein and Moeschberger (1997), Survival Analysis")
    (description
     "This package provides data sets and functions for Klein and Moeschberger
(1997), \"Survival Analysis, Techniques for Censored and Truncated Data\",
Springer.")
    (license license:gpl3+)))

(define-public r-survmisc
  (package
    (name "r-survmisc")
    (version "0.5.6")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "survMisc" version))
       (sha256
        (base32
         "014cf7sfndmib9jmj0p3h67sr750k2pvw7m865zwdpvlqddi44fr"))))
    (properties `((upstream-name . "survMisc")))
    (build-system r-build-system)
    (propagated-inputs
     (list r-data-table
           r-ggplot2
           r-gridextra
           r-km-ci
           r-kmsurv
           r-knitr
           r-survival
           r-xtable
           r-zoo))
    (native-inputs
     (list r-knitr))
    (home-page "https://cran.r-project.org/web/packages/survMisc/")
    (synopsis "Miscellaneous functions for survival data")
    (description
     "This package provides a collection of functions to help in the analysis
of right-censored survival data.  These extend the methods available in
the @code{survival} package.")
    (license license:gpl2)))

(define-public r-exactranktests
  (package
    (name "r-exactranktests")
    (version "0.8-35")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "exactRankTests" version))
       (sha256
        (base32
         "1qv9i57chhz8xiv0j8r47rbigyqs72fa7ssz99inyc0s8gzskd3y"))))
    (properties
     `((upstream-name . "exactRankTests")))
    (build-system r-build-system)
    (home-page "https://cran.r-project.org/web/packages/exactRankTests/")
    (synopsis "Exact distributions for rank and permutation tests")
    (description
     "This package computes exact conditional p-values and quantiles using an
implementation of the Shift-Algorithm by Streitberg & Roehmel.")
    (license license:gpl2+)))

(define-public r-maxstat
  (package
    (name "r-maxstat")
    (version "0.7-26")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "maxstat" version))
       (sha256
        (base32
         "02wbq8gkiw0jb5d86v9zsjh506mszbh20ycm7fds1v730fxw4n74"))))
    (properties `((upstream-name . "maxstat")))
    (build-system r-build-system)
    (propagated-inputs
     (list r-exactranktests r-mvtnorm))
    (native-inputs (list r-survival))
    (home-page "https://cran.r-project.org/web/packages/maxstat/")
    (synopsis "Maximally selected rank statistics")
    (description
     "This package provides maximally selected rank statistics with several
p-value approximations.")
    (license license:gpl2+)))

(define-public r-survminer
  (package
    (name "r-survminer")
    (version "0.5.0")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "survminer" version))
       (sha256
        (base32
         "12zmjd42w3ay2hf7dmdlpc10gan2adgz64jm5cg9prxw3ryi3iyj"))))
    (properties `((upstream-name . "survminer")))
    (build-system r-build-system)
    (propagated-inputs
     (list r-broom
           r-dplyr
           r-ggplot2
           r-ggpubr
           r-ggtext
           r-gridextra
           r-magrittr
           r-maxstat
           r-purrr
           r-rlang
           r-scales
           r-survival
           r-survmisc
           r-tibble
           r-tidyr))
    (native-inputs
     (list r-knitr r-testthat))
    (home-page "https://rpkgs.datanovia.com/survminer/index.html")
    (synopsis "Drawing survival curves using ggplot2")
    (description
     "This package contains the function @code{ggsurvplot()} for easily
drawing beautiful and 'ready-to-publish' survival curves with the 'number at
risk' table and 'censoring count plot'.  Other functions are also available to
plot adjusted curves for Cox model and to visually examine Cox model
assumptions.")
    (license license:gpl2)))

(define-public r-forge
  (package
    (name "r-forge")
    (version "0.2.0")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "forge" version))
       (sha256
        (base32
         "0pjfzsc35agkh0zfw2czwajkbsyn6liys5irl5bhz5r1vim3jmwa"))))
    (properties `((upstream-name . "forge")))
    (build-system r-build-system)
    (propagated-inputs
     (list r-magrittr r-rlang))
    (native-inputs (list r-testthat))
    (home-page "https://cran.r-project.org/web/packages/forge/")
    (synopsis "Cast values into shape")
    (description
     "This package provides helper functions with a consistent interface to
coerce and verify the types and shapes of values for input checking.")
    (license license:asl2.0)))

(define-public r-config
  (package
    (name "r-config")
    (version "0.3.2")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "config" version))
       (sha256
        (base32
         "0r8hjg7jrhr9lncb82xmq2slygv3slacd2w8ds6shnvdp3122p3v"))))
    (properties `((upstream-name . "config")))
    (build-system r-build-system)
    (propagated-inputs
     (list r-yaml))
    (native-inputs
     (list r-knitr r-testthat))
    (home-page "https://github.com/rstudio/config")
    (synopsis "Manage environment specific configuration values")
    (description
     "This package lets you manage configuration values across multiple
environments (e.g.  development, test, production).  It reads values using a
function that determines the current environment and returns the appropriate
value.")
    (license license:gpl3)))

(define-public r-confintr
  (package
    (name "r-confintr")
    (version "1.0.2")
    (source (origin
              (method url-fetch)
              (uri (cran-uri "confintr" version))
              (sha256
               (base32
                "0gi9cnk2cd67vmywrkb19g6f9gr8k999kg0k03khad7lgqp4l43s"))))
    (properties `((upstream-name . "confintr")))
    (build-system r-build-system)
    (propagated-inputs (list r-boot))
    (native-inputs (list r-knitr r-testthat))
    (home-page "https://github.com/mayer79/confintr")
    (synopsis "Confidence intervals")
    (description
     "This package calculates classic and/or bootstrap confidence intervals
for many parameters such as the population mean, variance, @dfn{interquartile
range} (IQR), @dfn{median absolute deviation} (MAD), skewness, kurtosis,
Cramer's V, odds ratio, R-squared, quantiles (including median), proportions,
different types of correlation measures, difference in means, quantiles and
medians.  Many of the classic confidence intervals are described in Smithson,
M. (2003, ISBN: 978-0761924999).  Bootstrap confidence intervals are
calculated with the R package @code{boot}.  Both one- and two-sided intervals
are supported.")
    (license license:gpl2+)))

(define-public r-adaptivesparsity
  (package
    (name "r-adaptivesparsity")
    (version "1.6")
    (source (origin
              (method url-fetch)
              (uri (cran-uri "AdaptiveSparsity" version))
              (sha256
               (base32
                "0imr5m8mll9j6n4icsv6z9rl5kbnwsp9wvzrg7n90nnmcxq2cz91"))))
    (properties
     `((upstream-name . "AdaptiveSparsity")))
    (build-system r-build-system)
    (arguments
     `(#:phases
       (modify-phases %standard-phases
         (add-after 'unpack 'link-against-armadillo
           (lambda _
             (substitute* "src/Makevars"
               (("PKG_LIBS=" prefix)
                (string-append prefix "-larmadillo")))
             #t)))))
    (propagated-inputs
     (list r-mass r-matrix r-rcpp r-rcpparmadillo))
    (inputs
     (list armadillo))
    (home-page "https://cran.r-project.org/web/packages/AdaptiveSparsity")
    (synopsis "Adaptive sparsity models")
    (description
     "This package implements the Figueiredo machine learning algorithm for
adaptive sparsity and the Wong algorithm for adaptively sparse Gaussian
geometric models.")
    (license license:lgpl3+)))

(define-public r-add2ggplot
  (package
    (name "r-add2ggplot")
    (version "0.3.0")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "add2ggplot" version))
       (sha256
        (base32 "0c94i1cfp2pvplvxmfvvz2fyj026r1jnax05mrzrc7ppnqzy25y0"))))
    (properties `((upstream-name . "add2ggplot")))
    (build-system r-build-system)
    (propagated-inputs
     (list r-ggplot2 r-magick r-magrittr r-rcolorbrewer r-zeallot))
    (native-inputs (list r-knitr))
    (home-page "https://github.com/JiaxiangBU/add2ggplot")
    (synopsis "Extension for ggplot2")
    (description "This package provides tools to create themes and color
palettes for the package ggplot2.")
    (license license:expat)))

(define-public r-diffusionmap
  (package
    (name "r-diffusionmap")
    (version "1.2.0")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "diffusionMap" version))
       (sha256
        (base32
         "1rvk7069brlm1s9kqj4c31mwwr3mw4hmhay95cjjjfmw5xclff2j"))))
    (properties `((upstream-name . "diffusionMap")))
    (build-system r-build-system)
    (propagated-inputs
     (list r-igraph r-matrix r-scatterplot3d))
    (home-page "https://www.r-project.org")
    (synopsis "Diffusion map")
    (description "This package implements the diffusion map method of data
parametrization, including creation and visualization of diffusion maps,
clustering with diffusion K-means and regression using the adaptive regression
model.")
    (license license:gpl2)))

(define-public r-igraph
  (package
    (name "r-igraph")
    (version "2.1.4")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "igraph" version))
       (sha256
        (base32
         "1vdkg9d7h0qs6agrxdpma3z7xjgx74369gaw3bymbqyjr41d9kpx"))))
    (properties
     `((upstream-name . "igraph")
       (updater-extra-native-inputs . ("which"))
       (updater-ignored-native-inputs . ("r-graph"))))
    (build-system r-build-system)
    (native-inputs
     (list gfortran
           pkg-config
           r-callr
           r-digest
           r-knitr
           r-testthat
           r-vdiffr
           r-withr
           which))
    (inputs
     (list glpk libxml2 zlib))
    (propagated-inputs
     (list r-cli
           r-cpp11
           r-lifecycle
           r-magrittr
           r-matrix
           r-pkgconfig
           r-rlang
           r-vctrs))
    (home-page "https://igraph.org")
    (synopsis "Network analysis and visualization")
    (description
     "This package provides routines for simple graphs and network analysis.
It can handle large graphs very well and provides functions for generating
random and regular graphs, graph visualization, centrality methods and much
more.")
    (license license:gpl2+)))

(define-public r-workflows
  (package
    (name "r-workflows")
    (version "1.2.0")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "workflows" version))
       (sha256
        (base32
         "0bf1qx3xdpf5bvdjc4zz2ybb42jz2dzwvidb8b5gjrybkaqdrs67"))))
    (properties
     '((upstream-name . "workflows")
       (updater-extra-native-inputs . ("r-dials"))))
    (build-system r-build-system)
    (propagated-inputs
     (list r-cli
           r-generics
           r-glue
           r-hardhat
           r-lifecycle
           r-modelenv
           r-parsnip
           r-recipes
           r-rlang
           r-sparsevctrs
           r-tidyselect
           r-vctrs
           r-withr))
    (native-inputs
     (list r-butcher
           r-dials
           r-dials
           r-knitr
           r-matrix
           r-modeldata
           r-testthat))
    (home-page "https://github.com/tidymodels/workflows")
    (synopsis "Modeling workflows")
    (description
     "A workflow is an object that can bundle together your pre-processing,
modeling, and post-processing requests.  For example, if you have a
@code{recipe} and @code{parsnip} model, these can be combined into a
workflow.  The advantages are:

@enumerate
@item You don’t have to keep track of separate objects in your workspace.
@item The recipe prepping and model fitting can be executed using a single
  call to @code{fit()}.
@item If you have custom tuning parameter settings, these can be defined using
  a simpler interface when combined with @code{tune}.
@item In the future, workflows will be able to add post-processing operations,
  such as modifying the probability cutoff for two-class models.
@end enumerate
")
    (license license:expat)))

(define-public r-lobstr
  (package
    (name "r-lobstr")
    (version "1.1.2")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "lobstr" version))
       (sha256
        (base32
         "060p7b7i2qx09d7nf0kdl85r9j886fivrkrsl2bn10cggvnk7icv"))))
    (properties `((upstream-name . "lobstr")))
    (build-system r-build-system)
    (propagated-inputs
     (list r-cpp11
           r-crayon
           r-prettyunits
           r-rlang))
    (native-inputs (list r-testthat))
    (home-page "https://github.com/r-lib/lobstr")
    (synopsis "Visualize R data structures with trees")
    (description
     "This package provides a set of tools for inspecting and understanding R
data structures inspired by @code{str}.  It includes @code{ast} for
visualizing abstract syntax trees, @code{ref} for showing shared references,
@code{cst} for showing call stack trees, and @code{obj_size} for computing
object sizes.")
    (license license:gpl3)))

(define-public r-gpfit
  (package
    (name "r-gpfit")
    (version "1.0-9")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "GPfit" version))
       (sha256
        (base32
         "0g38llkzyg6dv1mnq39c0ifb6hkrfwphrbgydlrqkqxy212701v3"))))
    (properties `((upstream-name . "GPfit")))
    (build-system r-build-system)
    (propagated-inputs
     (list r-lattice r-lhs))
    (native-inputs (list r-testthat))
    (home-page "https://cran.r-project.org/web/packages/GPfit/")
    (synopsis "Gaussian Processes modeling")
    (description
     "This package provides a computationally stable approach of fitting a
@dfn{Gaussian Process} (GP) model to a deterministic simulator.")
    (license license:gpl2)))

(define-public r-yardstick
  (package
    (name "r-yardstick")
    (version "1.3.2")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "yardstick" version))
       (sha256
        (base32
         "0h7rq12v3vgwqhdy2qrq7bany4gfj1cajv6xqw631lw1qchgf80i"))))
    (properties `((upstream-name . "yardstick")))
    (build-system r-build-system)
    (propagated-inputs
     (list r-cli
           r-dplyr
           r-generics
           r-hardhat
           r-lifecycle
           r-rlang
           r-tibble
           r-tidyselect
           r-vctrs
           r-withr))
    (native-inputs
     (list r-caret
           r-devtools
           r-e1071
           r-ggplot2
           r-knitr
           r-mlmetrics
           r-proc
           r-reticulate
           r-survival
           r-testthat
           r-tidyr))
    (home-page "https://github.com/tidymodels/yardstick")
    (synopsis "Tidy characterizations of model performance")
    (description
     "This package provides tidy tools for quantifying how well a model fits
to a data set such as confusion matrices, class probability curve summaries,
and regression metrics (e.g., RMSE).")
    (license license:gpl2)))

(define-public r-warp
  (package
    (name "r-warp")
    (version "0.2.1")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "warp" version))
       (sha256
        (base32
         "1gj65kgs7x63f6y2vnv13k293b52k4afbmdlcam635h9vs8da2h2"))))
    (properties `((upstream-name . "warp")))
    (build-system r-build-system)
    (native-inputs (list r-knitr r-testthat tzdata-for-tests))
    (home-page "https://github.com/DavisVaughan/warp")
    (synopsis "Group dates")
    (description
     "This package provides tooling to group dates by a variety of periods
including: yearly, monthly, by second, by week of the month, and more.  The
groups are defined in such a way that they also represent the distance between
dates in terms of the period.  This extracts valuable information that can be
used in further calculations that rely on a specific temporal spacing between
observations.")
    (license license:expat)))

(define-public r-scico
  (package
    (name "r-scico")
    (version "1.5.0")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "scico" version))
       (sha256
        (base32 "1c6905y62s03kiah8ykhkag275pn06ihk5szldib2621ysrj2wb4"))))
    (properties `((upstream-name . "scico")))
    (build-system r-build-system)
    (propagated-inputs (list r-scales))
    (native-inputs (list r-dplyr r-ggplot2 r-testthat))
    (home-page "https://github.com/thomasp85/scico")
    (synopsis "Colour Palettes Based on the Scientific Colour-Maps")
    (description
     "This package provides colour choice in information visualisation.  It
important in order to avoid being mislead by inherent bias in the used colour
palette.  This package provides access to the perceptually uniform and
colour-blindness friendly palettes developed by Fabio Crameri and released
under the \"Scientific Colour-Maps\" moniker.  The package contains 24
different palettes and includes both diverging and sequential types.")
    (license license:expat)))

(define-public r-slider
  (package
    (name "r-slider")
    (version "0.3.2")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "slider" version))
       (sha256
        (base32
         "069nvjcmhsk8y7nfgx0ln5rab3r73q61cpvrqm9m0iv4z6rlsc69"))))
    (properties
     '((upstream-name . "slider")
       (updater-extra-native-inputs . ("r-lubridate" "tzdata-for-tests"))))
    (build-system r-build-system)
    (propagated-inputs
     (list r-cli r-rlang r-vctrs r-warp))
    (native-inputs (list r-knitr r-lubridate r-testthat tzdata-for-tests))
    (home-page "https://github.com/DavisVaughan/slider")
    (synopsis "Sliding window functions")
    (description
     "This package provides type-stable rolling window functions over any R
data type.  Cumulative and expanding windows are also supported.  For more
advanced usage, an index can be used as a secondary vector that defines how
sliding windows are to be created.")
    (license license:expat)))

(define-public r-rlist
  (package
    (name "r-rlist")
    (version "0.4.6.2")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "rlist" version))
       (sha256
        (base32 "15q99rhbbjq8zd976yjmfnny45dd5fg2p2dv1sljg2kwi66nbppb"))))
    (properties `((upstream-name . "rlist")))
    (build-system r-build-system)
    (propagated-inputs (list r-data-table r-jsonlite r-xml r-yaml))
    (native-inputs (list r-testthat))
    (home-page "https://renkun-ken.github.io/rlist/")
    (synopsis "Toolbox for Non-Tabular Data Manipulation")
    (description
     "This package provides a set of functions for data manipulation with
list objects, including mapping, filtering, grouping, sorting, updating,
searching, and other useful functions.  Most functions are designed to be
pipeline friendly so that data processing with lists can be chained.")
    (license license:expat)))

(define-public r-rsample
  (package
    (name "r-rsample")
    (version "1.3.0")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "rsample" version))
       (sha256
        (base32
         "14f9m82c0j3r3z0wdk4jialfi4khnpznhfxca4cj64qgj5wxzx7k"))))
    (properties `((upstream-name . "rsample")))
    (build-system r-build-system)
    (propagated-inputs
     (list r-cli
           r-dplyr
           r-furrr
           r-generics
           r-glue
           r-lifecycle
           r-pillar
           r-purrr
           r-rlang
           r-slider
           r-tibble
           r-tidyr
           r-tidyselect
           r-vctrs))
    (native-inputs
     (list r-broom r-knitr r-modeldata r-testthat r-withr))
    (home-page "https://rsample.tidymodels.org")
    (synopsis "General resampling infrastructure")
    (description
     "This package provides classes and functions to create and summarize
different types of resampling objects (e.g. bootstrap, cross-validation).")
    (license license:gpl2)))

(define-public r-dicedesign
  (package
    (name "r-dicedesign")
    (version "1.10")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "DiceDesign" version))
       (sha256
        (base32
         "0gf76f4jy8lbmw045q3ncs4ly07clh6gdfbmlnyk45wcgch3nm06"))))
    (properties `((upstream-name . "DiceDesign")))
    (build-system r-build-system)
    (home-page "http://dice.emse.fr/")
    (synopsis "Designs of computer experiments")
    (description
     "This package provides tools to create some specific @code{Space-Filling
Design} (SFD) and to test their quality.")
    (license license:gpl3)))

(define-public r-dicekriging
  (package
    (name "r-dicekriging")
    (version "1.6.0")
    (source (origin
              (method url-fetch)
              (uri (cran-uri "DiceKriging" version))
              (sha256
               (base32
                "0jfb2li6b93fkwgjkr4jwxnvv7zb0aqk9lkf2mnv2awzh0r16pdb"))))
    (properties `((upstream-name . "DiceKriging")))
    (build-system r-build-system)
    (native-inputs (list r-numderiv r-testthat))
    (home-page "https://dicekrigingclub.github.io/www/")
    (synopsis "Kriging methods for computer experiments")
    (description "This is a package for the estimation, validation and
prediction of kriging models.")
    (license license:gpl2+)))

(define-public r-dials
  (package
    (name "r-dials")
    (version "1.4.0")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "dials" version))
       (sha256
        (base32
         "0klkk0jydm2q1l77k4ilvn2n984a6vnaz62r8dn9vkppmg64mw73"))))
    (properties `((upstream-name . "dials")))
    (build-system r-build-system)
    (propagated-inputs
     (list r-cli
           r-dicedesign
           r-dplyr
           r-glue
           r-hardhat
           r-lifecycle
           r-pillar
           r-purrr
           r-rlang
           r-scales
           r-sfd
           r-tibble
           r-vctrs
           r-withr))
    (native-inputs (list r-knitr r-testthat))
    (home-page "https://dials.tidymodels.org/")
    (synopsis "Tools for creating tuning parameter values")
    (description
     "Many models contain tuning parameters (i.e. parameters that cannot be
directly estimated from the data).  These tools can be used to define objects
for creating, simulating, or validating values for such parameters.")
    (license license:gpl2)))

(define-public r-tune
  (package
    (name "r-tune")
    (version "1.3.0")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "tune" version))
       (sha256
        (base32
         "11qq1i2bacls43lmq5m9dp96sb2dwzfdl3ih6909rbbazrdfq4qi"))))
    (properties
     '((upstream-name . "tune")
       (updater-ignored-native-inputs . ("r-censored"))))
    (build-system r-build-system)
    (propagated-inputs
     (list r-cli
           r-dials
           r-dofuture
           r-dplyr
           r-foreach
           r-future
           r-generics
           r-ggplot2
           r-glue
           r-gpfit
           r-hardhat
           r-lifecycle
           r-parsnip
           r-purrr
           r-recipes
           r-rlang
           r-rsample
           r-tibble
           r-tidyr
           r-tidyselect
           r-vctrs
           r-withr
           r-workflows
           r-yardstick))
    (native-inputs (list r-modeldata r-spelling r-testthat))
    (home-page "https://github.com/tidymodels/tune")
    (synopsis "Tidy tuning tools")
    (description
     "The ability to tune models is important.  @code{tune} contains functions
and classes to be used in conjunction with other @code{tidymodels} packages
for finding reasonable values of hyper-parameters in models, pre-processing
methods, and post-processing steps.")
    (license license:expat)))

(define-public r-workflowsets
  (package
    (name "r-workflowsets")
    (version "1.1.1")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "workflowsets" version))
       (sha256
        (base32
         "1dimx66h4qg7v20cqq35g6c0s7d8zpzc9ajws6rs1ax0vj5i63yv"))))
    (properties `((upstream-name . "workflowsets")))
    (build-system r-build-system)
    (propagated-inputs
     (list r-cli
           r-dplyr
           r-generics
           r-ggplot2
           r-hardhat
           r-lifecycle
           r-parsnip
           r-pillar
           r-prettyunits
           r-purrr
           r-rlang
           r-rsample
           r-tibble
           r-tidyr
           r-tune
           r-vctrs
           r-withr
           r-workflows))
    (native-inputs
     (list r-dials
           r-kknn
           r-knitr
           r-modeldata
           r-recipes
           r-spelling
           r-testthat
           r-tidyclust
           r-yardstick))
    (home-page "https://github.com/tidymodels/workflowsets")
    (synopsis "Create a collection of tidymodels workflows")
    (description
     "A workflow is a combination of a model and preprocessors (e.g, a
formula, recipe, etc.).  In order to try different combinations of these, an
object can be created that contains many workflows.  There are functions to
create workflows en masse as well as training them and visualizing the
results.")
    (license license:expat)))

(define-public r-tidyposterior
  (package
    (name "r-tidyposterior")
    (version "1.0.1")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "tidyposterior" version))
       (sha256
        (base32
         "1yi0pihglp683dmfg0bn9lnb0qsl2xprj3al65v642rcfzrr7h4h"))))
    (properties `((upstream-name . "tidyposterior")))
    (build-system r-build-system)
    (propagated-inputs
     (list r-dplyr
           r-generics
           r-ggplot2
           r-purrr
           r-rlang
           r-rsample
           r-rstanarm
           r-tibble
           r-tidyr
           r-tune
           r-vctrs
           r-workflowsets))
    (native-inputs
     (list r-knitr r-testthat))
    (home-page "https://tidyposterior.tidymodels.org")
    (synopsis "Bayesian analysis to compare models using resampling statistics")
    (description
     "This package can be used to conduct post hoc analyses of resampling
results generated by models.  For example, if two models are evaluated with
the @dfn{root mean squared error} (RMSE) using 10-fold cross-validation, there
are 10 paired statistics.  These can be used to make comparisons between
models without involving a test set.")
    (license license:gpl2)))

(define-public r-tidypredict
  (package
    (name "r-tidypredict")
    (version "0.5.1")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "tidypredict" version))
       (sha256
        (base32
         "0c33g58glc4j781fbvykgw3qbxlf5wc8x6gijqfcnyk42qkz9iib"))))
    (properties
     '((upstream-name . "tidypredict")
       (updater-extra-native-inputs . ("r-mlbench"))))
    (build-system r-build-system)
    (propagated-inputs
     (list r-cli
           r-dplyr
           r-generics
           r-knitr
           r-purrr
           r-rlang
           r-tibble
           r-tidyr))
    (native-inputs
     (list r-cubist
           r-dbplyr
           r-earth
           r-knitr
           r-mlbench
           r-parsnip
           r-partykit
           r-randomforest
           r-ranger
           r-testthat
           r-xgboost
           r-yaml))
    (home-page "https://tidypredict.tidymodels.org")
    (synopsis "Run predictions inside the database")
    (description
     "This package parses a fitted R model object, and returns a formula in
Tidy Eval code that calculates the predictions.  It works with several
database backends because it leverages @code{dplyr} and @code{dbplyr} for the
final SQL translation of the algorithm.  It currently supports @code{lm()},
@code{glm()}, @code{randomForest()}, @code{ranger()}, @code{earth()},
@code{xgb.Booster.complete()}, @code{cubist()}, and @code{ctree()} models.")
    (license license:gpl3)))

(define-public r-janeaustenr
  (package
    (name "r-janeaustenr")
    (version "1.0.0")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "janeaustenr" version))
       (sha256
        (base32
         "1ap8p1lpbj2wz90mpf1vbyzhv2spzv03bi8lwzpsir2y77hjxhxl"))))
    (properties `((upstream-name . "janeaustenr")))
    (build-system r-build-system)
    (native-inputs (list r-testthat))
    (home-page "https://github.com/juliasilge/janeaustenr")
    (synopsis "Jane Austen's complete novels")
    (description
     "This package provides the full texts for Jane Austen's six completed
novels, ready for text analysis.  These novels are \"Sense and Sensibility\",
\"Pride and Prejudice\", \"Mansfield Park\", \"Emma\", \"Northanger Abbey\",
and \"Persuasion\".")
    (license license:expat)))

(define-public r-janitor
  (package
    (name "r-janitor")
    (version "2.2.1")
    (source (origin
              (method url-fetch)
              (uri (cran-uri "janitor" version))
              (sha256
               (base32
                "1pvcmqlkdlain7zf10i2hwq7kg1l703m2sp6d27gxjk258q03i17"))))
    (properties
     '((upstream-name . "janitor")
       (updater-extra-native-inputs . ("tzdata-for-tests"))))
    (build-system r-build-system)
    (arguments
     (list
      #:phases
      '(modify-phases %standard-phases
         (add-after 'unpack 'delete-bad-tests
           (lambda _
             ;; Fails because of unexpected warnings.
             (delete-file "tests/testthat/test-compare_df_cols.R")))
         (add-before 'check 'set-timezone
           (lambda* (#:key inputs #:allow-other-keys)
             ;; Six tests would fail without this.
             (setenv "TZ" "UTC")
             (setenv "TZDIR"
                     (search-input-directory inputs
                                             "share/zoneinfo")))))))
    (propagated-inputs
     (list r-dplyr
           r-hms
           r-lifecycle
           r-lubridate
           r-magrittr
           r-purrr
           r-rlang
           r-snakecase
           r-stringi
           r-stringr
           r-tidyr
           r-tidyselect))
    (native-inputs (list r-dbplyr
                         r-forcats
                         r-knitr
                         r-sf
                         r-testthat
                         r-tibble
                         r-tidygraph
                         tzdata-for-tests))
    (home-page "https://github.com/sfirke/janitor")
    (synopsis "Simple tools for examining and cleaning dirty data")
    (description
     "The main janitor functions can: perfectly format @code{data.frame column}
names; provide quick counts of variable combinations (i.e., frequency tables
and crosstabs); and isolate duplicate records.  Other janitor functions nicely
format the tabulation results.  These tabulate-and-report functions
approximate popular features of SPSS and Excel.  This package follows the
principles of the \"tidyverse\" and works well with the pipe function
@code{%>%}.  janitor was built with beginning-to-intermediate R users in mind
and is optimized for user-friendliness.  Advanced R users can already do
everything covered here, but with janitor they can do it faster and save their
thinking for the fun stuff.")
    (license license:expat)))

(define-public r-tokenizers
  (package
    (name "r-tokenizers")
    (version "0.3.0")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "tokenizers" version))
       (sha256
        (base32
         "0a8wm4cff3hrll991h2rimw79kpf2jsn78y7yksdk8m18931wmr4"))))
    (properties `((upstream-name . "tokenizers")))
    (build-system r-build-system)
    (propagated-inputs
     (list r-rcpp r-snowballc r-stringi))
    (native-inputs
     (list r-knitr r-testthat))
    (home-page "https://lincolnmullen.com/software/tokenizers/")
    (synopsis "Fast, consistent tokenization of natural language text")
    (description
     "This is a package for converting natural language text into tokens.
It includes tokenizers for shingled n-grams, skip n-grams, words, word stems,
sentences, paragraphs, characters, shingled characters, lines, tweets, Penn
Treebank, regular expressions, as well as functions for counting characters,
words, and sentences, and a function for splitting longer texts into separate
documents, each with the same number of words.  The tokenizers have a
consistent interface, and the package is built on the @code{stringi} and
@code{Rcpp} packages for fast yet correct tokenization in UTF-8 encoding.")
    (license license:expat)))

(define-public r-hunspell
  (package
    (name "r-hunspell")
    (version "3.0.6")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "hunspell" version))
       (sha256
        (base32
         "0dbmg015m7ab17s7dqlw8d0pj7xkqk6fr8ggaan1w22fxwpdy8s0"))))
    (properties
     '((upstream-name . "hunspell")
       ;; Avoid dependency cycle.
       (updater-ignored-native-inputs . ("r-spelling"))))
    (build-system r-build-system)
    (propagated-inputs
     (list r-digest r-rcpp))
    (native-inputs
     (list r-knitr r-testthat))
    (home-page "https://github.com/ropensci/hunspell#readme")
    (synopsis "High-performance stemmer, tokenizer, and spell checker")
    (description
     "This package provides a low-level spell checker and morphological
analyzer based on the famous @code{hunspell} library.  The package can analyze
or check individual words as well as parse text, LaTeX, HTML or XML documents.
For a more user-friendly interface use the @code{spelling} package which
builds on this package to automate checking of files, documentation and
vignettes in all common formats.")
    ;; The hunspell library itself is available under one of GPL2, LGPL2.1, or
    ;; MPL; in addition to these licenses the rest of the R wrapper is also
    ;; available under the Expat license.
    (license (list license:gpl2
                   license:lgpl2.1
                   license:mpl1.1
                   license:expat))))

(define-public r-tidytext
  (package
    (name "r-tidytext")
    (version "0.4.2")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "tidytext" version))
       (sha256
        (base32
         "0m1dxlrmkany4pjbr2p2m9hzn59gldmznyvs6dcb3zdr5861ix0c"))))
    (properties `((upstream-name . "tidytext")))
    (build-system r-build-system)
    (propagated-inputs
     (list r-cli
           r-dplyr
           r-generics
           r-janeaustenr
           r-lifecycle
           r-matrix
           r-purrr
           r-rlang
           r-stringr
           r-tibble
           r-tokenizers
           r-vctrs))
    (native-inputs
     (list r-knitr r-testthat))
    (home-page "https://github.com/juliasilge/tidytext")
    (synopsis "Text mining using dplyr, ggplot2, and other Tidy tools")
    (description
     "This is a package for text mining for word processing and sentiment
analysis using @code{dplyr}, @code{ggplot2}, and other Tidy tools.")
    (license license:expat)))

(define-public r-parsnip
  (package
    (name "r-parsnip")
    (version "1.3.2")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "parsnip" version))
       (sha256
        (base32
         "1smhz12m7sc5vzsfcq5k9ff7jvqgfl91l5pv2a1ng9gq4kw5cl7v"))))
    (properties
     '((upstream-name . "parsnip")
       ;; We don't need them.  Do you really want a package depending on
       ;; tensorflow anyway?
       (updater-ignored-native-inputs
        . ("r-keras" "r-sparklyr" "r-tensorflow"))))
    (build-system r-build-system)
    (propagated-inputs
     (list r-cli
           r-dplyr
           r-generics
           r-ggplot2
           r-globals
           r-glue
           r-hardhat
           r-lifecycle
           r-magrittr
           r-pillar
           r-prettyunits
           r-purrr
           r-rlang
           r-sparsevctrs
           r-tibble
           r-tidyr
           r-vctrs
           r-withr))
    (native-inputs
     (list r-bench
           r-dials
           r-kernlab
           r-kknn
           r-knitr
           r-matrix
           r-mgcv
           r-modeldata
           r-rpart
           r-survival
           r-testthat
           r-xgboost))
    (home-page "https://parsnip.tidymodels.org")
    (synopsis "Common API to modeling and analysis functions")
    (description
     "This package provides a common interface to allow users to specify a
model without having to remember the different argument names across different
functions or computational engines (e.g. R, Spark, Stan, etc).")
    (license license:gpl2)))

(define-public r-infer
  (package
    (name "r-infer")
    (version "1.0.8")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "infer" version))
       (sha256
        (base32
         "05m24gzkkdb7i1xia6q99ji964p98mxb875jy2z418q26fjhnfdw"))))
    (properties `((upstream-name . "infer")))
    (build-system r-build-system)
    (propagated-inputs
     (list r-broom
           r-cli
           r-dplyr
           r-generics
           r-ggplot2
           r-glue
           r-lifecycle
           r-magrittr
           r-patchwork
           r-purrr
           r-rlang
           r-tibble
           r-tidyr
           r-vctrs))
    (native-inputs
     (list r-knitr r-testthat r-vdiffr))
    (home-page "https://github.com/tidymodels/infer")
    (synopsis "Tidy statistical inference")
    (description
     "The objective of this package is to perform inference using an
expressive statistical grammar that coheres with the Tidy design framework.")
    (license license:cc0)))

(define-public r-modeldata
  (package
    (name "r-modeldata")
    (version "1.4.0")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "modeldata" version))
       (sha256
        (base32
         "15cfvvhf1c8zaanxdrrh934kz8250j0r5k6df0qkl5dz8cqv8sgb"))))
    (properties `((upstream-name . "modeldata")))
    (build-system r-build-system)
    (propagated-inputs
     (list r-dplyr r-mass r-purrr r-rlang r-tibble))
    (native-inputs (list r-testthat))
    (home-page "https://modeldata.tidymodels.org")
    (synopsis "Data sets useful for modeling packages")
    (description
     "This package provides data sets used for demonstrating or testing
model-related packages.")
    (license license:expat)))

(define-public r-modeest
  (package
    (name "r-modeest")
    (version "2.4.0")
    (source (origin
              (method url-fetch)
              (uri (cran-uri "modeest" version))
              (sha256
               (base32
                "087dw0013y4m7fcl06mxylh9lnp6acysl80d80r9srv4pw4r950s"))))
    (properties `((upstream-name . "modeest")))
    (build-system r-build-system)
    (propagated-inputs
     (list r-fbasics
           r-stable
           r-stabledist
           r-statip))
    (native-inputs (list r-testthat))
    (home-page "https://github.com/paulponcet/modeest")
    (synopsis "Mode estimations for univariate data or distributions")
    (description
     "The package provides estimators of the mode of univariate unimodal (and
sometimes multimodal) data and values of the modes of usual probability
distributions.")
    (license license:gpl3)))

(define-public r-conflicted
  (package
    (name "r-conflicted")
    (version "1.2.0")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "conflicted" version))
       (sha256
        (base32
         "121h4b4rms23szcfs1nrbgdk812d61vhrmwn9lgpsgnsaaxqd6y9"))))
    (properties
     '((upstream-name . "conflicted")
       (updater-extra-native-inputs . ("r-dplyr" "r-matrix"))))
    (build-system r-build-system)
    (propagated-inputs
     (list r-cli r-memoise r-rlang))
    (native-inputs (list r-dplyr r-matrix r-testthat))
    (home-page "https://github.com/r-lib/conflicted")
    (synopsis "Alternative conflict resolution strategy")
    (description
     "R's default conflict management system gives the most recently loaded
package precedence.  This can make it hard to detect conflicts, particularly
when they arise because a package update creates ambiguity that did not
previously exist.  The @code{conflicted} package takes a different approach,
making every conflict an error and forcing you to choose which function to
use.")
    (license license:gpl3)))

(define-public r-tidymodels
  (package
    (name "r-tidymodels")
    (version "1.3.0")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "tidymodels" version))
       (sha256
        (base32
         "1h3x9pk0a7yr2fdv7k87cgg0lq269d1569lfpn0rbhzw809k7zgk"))))
    (properties `((upstream-name . "tidymodels")))
    (build-system r-build-system)
    (propagated-inputs
     (list r-broom
           r-cli
           r-conflicted
           r-dials
           r-dplyr
           r-ggplot2
           r-hardhat
           r-infer
           r-modeldata
           r-parsnip
           r-purrr
           r-recipes
           r-rlang
           r-rsample
           r-rstudioapi
           r-tibble
           r-tidyr
           r-tune
           r-workflows
           r-workflowsets
           r-yardstick))
    (native-inputs
     (list r-knitr r-testthat))
    (home-page "https://github.com/tidymodels/tidymodels")
    (synopsis "Tidy collection for modeling and statistical analysis")
    (description
     "The tidy modeling \"verse\" is a collection of packages for modeling and
statistical analysis that share the underlying design philosophy, grammar, and
data structures of the tidyverse.")
    (license license:gpl3)))

(define-public r-lsa
  (package
    (name "r-lsa")
    (version "0.73.3")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "lsa" version))
       (sha256
        (base32
         "16k1g0kh3yaw7azg76aqf3hn3b6jgqg92xx0syai8l0my9ci2zzh"))))
    (properties `((upstream-name . "lsa")))
    (build-system r-build-system)
    (propagated-inputs
     (list r-snowballc))
    (home-page "https://cran.r-project.org/package=lsa")
    (synopsis "Latent semantic analysis")
    (description
     "The basic idea of latent semantic analysis (LSA) is, that text do have a
higher order (=latent semantic) structure which, however, is obscured by word
usage (e.g. through the use of synonyms or polysemy).  By using conceptual
indices that are derived statistically via a truncated singular value
decomposition (a two-mode factor analysis) over a given document-term matrix,
this variability problem can be overcome.")
    (license license:gpl2+)))

(define-public r-mlecens
  (package
    (name "r-mlecens")
    (version "0.1-7.1")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "MLEcens" version))
       (sha256
        (base32
         "1p7pbig81zn6ivybs9dlhx0q445z17sa95a3938wx28yi1wxrkkd"))))
    (properties `((upstream-name . "MLEcens")))
    (build-system r-build-system)
    (home-page "https://stat.ethz.ch/~maathuis/")
    (synopsis "Computation of the MLE for bivariate (interval) censored data")
    (description
     "This package contains functions to compute the nonparametric
@dfn{maximum likelihood estimator} (MLE) for the bivariate distribution of
@code{(X,Y)}, when realizations of @code{(X,Y)} cannot be observed directly.
To be more precise, we consider the situation where we observe a set of
rectangles that are known to contain the unobservable realizations of (X,Y).
We compute the MLE based on such a set of rectangles.  The methods can also be
used for univariate censored data (see data set @code{cosmesis}), and for
censored data with competing risks (see data set @code{menopause}).  The
package also provides functions to visualize the observed data and the MLE.")
    (license license:gpl2+)))

(define-public r-metafor
  (package
    (name "r-metafor")
    (version "4.8-0")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "metafor" version))
       (sha256
        (base32
         "0i06y1aw2vf86aaj9ck1ksx4wqca0dwyghxmfjafgqszn5s0cw9b"))))
    (properties
     `((upstream-name . "metafor")
       (updater-extra-native-inputs
        . ("r-car"
           "r-clubsandwich"
           "r-emmeans"
           "r-gsl"
           "r-multcomp"
           "r-mvtnorm"))))
    (build-system r-build-system)
    (arguments
     (list
      #:phases
      '(modify-phases %standard-phases
         (add-after 'unpack 'delete-bad-tests
           ;; Requires r-dfoptim.
           (lambda _ (delete-file "tests/testthat/test_misc_rma_mv.r")))
         ;; When there is no HOME directory, this package will fail to find
         ;; the vignette builder.
         (add-after 'unpack 'set-HOME
           (lambda _ (setenv "HOME" "/tmp"))))))
    (propagated-inputs
     (list r-digest
           r-mathjaxr
           r-matrix
           r-metadat
           r-nlme
           r-numderiv
           r-pbapply))
    (native-inputs
     (list r-car
           r-clubsandwich
           r-emmeans
           r-gsl
           r-lme4
           r-minqa
           r-multcomp
           r-mvtnorm
           r-r-rsp
           r-rsolnp
           r-testthat))
    (home-page "https://cran.r-project.org/web/packages/metafor/")
    (synopsis "Meta-analysis package for R")
    (description
     "This package provides a comprehensive collection of functions for
conducting meta-analyses in R.  The package includes functions to calculate
various effect sizes or outcome measures, fit fixed-, random-, and
mixed-effects models to such data, carry out moderator and meta-regression
analyses, and create various types of meta-analytical plots (e.g., forest,
funnel, radial, L'Abbe, Baujat, GOSH plots).  For meta-analyses of binomial
and person-time data, the package also provides functions that implement
specialized methods, including the Mantel-Haenszel method, Peto's method, and
a variety of suitable generalized linear (mixed-effects) models (i.e.
mixed-effects logistic and Poisson regression models).  Finally, the package
provides functionality for fitting meta-analytic multivariate/multilevel
models that account for non-independent sampling errors and/or true
effects (e.g. due to the inclusion of multiple treatment studies, multiple
endpoints, or other forms of clustering).  Network meta-analyses and
meta-analyses accounting for known correlation structures (e.g. due to
phylogenetic relatedness) can also be conducted.")
    (license license:gpl2+)))

(define-public r-metaskat
  (package
    (name "r-metaskat")
    (version "0.90")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "MetaSKAT" version))
       (sha256
        (base32 "1inibg2p1n7ij2zw39ckjh5kw4nmfq7w8rcwkzrqgbbjv0rv8b71"))))
    (properties `((upstream-name . "MetaSKAT")))
    (build-system r-build-system)
    (propagated-inputs (list r-skat))
    (home-page "https://cran.r-project.org/package=MetaSKAT")
    (synopsis "Meta analysis for SNP-Set (Sequence) kernel association test")
    (description
     "This package provides functions for Meta-analysis Burden Test, Sequence
Kernel Association Test (SKAT) and Optimal SKAT (SKAT-O) by Lee et al. (2013)
<doi:10.1016/j.ajhg.2013.05.010>.  These methods use summary-level score
statistics to carry out gene-based meta-analysis for rare variants.")
    (license license:gpl2+)))

(define-public r-altmeta
  (package
    (name "r-altmeta")
    (version "4.2")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "altmeta" version))
       (sha256
        (base32
         "178vdrlan1ijl7dlva201yx13iba2xf9sf3dpsnp9hyfq1bgrddg"))))
    (properties `((upstream-name . "altmeta")))
    (build-system r-build-system)
    (propagated-inputs
     (list r-coda r-lme4 r-matrix r-metafor r-rjags))
    (home-page "https://cran.r-project.org/web/packages/altmeta/")
    (synopsis "Alternative meta-analysis methods")
    (description
     "This package provides alternative statistical methods for meta-analysis,
including:

@enumerate
@item bivariate generalized linear mixed models for synthesizing odds ratios,
  relative risks, and risk differences
@item heterogeneity tests and measures that are robust to outliers;
@item measures, tests, and visualization tools for publication bias or
  small-study effects;
@item meta-analysis of diagnostic tests for synthesizing sensitivities,
  specificities, etc.;
@item meta-analysis methods for synthesizing proportions;
@item models for multivariate meta-analysis.
@end enumerate
")
    (license license:gpl2+)))

(define-public r-perm
  (package
    (name "r-perm")
    (version "1.0-0.4")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "perm" version))
       (sha256
        (base32
         "1sbvc9pd8j4wigblncd5jsgfnphp4kz1jy3acyivcclh79wh27jn"))))
    (properties `((upstream-name . "perm")))
    (build-system r-build-system)
    (native-inputs (list r-coin))
    (home-page "https://cran.r-project.org/web/packages/perm/")
    (synopsis "Exact or asymptotic permutation tests")
    (description
     "This package provides several methods for performing permutation tests.
It has three main functions, to perform linear permutation tests.  These tests
are tests where the test statistic is the sum of the product of a
covariate (usually group indicator) and the scores.")
    ;; Any version of the GPL
    (license license:gpl2+)))

(define-public r-qtl
  (package
    (name "r-qtl")
    (version "1.70")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "qtl" version))
       (sha256
        (base32
         "06zlp6m0w3gxxa04q7jhfh29r0d8xa0lgn9jaz80axn94css243m"))))
    (build-system r-build-system)
    (native-inputs (list r-testthat))
    (home-page "https://rqtl.org/")
    (synopsis "R package for analyzing QTL experiments in genetics")
    (description "R/qtl is an extension library for the R statistics system.
It is used to analyze experimental crosses for identifying genes contributing
to variation in quantitative traits (so-called quantitative trait loci, QTLs).

Using a hidden Markov model, R/qtl estimates genetic maps, to identify
genotyping errors, and to perform single-QTL and two-QTL, two-dimensional
genome scans.")
    (license license:gpl3)))

(define-public r-qtl2
  (package
    (name "r-qtl2")
    (version "0.36")
    (source (origin
              (method url-fetch)
              (uri (cran-uri "qtl2" version))
              (sha256
               (base32 "0sy4j3f1dw7w7qcp3lsc5mmd8kwa5qaxcl8c4236a8zbzkvvnp5j"))))
    (build-system r-build-system)
    (arguments
     (list
      #:phases
      '(modify-phases %standard-phases
         ;; TODO: this should be done by default in R itself.
         (add-before 'check 'find-zip
           (lambda _
             (setenv "R_ZIPCMD" (which "zip")))))))
    (propagated-inputs
     (list r-data-table
           r-jsonlite
           r-rcpp
           r-rcppeigen
           r-rsqlite
           r-yaml))
    (native-inputs (list r-qtl r-testthat zip))
    (home-page "https://kbroman.org/qtl2/")
    (synopsis "Quantitative Trait Locus Mapping in Experimental Crosses")
    (description
     "This package provides a set of tools to perform @dfn{Quantitative Trait
Locus} (QTL) analysis in experimental crosses.  It is a reimplementation of the
@code{R/qtl} package to better handle high-dimensional data and complex cross
designs.  Broman et al. (2018) <doi:10.1534/genetics.118.301595>.")
    (license license:gpl3)))

(define-public r-seqminer
  (package
    (name "r-seqminer")
    (version "9.7")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "seqminer" version))
       (sha256
        (base32
         "15dkh4wfszfrpfpwyhnwj3bnkjfxm17bp0grr1wf4h6zxj0jbkp5"))))
    (build-system r-build-system)
    (inputs
     (list zlib))
    (native-inputs (list r-testthat))
    (home-page "http://seqminer.genomic.codes")
    (synopsis "Read nucleotide sequence data (VCF, BCF, and METAL formats)")
    (description
     "This package provides tools to integrate nucleotide sequencing
data (variant call format, e.g. VCF or BCF) or meta-analysis results in R.")
    ;; Any version of the GPL is acceptable
    (license (list license:gpl2+ license:gpl3+))))

(define-public r-maldiquant
  (package
    (name "r-maldiquant")
    (version "1.22.3")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "MALDIquant" version))
       (sha256
        (base32
         "10wk8ykraw1swnlfhp5fh9fhfxkshanqkrwhs8dssqx1l474y2gx"))))
    (properties `((upstream-name . "MALDIquant")))
    (build-system r-build-system)
    (native-inputs
     (list r-knitr r-testthat))
    (home-page "https://cran.r-project.org/web/packages/MALDIquant")
    (synopsis "Quantitative analysis of mass spectrometry data")
    (description
     "This package provides a complete analysis pipeline for matrix-assisted
laser desorption/ionization-time-of-flight (MALDI-TOF) and other
two-dimensional mass spectrometry data.  In addition to commonly used plotting
and processing methods it includes distinctive features, namely baseline
subtraction methods such as morphological filters (TopHat) or the
statistics-sensitive non-linear iterative peak-clipping algorithm (SNIP), peak
alignment using warping functions, handling of replicated measurements as well
as allowing spectra with different resolutions.")
    (license license:gpl3+)))

(define-public r-scattermore
  (package
    (name "r-scattermore")
    (version "1.2")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "scattermore" version))
       (sha256
        (base32
         "1l820rc4ncmqd5sacdc420xf6r5dh34sbhgzzgq7a4yx1dxshd2m"))))
    (properties `((upstream-name . "scattermore")))
    (build-system r-build-system)
    (propagated-inputs
     (list r-ggplot2 r-scales))
    (native-inputs (list r-knitr r-testthat))
    (home-page "https://github.com/exaexa/scattermore")
    (synopsis "Scatterplots with more points")
    (description
     "This package provides C-based tools for converting large scatterplot
data to rasters.  It speeds up plotting of data with millions of points.")
    (license license:gpl3+)))

(define-public r-seuratobject
  (package
    (name "r-seuratobject")
    (version "5.1.0")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "SeuratObject" version))
       (sha256
        (base32
         "0aphlg1x4jcgj7s23zv5zil89xkn799gp62x0v8zayi61gjaxm6x"))))
    (properties `((upstream-name . "SeuratObject")))
    (build-system r-build-system)
    (propagated-inputs
     (list r-future
           r-future-apply
           r-generics
           r-lifecycle
           r-matrix
           r-progressr
           r-rcpp
           r-rcppeigen
           r-rlang
           r-sp
           r-spam))
    (native-inputs (list r-testthat))
    (home-page "https://satijalab.org/seurat")
    (synopsis "Data structures for single cell data")
    (description
     "This package defines S4 classes for single-cell genomic data and
associated information, such as dimensionality reduction embeddings,
nearest-neighbor graphs, and spatially-resolved coordinates.  It provides data
access methods and R-native hooks to ensure the Seurat object is familiar to
other R users.")
    (license license:gpl3)))

;; This is for r-seurat5
(define-public r-seurat5object
  (deprecated-package "r-seurat5object" r-seuratobject))

(define-public r-seurat
  (package
    (name "r-seurat")
    (version "5.3.0")
    (source (origin
              (method url-fetch)
              (uri (cran-uri "Seurat" version))
              (sha256
               (base32
                "19q8k4bz6r7748sx8574pan1fns0rd7fg1w309rhz8sax9nazaqj"))))
    (properties
     '((upstream-name . "Seurat")
       (updater-ignored-native-inputs . ("r-singlecellexperiment"))))
    (build-system r-build-system)
    (propagated-inputs
     (list r-cluster
           r-cowplot
           r-fastdummies
           r-fitdistrplus
           r-future
           r-future-apply
           r-generics
           r-ggplot2
           r-ggrepel
           r-ggridges
           r-httr
           r-ica
           r-igraph
           r-irlba
           r-jsonlite
           r-kernsmooth
           r-leidenbase
           r-lifecycle
           r-lmtest
           r-mass
           r-matrix
           r-matrixstats
           r-miniui
           r-patchwork
           r-pbapply
           r-plotly
           r-png
           r-progressr
           r-rann
           r-rcolorbrewer
           r-rcpp
           r-rcppannoy
           r-rcppeigen
           r-rcpphnsw
           r-rcppprogress
           r-reticulate
           r-rlang
           r-rocr
           r-rspectra
           r-rtsne
           r-scales
           r-scattermore
           r-sctransform
           r-seuratobject
           r-shiny
           r-spatstat-explore
           r-spatstat-geom
           r-tibble
           r-uwot))
    (native-inputs (list r-bpcells r-testthat))
    (home-page "https://www.satijalab.org/seurat")
    (synopsis "Seurat is an R toolkit for single cell genomics")
    (description
     "This package is an R package designed for QC, analysis, and
exploration of single cell RNA-seq data.  It easily enables widely-used
analytical techniques, including the identification of highly variable genes,
dimensionality reduction; PCA, ICA, t-SNE, standard unsupervised clustering
algorithms; density clustering, hierarchical clustering, k-means, and the
discovery of differentially expressed genes and markers.")
    (license license:gpl3)))

;; Seurat5 is only available via the seurat5 branch.  It will replace r-seurat
;; eventually once it has been released to CRAN.
(define-public r-seurat5
  (deprecated-package "r-seurat5" r-seurat))

(define-public r-seuratdisk
  (let ((commit "877d4e18ab38c686f5db54f8cd290274ccdbe295")
        (revision "1"))
    (package
      (name "r-seuratdisk")
      (version (git-version "0.0.0.9021" revision commit))
      (source
       (origin
         (method git-fetch)
         (uri (git-reference
               (url "https://github.com/mojaveazure/seurat-disk")
               (commit commit)))
         (file-name (git-file-name name version))
         (sha256
          (base32 "0ma9qk95symk95slp8klriqg64d8klqf1634y93ml74icarxw1dm"))))
      (properties `((upstream-name . "SeuratDisk")))
      (build-system r-build-system)
      (propagated-inputs
       (list r-cli
             r-crayon
             r-hdf5r
             r-matrix
             r-r6
             r-rlang
             r-seurat
             r-seuratobject
             r-stringi
             r-withr))
      (native-inputs
       (list r-knitr))
      (home-page "https://github.com/mojaveazure/seurat-disk")
      (synopsis "Interfaces for HDF5-based single cell file formats")
      (description
       "The h5Seurat file format is specifically designed for the storage and
analysis of multi-modal single-cell and spatially-resolved expression
experiments, for example, from CITE-seq or 10X Visium technologies.  It holds
all molecular information and associated metadata, including (for example)
nearest-neighbor graphs, dimensional reduction information, spatial
coordinates and image data, and cluster labels.  This package also supports
rapid and on-disk conversion between h5Seurat and AnnData objects, with the
goal of enhancing interoperability between Seurat and Scanpy.")
      (license license:gpl3))))

(define-public r-seuratdata
  (let ((commit "4dc08e022f51c324bc7bf785b1b5771d2742701d")
        (revision "1"))
    (package
      (name "r-seuratdata")
      (version (git-version "0.2.2.9001" revision commit))
      (source
       (origin
         (method git-fetch)
         (uri (git-reference
               (url "https://github.com/satijalab/seurat-data")
               (commit commit)))
         (file-name (git-file-name name version))
         (sha256
          (base32 "1wac1jqh42nbaikkd8v3apr1lwqcn1ppprfkwqfnqs6mvavgqavp"))))
      (properties `((upstream-name . "SeuratData")))
      (build-system r-build-system)
      (arguments
       `(#:phases
         (modify-phases %standard-phases
           ;; When there is no HOME directory, this package will fail to load
           ;; the included list of packages.
           (add-after 'unpack 'set-HOME
             (lambda _ (setenv "HOME" "/tmp"))))))
      (propagated-inputs (list r-cli r-crayon r-rappdirs r-seurat r-seuratobject))
      (home-page "https://github.com/satijalab/seurat-data")
      (synopsis "Install and manage Seurat datasets")
      (description
       "Single cell RNA sequencing datasets can be large, consisting of
matrices that contain expression data for several thousand features across
several thousand cells.  This package is designed to easily install, manage,
and learn about various single-cell datasets, provided Seurat objects and
distributed as independent packages.")
      (license license:gpl3))))

(define-public r-phangorn
  (package
    (name "r-phangorn")
    (version "2.12.1")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "phangorn" version))
       (sha256
        (base32
         "1rwyzvqs5hwjmwa70b7g4jm7h1x1spyh81cd2qnmvfml0rw9ricx"))))
    (properties
     '((updater-ignored-native-inputs . ("r-utils"))
       (updater-extra-native-inputs . ("r-vdiffr"))))
    (build-system r-build-system)
    (arguments
     (list
      #:phases
      '(modify-phases %standard-phases
         (add-after 'unpack 'disable-bad-test
           (lambda _
             ;; This tests insists on r-ggseqlogo being absent.
             (substitute* "tests/testthat/test_plot_ancestral.R"
               (("test_that\\(\"plotSeqLogo works\".*" m)
                (string-append m "skip('skip')\n"))))))))
    (propagated-inputs
     (list r-ape
           r-digest
           r-fastmatch
           r-generics
           r-igraph
           r-matrix
           r-quadprog
           r-rcpp))
    (native-inputs
     (list r-knitr r-testthat r-vdiffr))
    (home-page "https://github.com/KlausVigo/phangorn")
    (synopsis "Phylogenetic analysis in R")
    (description
     "Phangorn is a package for phylogenetic analysis in R.  It supports
estimation of phylogenetic trees and networks using Maximum Likelihood,
Maximum Parsimony, distance methods and Hadamard conjugation.")
    (license license:gpl2+)))

(define-public r-diversitree
  (package
    (name "r-diversitree")
    (version "0.10-1")
    (source
      (origin
        (method url-fetch)
        (uri (cran-uri "diversitree" version))
        (sha256
         (base32
          "1k2h2pxxxm7pkjdzsn3mvf2i169vckxmyhzc4mqrcppmnbkzpx4a"))))
    (build-system r-build-system)
    ;; FIXME There are a number of concerning test failures due to accuracy
    ;; problems.
    (arguments (list #:test-types '(list "vignettes")))
    (inputs (list fftw gsl))
    (propagated-inputs
     (list r-ape r-desolve r-rcpp r-subplex))
    (native-inputs (list r-caper r-expm r-lubridate r-minqa r-testthat))
    (home-page "https://www.zoology.ubc.ca/prog/diversitree")
    (synopsis "Comparative 'phylogenetic' analyses of diversification")
    (description "This package contains a number of comparative \"phylogenetic\"
methods, mostly focusing on analysing diversification and character evolution.
Contains implementations of \"BiSSE\" (Binary State Speciation and Extinction)
and its unresolved tree extensions, \"MuSSE\" (Multiple State Speciation and
Extinction), \"QuaSSE\", \"GeoSSE\", and \"BiSSE-ness\" Other included methods
include Markov models of discrete and continuous trait evolution and constant
rate speciation and extinction.")
    (license license:gpl2+)))

(define-public r-calculus
  (package
    (name "r-calculus")
    (version "1.0.1")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "calculus" version))
       (sha256
        (base32
         "1p80bgg6896z798cx7nwqbwd0rxdv27kamaw1gw0hv4lpqsr7q10"))))
    (properties `((upstream-name . "calculus")))
    (build-system r-build-system)
    (arguments
     (list
      #:phases
      '(modify-phases %standard-phases
         (add-after 'unpack 'delete-bad-tests
           (lambda _
             ;; 17 tests here fail with minor accuracy errors.
             (delete-file "tests/testthat/test-integral.R"))))))
    (propagated-inputs
     (list r-rcpp))
    (native-inputs
     (list r-knitr r-testthat))
    (home-page "https://github.com/eguidotti/calculus")
    (synopsis "High dimensional numerical and symbolic calculus")
    (description
     "Efficient C++ optimized functions for numerical and symbolic calculus.
It includes basic symbolic arithmetic, tensor calculus, Einstein summing
convention, fast computation of the Levi-Civita symbol and generalized
Kronecker delta, Taylor series expansion, multivariate Hermite polynomials,
accurate high-order derivatives, differential operators (Gradient, Jacobian,
Hessian, Divergence, Curl, Laplacian) and numerical integration in arbitrary
orthogonal coordinate systems: cartesian, polar, spherical, cylindrical,
parabolic or user defined by custom scale factors.")
    (license license:gpl3)))

(define-public r-decon
  (package
    (name "r-decon")
    (version "1.3-4")
    (source
      (origin
        (method url-fetch)
        (uri (cran-uri "decon" version))
        (sha256
          (base32
            "036cv56wf42q2p3d5h15hbrp5rc29xxy20qwv4k1qzhkq6hmw0qs"))))
    (properties `((upstream-name . "decon")))
    (build-system r-build-system)
    (native-inputs
     (list gfortran))
    (home-page
      "https://cran.r-project.org/web/packages/decon/")
    (synopsis "Deconvolution Estimation in Measurement Error Models")
    (description
      "This package contains a collection of functions to deal with
nonparametric measurement error problems using deconvolution
kernel methods.  We focus two measurement error models in the
package: (1) an additive measurement error model, where the
goal is to estimate the density or distribution function from
contaminated data; (2) nonparametric regression model with
errors-in-variables.  The R functions allow the measurement errors
to be either homoscedastic or heteroscedastic.  To make the
deconvolution estimators computationally more efficient in R,
we adapt the \"Fast Fourier Transform\" (FFT) algorithm for
density estimation with error-free data to the deconvolution
kernel estimation.  Several methods for the selection of the
data-driven smoothing parameter are also provided in the package.
See details in: Wang, X.F.  and Wang, B. (2011).  Deconvolution
estimation in measurement error models: The R package decon.
Journal of Statistical Software, 39(10), 1-24.")
    (license license:gpl3+)))

(define-public r-densestbayes
  (package
    (name "r-densestbayes")
    (version "1.0-2.2")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "densEstBayes" version))
       (sha256
        (base32 "0ydnjyprv8fz037nkfvjd8w6hg4a19lbnq4kl7yankxksjfdyqc3"))))
    (properties `((upstream-name . "densEstBayes")))
    (build-system r-build-system)
    (propagated-inputs
     (list r-bh
           r-mass
           r-nlme
           r-rcpp
           r-rcpparmadillo
           r-rcppeigen
           r-rcppparallel
           r-rstan
           r-rstantools
           r-stanheaders))
    (home-page "https://cran.r-project.org/package=densEstBayes")
    (synopsis "Density estimation via Bayesian inference engines")
    (description
     "Bayesian density estimates for univariate continuous random samples are
provided using the Bayesian inference engine paradigm.  The engine options
are: Hamiltonian Monte Carlo, the no U-turn sampler, semiparametric mean field
variational Bayes and slice sampling.  The methodology is described in Wand
and Yu (2020), arXiv:2009.06182.")
    (license license:gpl2+)))

(define-public r-locpol
  (package
    (name "r-locpol")
    (version "0.8.0")
    (source
      (origin
        (method url-fetch)
        (uri (cran-uri "locpol" version))
        (sha256
          (base32
            "1bip9x45kdnwc14rvk3ckzfbs32yc2wiid1ypmbbin4mk7364zxk"))))
    (properties `((upstream-name . "locpol")))
    (build-system r-build-system)
    (home-page
      "https://cran.r-project.org/web/packages/locpol/")
    (synopsis "Kernel Local Polynomial Regression")
    (description
      "Computes local polynomial estimators for the regression and
also density.  It comprises several different utilities to handle
kernel estimators.")
    (license license:gpl2+)))

(define-public r-lpme
  (package
    (name "r-lpme")
    (version "1.1.3")
    (source
      (origin
        (method url-fetch)
        (uri (cran-uri "lpme" version))
        (sha256
          (base32
            "1ch11cwjci98m7952p9wdsh9fj5y1mjya6ayq0q4wmbm824qfpzb"))))
    (properties `((upstream-name . "lpme")))
    (build-system r-build-system)
    (propagated-inputs
      (list r-decon r-flexmix r-locpol r-rcpp r-rcpparmadillo))
    (home-page
      "https://cran.r-project.org/web/packages/lpme/")
    (synopsis "Nonparametric Estimation of Measurement Error Models")
    (description
      "Provide nonparametric methods for mean regression model, modal
regression and conditional density estimation in the presence/absence of
measurement error.  Bandwidth selection is also provided for each method.")
    (license license:gpl2+)))

(define-public r-aws-signature
  (package
    (name "r-aws-signature")
    (version "0.6.0")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "aws.signature" version))
       (sha256
        (base32
         "15llpcnrdq4y6jsn7079yjmgbr5d1wgy2ymsm3jj3gkrd5l4zzpp"))))
    (properties `((upstream-name . "aws.signature")))
    (build-system r-build-system)
    (propagated-inputs
     (list r-base64enc r-digest))
    (native-inputs (list r-testthat))
    (home-page "https://github.com/cloudyr/aws.signature")
    (synopsis "Amazon Web Services Request Signatures")
    (description
     "This package generates version 2 and 4 request signatures for Amazon Web
Services (AWS) and provides a mechanism for retrieving credentials from
environment variables, AWS credentials files, and EC2 instance metadata.  For
use on EC2 instances, the package 'aws.ec2metadata' is suggested.")
    (license license:gpl2+)))

(define-public r-aws-s3
  (package
    (name "r-aws-s3")
    (version "0.3.21")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "aws.s3" version))
       (sha256
        (base32
         "132cczq0ml7lpp2yl6l4p99dn1zihrncnpa6wyad4m9mnr50a8dx"))))
    (properties `((upstream-name . "aws.s3")))
    (build-system r-build-system)
    ;; 3/5 tests require Internet access.
    (arguments (list #:tests? #false))
    (propagated-inputs
     (list r-aws-signature
           r-base64enc
           r-curl
           r-digest
           r-httr
           r-xml2))
    (native-inputs (list r-testthat))
    (home-page "https://github.com/cloudyr/aws.s3")
    (synopsis "AWS S3 Client Package")
    (description
     "This package provides a simple client package for the Amazon Web
Services (AWS) Simple Storage Service (S3) REST API.")
    (license license:gpl2+)))

(define-public r-lgr
  (package
    (name "r-lgr")
    (version "0.4.4")
    (source (origin
              (method url-fetch)
              (uri (cran-uri "lgr" version))
              (sha256
               (base32
                "09x1vw6cnc1c0p0ylcz1q1vcxyaf1kljhh7ni3gl5jm19zii2h4c"))))
    (build-system r-build-system)
    (arguments
     (list
      #:phases
      '(modify-phases %standard-phases
         (add-after 'unpack 'delete-bad-tests
           (lambda _
             ;; Two tests produce warning where none are expected.
             (delete-file "tests/testthat/test_print_LogEvent.R"))))))
    (propagated-inputs
     (list r-r6))
    (native-inputs
     (list r-data-table r-future r-knitr r-rotor r-testthat r-tibble))
    (home-page "https://s-fleck.github.io/lgr/")
    (synopsis "Fully featured logging framework")
    (description "This package offers a flexible, feature-rich yet
light-weight logging framework based on @code{R6} classes.  It supports
hierarchical loggers, custom log levels, arbitrary data fields in log events,
logging to plaintext, JSON, (rotating) files, memory buffers, and databases, as
well as email and push notifications.")
    (license license:expat)))

(define-public r-mhg
  (package
    (name "r-mhg")
    (version "1.1")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "mHG" version))
       (sha256
        (base32
         "1rz5ncrvvv9h9grls15apa63v2nh9j87fmp4mwjjil37jx6a5zki"))))
    (properties `((upstream-name . "mHG")))
    (build-system r-build-system)
    (native-inputs (list r-testthat))
    (home-page "https://cran.r-project.org/package=mHG")
    (synopsis "Minimum-hypergeometric test")
    (description
     "This package runs a minimum-hypergeometric (mHG) test as described in
\"Discovering Motifs in Ranked Lists of DNA Sequences\" by Eran Eden.")
    (license license:gpl2)))

(define-public r-mlr
  (package
    (name "r-mlr")
    (version "2.19.2")
    (source (origin
              (method url-fetch)
              (uri (cran-uri "mlr" version))
              (sha256
               (base32
                "1icpa3xa0f7l40i52l3pl43m98j69r75qnqf1yp7wyh6y54p1rl5"))))
    (properties `((upstream-name . "mlr")))
    (build-system r-build-system)
    (inputs (list gdal
                  geos
                  glu
                  gmp
                  gsl
                  jags
                  mpfr
                  openmpi
                  proj
                  udunits))
    (propagated-inputs (list r-backports
                             r-bbmisc
                             r-checkmate
                             r-data-table
                             r-ggplot2
                             r-parallelmap
                             r-paramhelpers
                             r-stringi
                             r-survival
                             r-xml))
    (native-inputs (list r-knitr r-testthat))
    (home-page "https://mlr.mlr-org.com")
    (synopsis "Machine learning in R")
    (description
     "This package provides an interface to a large number of classification
and regression techniques.  These techniques include machine-readable
parameter descriptions.  There is also an experimental extension for survival
analysis, clustering and general, example-specific cost-sensitive learning.
Also included:

@itemize

@item Generic resampling, including cross-validation, bootstrapping and
  subsampling;
@item Hyperparameter tuning with modern optimization techniques, for single-
  and multi-objective problems;
@item Filter and wrapper methods for feature selection;
@item Extension of basic learners with additional operations common in machine
  learning, also allowing for easy nested resampling.
@end itemize

Most operations can be parallelized.")
    (license license:bsd-2)))

(define-public r-mlrmbo
  (package
    (name "r-mlrmbo")
    (version "1.1.5.1")
    (source (origin
              (method url-fetch)
              (uri (cran-uri "mlrMBO" version))
              (sha256
               (base32
                "16fwj7m28g4km7yalqppxmh3lw2jln0z072l6awia38qkdg6xwhc"))))
    (properties
     '((upstream-name . "mlrMBO")
       (updater-extra-native-inputs
        . ("r-cmaesr" "r-dicekriging" "r-rgenoud" "r-randomforest"))))
    (build-system r-build-system)
    (propagated-inputs (list r-backports
                             r-bbmisc
                             r-checkmate
                             r-data-table
                             r-lhs
                             r-mlr
                             r-parallelmap
                             r-paramhelpers
                             r-smoof))
    (native-inputs
     (list r-cmaesr
           r-dicekriging
           r-knitr
           r-randomforest
           r-rgenoud
           r-testthat))
    (home-page "https://github.com/mlr-org/mlrMBO")
    (synopsis "Model-based optimization with mlr")
    (description
     "This package is a flexible and comprehensive R toolbox for model-based
optimization.  It implements Efficient Global Optimization Algorithm for
single- and multi-objective optimization.  It supports mixed parameters.  The
machine learning toolbox mlr offers regression learners.  It provides various
infill criteria and features batch proposal, parallel execution,
visualization, and logging.  Its modular implementation allows easy
customization by the user.")
    (license license:bsd-2)))

(define-public r-mlr3cluster
  (package
    (name "r-mlr3cluster")
    (version "0.1.11")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "mlr3cluster" version))
       (sha256
        (base32 "1z5rk9l9yw98szjh9d68y8h6ghw1bgr7600iss35j2y6yxhlcq1b"))))
    (properties
     '((upstream-name . "mlr3cluster")
       (updater-extra-native-inputs . ("r-vctrs"))))
    (build-system r-build-system)
    (propagated-inputs (list r-backports
                             r-checkmate
                             r-clue
                             r-cluster
                             r-data-table
                             r-fpc
                             r-mlr3
                             r-mlr3misc
                             r-paradox
                             r-r6))
    (native-inputs (list r-apcluster r-mlbench r-testthat r-vctrs))
    (home-page "https://mlr3cluster.mlr-org.com")
    (synopsis "Cluster extension for mlr3")
    (description
     "This package extends the mlr3 package with cluster analysis.")
    (license license:lgpl3)))

(define-public r-mlr3data
  (package
    (name "r-mlr3data")
    (version "0.9.0")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "mlr3data" version))
       (sha256
        (base32 "05hbg2s1y8gxkbrnvmw0vahl5x9dbdajhl857j2j7f7pbdwckjva"))))
    (properties `((upstream-name . "mlr3data")))
    (build-system r-build-system)
    (home-page "https://github.com/mlr-org/mlr3data")
    (synopsis "Collection of machine learning data Sets for mlr3")
    (description
     "This package provides a small collection of interesting and educational
machine learning data sets which are used as examples in the mlr3 book Applied
machine learning using mlr3 in R @url{https://mlr3book.mlr-org.com}, the use case
gallery  @url{https://mlr3gallery.mlr-org.com}, or in other examples.  All data
sets are properly preprocessed and ready to be analyzed by most machine learning
algorithms.  Data sets are automatically added to the dictionary of tasks if
mlr3 is loaded.")
    (license license:lgpl3)))

(define-public r-mlr3filters
  (package
    (name "r-mlr3filters")
    (version "0.8.1")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "mlr3filters" version))
       (sha256
        (base32 "12gbvp99hai6cnqa8nxlc4x24ig2andnwhhhfkxdkbxjm89dnfaa"))))
    (properties
     '((upstream-name . "mlr3filters")
       (updater-extra-native-inputs . ("r-boruta" "r-rpart"))))
    (build-system r-build-system)
    (arguments
     (list
      #:phases
      '(modify-phases %standard-phases
         (add-after 'unpack 'disable-bad-tests
           (lambda _
             ;; This requires FSelectorRcpp, which eventually depends on
             ;; mystery jars in r-rwekajars.
             (substitute* '("tests/testthat/test_FilterInformationGain.R"
                            "tests/testthat/test_FilterRelief.R")
               ((".* handles features with only missings gracefully.*" m)
                (string-append m "skip('skip');\n"))))))))
    (propagated-inputs (list r-backports
                             r-checkmate
                             r-data-table
                             r-mlr3
                             r-mlr3misc
                             r-paradox
                             r-r6))
    (native-inputs (list r-boruta r-rpart r-testthat))
    (home-page "https://mlr3filters.mlr-org.com")
    (synopsis "Filter based feature selection for mlr3")
    (description
     "This package extends mlr3 with filter methods for feature selection.  Besides
standalone filter methods built-in methods of any machine-learning algorithm are
supported.  Partial scoring of multivariate filter methods is supported.")
    (license license:lgpl3)))

(define-public r-mlr3fselect
  (package
    (name "r-mlr3fselect")
    (version "1.3.0")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "mlr3fselect" version))
       (sha256
        (base32 "0xs73nqg04nb57br1aayc9vi98zc8iwmd0iv3g5wj3c7x89kwygz"))))
    (properties
     '((upstream-name . "mlr3fselect")
       (updater-extra-native-inputs . ("r-rpart"))))
    (build-system r-build-system)
    (propagated-inputs (list r-bbotk
                             r-checkmate
                             r-data-table
                             r-lgr
                             r-mlr3
                             r-mlr3misc
                             r-paradox
                             r-r6
                             r-stabm))
    (native-inputs (list r-mlr3pipelines r-rpart r-testthat))
    (home-page "https://mlr3fselect.mlr-org.com")
    (synopsis "Feature selection for mlr3")
    (description
     "This package is a feature selection package of the mlr3 ecosystem.  It
selects the optimal feature set for any mlr3 learner.  The package works with
several optimization algorithms e.g. random search, Recursive feature elimination,
and genetic search.  Moreover, it can automatically optimize learners and estimate
the performance of optimized feature sets with nested resampling.")
    (license license:lgpl3)))

(define-public r-mlr3hyperband
  (package
    (name "r-mlr3hyperband")
    (version "0.6.0")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "mlr3hyperband" version))
       (sha256
        (base32 "1sr9bccy1zmbj83i6nlwkfmi98b40bl1l9q4lzl8n0knnavnzcj7"))))
    (properties
     '((upstream-name . "mlr3hyperband")
       (updater-extra-native-inputs . ("r-emoa"))))
    (build-system r-build-system)
    (propagated-inputs (list r-bbotk
                             r-checkmate
                             r-data-table
                             r-lgr
                             r-mlr3
                             r-mlr3misc
                             r-mlr3tuning
                             r-paradox
                             r-r6))
    (native-inputs (list r-emoa r-mlr3pipelines r-testthat))
    (home-page "https://mlr3hyperband.mlr-org.com")
    (synopsis "Hyperband for mlr3")
    (description
     "This package implements a successive halving and hyperband optimization
algorithm for the mlr3 ecosystem.  The implementation in mlr3hyperband features
improved scheduling and parallelizes the evaluation of configurations.  The package
includes tuners for hyperparameter optimization in mlr3tuning and optimizers for
black-box optimization in bbotk.")
    (license license:lgpl3)))

(define-public r-mlr3inferr
  (package
    (name "r-mlr3inferr")
    (version "0.1.0")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "mlr3inferr" version))
       (sha256
        (base32 "0cw0a194hcairl7va6lvx62k0bn25x15ylczbgcaxjj54bagqslm"))))
    (properties `((upstream-name . "mlr3inferr")))
    (build-system r-build-system)
    (propagated-inputs (list r-checkmate
                             r-data-table
                             r-future
                             r-lgr
                             r-mlr3
                             r-mlr3measures
                             r-mlr3misc
                             r-paradox
                             r-r6
                             r-withr))
    (native-inputs (list r-testthat))
    (home-page "https://mlr3inferr.mlr-org.com")
    (synopsis "Inference on the generalization error")
    (description
     "This package provides an mlr3 extension that provides various
resampling-based confidence interval (CI) methods for estimating the
generalization error.  These CI methods are implemented as mlr3 measures,
enabling the evaluation of individual algorithms on specific tasks as well as
the comparison of different learning algorithms.")
    (license license:lgpl3)))

(define-public r-mlr3mbo
  (package
    (name "r-mlr3mbo")
    (version "0.2.9")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "mlr3mbo" version))
       (sha256
        (base32 "1wgf3ikywczpkddqpjf3cmvqr083p4l75ifv60mlxkg7fhpnm61g"))))
    (properties
     '((upstream-name . "mlr3mbo")
       (updater-extra-native-inputs
        . ("r-dicekriging" "r-emoa" "r-fastghquad" "r-ranger" "r-rgenoud"))))
    (build-system r-build-system)
    (propagated-inputs (list r-bbotk
                             r-checkmate
                             r-data-table
                             r-lgr
                             r-mlr3
                             r-mlr3misc
                             r-mlr3tuning
                             r-paradox
                             r-r6
                             r-spacefillr))
    (native-inputs (list r-dicekriging
                         r-emoa
                         r-fastghquad
                         r-mlr3learners
                         r-mlr3pipelines
                         r-ranger
                         r-redux
                         r-rgenoud
                         r-rush
                         r-testthat))
    (home-page "https://mlr3mbo.mlr-org.com")
    (synopsis "Flexible Bayesian optimization")
    (description
     "This package provides a flexible approach to Bayesian optimization / model
based optimization building on the bbotk package.  The mlr3mbo is a toolbox
providing both ready-to-use optimization algorithms as well as their fundamental
building blocks allowing for straightforward implementation of custom algorithms.
Single- and multi-objective optimization is supported as well as mixed continuous,
categorical and conditional search spaces.  Moreover, using mlr3mbo for
hyperparameter optimization of machine learning models within the mlr3 ecosystem
is straightforward via mlr3tuning.")
    (license license:lgpl3)))

(define-public r-mlr3measures
  (package
    (name "r-mlr3measures")
    (version "1.0.0")
    (source (origin
              (method url-fetch)
              (uri (cran-uri "mlr3measures" version))
              (sha256
               (base32
                "02jsg40bpzgic34jidv20yspnl12c9bmjmim22d307nzrpkqp4gh"))))
    (build-system r-build-system)
    (propagated-inputs
     (list r-checkmate r-mlr3misc r-prroc))
    (native-inputs (list r-testthat))
    (home-page "https://mlr3measures.mlr-org.com/")
    (synopsis "Performance measures for mlr3")
    (description "This package implements multiple performance measures for
supervised learning.  It includes over 40 measures for regression and
classification.  Additionally, meta information about the performance measures
can be queried, e.g. what the best and worst possible performances scores
are.")
    (license license:lgpl3)))

(define-public r-mlr3misc
  (package
    (name "r-mlr3misc")
    (version "0.18.0")
    (source (origin
              (method url-fetch)
              (uri (cran-uri "mlr3misc" version))
              (sha256
               (base32
                "1x8h65p0b12a7ld98a4dcrr67rak7psk3izacy097sbp3x9518k5"))))
    (build-system r-build-system)
    (properties
     ;; Avoid dependency cycle.
     '((updater-ignored-native-inputs . ("r-paradox"))))
    (propagated-inputs
     (list r-backports
           r-checkmate
           r-cli
           r-data-table
           r-digest
           r-r6))
    (native-inputs (list r-mirai r-testthat))
    (home-page "https://mlr3misc.mlr-org.com/")
    (synopsis "Helper functions for mlr3")
    (description "@code{mlr3misc} provides frequently used helper functions
and assertions used in @code{mlr3} and its companion packages.  It comes with
helper functions for functional programming, for printing, to work with
@code{data.table}, as well as some generally useful @code{R6} classes.  This
package also supersedes the package @code{BBmisc}.")
    (license license:lgpl3)))

(define-public r-mlr3pipelines
  (package
    (name "r-mlr3pipelines")
    (version "0.7.2")
    (source (origin
              (method url-fetch)
              (uri (cran-uri "mlr3pipelines" version))
              (sha256
               (base32
                "0144sqwddd1484209fcqx5mpj2xx9xnr2vgmhhlnijqajz5riydd"))))
    (properties
     '((updater-extra-native-inputs
        . ("r-bbotk" "r-gensa" "r-rpart"))))
    (build-system r-build-system)
    (propagated-inputs
     (list r-backports
           r-checkmate
           r-data-table
           r-digest
           r-lgr
           r-mlr3
           r-mlr3misc
           r-paradox
           r-r6
           r-withr))
    (native-inputs
     ;; There are lots of inputs the importer adds that we don't need.
     (list r-bbotk r-gensa r-knitr r-mlr3learners r-rpart r-testthat))
    (home-page "https://mlr3pipelines.mlr-org.com/")
    (synopsis "Preprocessing Operators and Pipelines for @code{mlr3}")
    (description "@code{mlr3pipelines} enriches @code{mlr3} with a diverse
set of pipelining operators (PipeOps) that can be composed into graphs.
Operations exist for data preprocessing, model fitting, and ensemble learning.
Graphs can themselves be treated as @code{mlr3} Learners and can therefore be
resampled, benchmarked, and tuned.")
    (license license:lgpl3)))

(define-public r-mlr3tuningspaces
  (package
    (name "r-mlr3tuningspaces")
    (version "0.6.0")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "mlr3tuningspaces" version))
       (sha256
        (base32 "1hf1g6jqymcx4y5622s57by7p2k9dwq3xyc7s35hhxssgfqpcpv3"))))
    (properties `((upstream-name . "mlr3tuningspaces")))
    (build-system r-build-system)
    (propagated-inputs (list r-checkmate
                             r-cli
                             r-data-table
                             r-mlr3
                             r-mlr3misc
                             r-mlr3tuning
                             r-paradox
                             r-r6))
    (native-inputs (list r-mlr3learners r-testthat))
    (home-page "https://mlr3tuningspaces.mlr-org.com")
    (synopsis "Search spaces for mlr3")
    (description
     "This package is a collection of search spaces for hyperparameter optimization
in the mlr3 ecosystem.  It features ready-to-use search spaces for many popular
machine learning algorithms.  The search spaces are from scientific articles and
work for a wide range of data sets.")
    (license license:lgpl3)))

(define-public r-mlr3verse
  (package
    (name "r-mlr3verse")
    (version "0.3.1")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "mlr3verse" version))
       (sha256
        (base32 "0kkyp4rgfjsx51f5f5wjq3mjr1ci9axrfcpm287f1ng7b3973l8b"))))
    (properties `((upstream-name . "mlr3verse")))
    (build-system r-build-system)
    (propagated-inputs (list r-bbotk
                             r-data-table
                             r-mlr3
                             r-mlr3cluster
                             r-mlr3data
                             r-mlr3filters
                             r-mlr3fselect
                             r-mlr3hyperband
                             r-mlr3inferr
                             r-mlr3learners
                             r-mlr3mbo
                             r-mlr3misc
                             r-mlr3pipelines
                             r-mlr3tuning
                             r-mlr3tuningspaces
                             r-mlr3viz
                             r-paradox))
    (home-page "https://mlr3verse.mlr-org.com")
    (synopsis "Easily install and load of the mlr3 package family")
    (description
     "The mlr3 package family is a set of packages for machine-learning purposes
built in a modular fashion.  This wrapper package is aimed to simplify the
installation and loading of the core mlr3 packages.")
    (license license:lgpl3)))

(define-public r-mlr3viz
  (package
    (name "r-mlr3viz")
    (version "0.10.1")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "mlr3viz" version))
       (sha256
        (base32 "0d0vqg1jlg86fspmfx120jm1fkcjr3f5s93chbgcxb1gpz46pf7f"))))
    (properties
     '((upstream-name . "mlr3viz")
       (updater-extra-native-inputs . ("r-rpart"))))
    (build-system r-build-system)
    (propagated-inputs (list r-checkmate
                             r-data-table
                             r-ggplot2
                             r-mlr3misc
                             r-scales
                             r-viridis))
    (native-inputs (list r-bbotk
                         r-lgr
                         r-mlr3
                         r-mlr3filters
                         r-mlr3fselect
                         r-mlr3tuning
                         r-paradox
                         r-precrec
                         r-rpart
                         r-testthat
                         r-vdiffr))
    (home-page "https://mlr3viz.mlr-org.com")
    (synopsis "Visualizations for mlr3")
    (description
     "This package offers features plots for mlr3 objects such as tasks, learners,
predictions, benchmark results, tuning instances and filters via the
@code{autoplot()} generic of ggplot2.  The mlr3viz package draws plots with
the viridis color palette and applies the minimal theme.  Visualizations include
barplots, boxplots, histograms, ROC curves, and precision-recall curves.")
    (license license:lgpl3)))

(define-public r-paradox
  (package
    (name "r-paradox")
    (version "1.0.1")
    (source (origin
              (method url-fetch)
              (uri (cran-uri "paradox" version))
              (sha256
               (base32
                "120ll8xrdg9s7ip0053m0i83gshxh3n79spsfwv6dzjwsj3mmpkj"))))
    (build-system r-build-system)
    (propagated-inputs
     (list r-backports r-checkmate r-data-table r-mlr3misc r-r6))
    (native-inputs (list r-knitr r-testthat))
    (home-page "https://paradox.mlr-org.com/")
    (synopsis "Define and work with parameter spaces for complex algorithms")
    (description "With this package it is possible to define parameter spaces,
constraints and dependencies for arbitrary algorithms, and to program on such
spaces.  It also includes statistical designs and random samplers.  Objects are
implemented as @code{R6} classes.")
    (license license:lgpl3)))

(define-public r-mlr3
  (package
    (name "r-mlr3")
    (version "0.23.0")
    (source (origin
              (method url-fetch)
              (uri (cran-uri "mlr3" version))
              (sha256
               (base32
                "1av2v4kdn5klbgr2wmqd671ggzaspyw5pgsjcq2aq9cbpr407dv3"))))
    (properties
     '((updater-ignored-native-inputs . ("r-distr6"))))
    (build-system r-build-system)
    (arguments
     (list
      #:phases
      '(modify-phases %standard-phases
         (add-after 'unpack 'disable-bad-tests
           ;; These tests attempt to install packages.
           (lambda _ (delete-file "tests/testthat/test_install_pkgs.R"))))))
    (propagated-inputs
     (list r-backports
           r-checkmate
           r-data-table
           r-evaluate
           r-future
           r-future-apply
           r-lgr
           r-mlbench
           r-mlr3measures
           r-mlr3misc
           r-palmerpenguins
           r-paradox
           r-parallelly
           r-r6
           r-uuid))
    (native-inputs (list r-callr
                         r-codetools
                         r-matrix
                         r-progressr
                         r-rpart
                         r-testthat))
    (home-page "https://mlr3.mlr-org.com/")
    (synopsis "Machine Learning in R - Next Generation")
    (description "@code{mlr3} enables efficient, object-oriented programming
on the building blocks of machine learning.  It provides @code{R6} objects for
tasks, learners, resamplings, and measures.  The package is geared towards
scalability and larger datasets by supporting parallelization and out-of-memory
data-backends like databases.  While @code{mlr3} focuses on the core
computational operations, add-on packages provide additional functionality.")
    (license license:lgpl3)))

(define-public r-mlr3learners
  (package
    (name "r-mlr3learners")
    (version "0.12.0")
    (source (origin
              (method url-fetch)
              (uri (cran-uri "mlr3learners" version))
              (sha256
               (base32
                "1vfd4llc558f3rvdr6ykfsa7cxjcivizslsszmr7c1qdm8ly8jf7"))))
    (build-system r-build-system)
    (propagated-inputs
     (list r-checkmate
           r-data-table
           r-mlr3
           r-mlr3misc
           r-paradox
           r-r6))
    (native-inputs (list r-lgr r-testthat r-xgboost))
    (home-page "https://mlr3learners.mlr-org.com/")
    (synopsis "Recommended Learners for @code{mlr3}")
    (description "@code{mlr3learners} extends @code{mlr3} and @code{mlr3proba}
with interfaces to essential machine learning packages on CRAN.  This includes,
but is not limited to: (penalized) linear and logistic regression, linear and
quadratic discriminant analysis, k-nearest neighbors, naive Bayes, support
vector machines, and gradient boosting.")
    (license license:lgpl3)))

(define-public r-bbotk
  (package
    (name "r-bbotk")
    (version "1.5.0")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "bbotk" version))
       (sha256
        (base32
         "1mm8bvnlinwbrxrmjw16nmqkgxcixcwa7i4lh3s49g5i82yk7xmb"))))
    (properties
     '((upstream-name . "bbotk")
       (updater-extra-native-inputs . ("r-gensa"))))
    (build-system r-build-system)
    (propagated-inputs
     (list r-checkmate
           r-data-table
           r-lgr
           r-mlr3misc
           r-paradox
           r-r6))
    (native-inputs (list r-gensa
                         r-irace
                         r-processx
                         r-progressr
                         r-redux
                         r-rush
                         r-testthat))
    (home-page "https://bbotk.mlr-org.com")
    (synopsis "Black-Box Optimization Toolkit")
    (description "This package provides a common framework for optimization of
black-box functions for other packages, e.g. @code{mlr3}.  It offers various
optimization methods e.g. grid search, random search and generalized simulated
annealing.")
    (license license:lgpl3)))

(define-public r-mlr3tuning
  (package
    (name "r-mlr3tuning")
    (version "1.3.0")
    (source (origin
              (method url-fetch)
              (uri (cran-uri "mlr3tuning" version))
              (sha256
               (base32
                "1fa2hd6mrzkcygwhmxd5yzs0yfvzkw7k3v73c7rdbn3bangmafmi"))))
    (properties
     '((updater-extra-native-inputs . ("r-rpart"))))
    (build-system r-build-system)
    (propagated-inputs
     (list r-bbotk
           r-checkmate
           r-data-table
           r-lgr
           r-mlr3
           r-mlr3misc
           r-paradox
           r-r6))
    (native-inputs
     (list r-knitr r-mlr3pipelines r-rpart r-rush r-testthat))
    (home-page "https://mlr3tuning.mlr-org.com/")
    (synopsis "Tuning for @code{mlr3}")
    (description "@code{mlr3tuning} implements methods for hyperparameter
tuning, e.g. Grid Search, Random Search, or Simulated Annealing.  Various
termination criteria can be set and combined.  The class @code{AutoTuner} provides a
convenient way to perform nested resampling in combination with @code{mlr3}.")
    (license license:lgpl3)))

(define-public r-fontliberation
  (package
    (name "r-fontliberation")
    (version "0.1.0")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "fontLiberation" version))
       (sha256
        (base32
         "1w1rl0g4ayyp8lwppmz9yzj9cizg7i50g07216jkm1q5w0is9pmc"))))
    (properties
     `((upstream-name . "fontLiberation")))
    (build-system r-build-system)
    (home-page "https://cran.r-project.org/package=fontLiberation")
    (synopsis "Liberation fonts")
    (description
     "This package provides a placeholder for the Liberation fontset intended
for the fontquiver package.  This fontset covers the 12 combinations of
families (sans, serif, mono) and faces (plain, bold, italic, bold italic)
supported in R graphics devices.")
    (license license:silofl1.1)))

(define-public r-fontbitstreamvera
  (package
    (name "r-fontbitstreamvera")
    (version "0.1.1")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "fontBitstreamVera" version))
       (sha256
        (base32
         "0nipdlmhjv1wr3aidcl97nk6mppdkd65krgwqnhdsnv0jpfv761j"))))
    (properties
     `((upstream-name . "fontBitstreamVera")))
    (build-system r-build-system)
    (home-page "https://cran.r-project.org/package=fontBitstreamVera")
    (synopsis "Fonts for fontquiver")
    (description
     "This package is a placeholder for the Bitstream Vera font. It is
intended for the fontquiver package.")
    (license
     (license:fsdg-compatible
      "https://www.gnome.org/fonts/#Final_Bitstream_Vera_Fonts"
      "The Font Software may be sold as part of a larger software package but
no copy of one or more of the Font Software typefaces may be sold by
itself."))))

(define-public r-fontquiver
  (package
    (name "r-fontquiver")
    (version "0.2.1")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "fontquiver" version))
       (sha256
        (base32
         "0qv3i9hch7cygl9983s3w68wfh5qvym2jkm52pp06p6mq8a1i1wm"))))
    (properties `((upstream-name . "fontquiver")))
    (build-system r-build-system)
    (propagated-inputs
     (list r-fontbitstreamvera r-fontliberation))
    (native-inputs (list r-htmltools r-testthat))
    (home-page "https://cran.r-project.org/package=fontquiver")
    (synopsis "Set of installed fonts")
    (description
     "This package provides a set of fonts.  This is useful when you want to
avoid system fonts to make sure your outputs are reproducible.")
    (license license:gpl3)))

(define-public r-freetypeharfbuzz
  (package
    (name "r-freetypeharfbuzz")
    (version "0.2.6")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "freetypeharfbuzz" version))
       (sha256
        (base32
         "0r3icgnq3jk4fm6z92cmhzdmflbk5df8zsmjg0dzpc4y48xafnk7"))))
    (properties
     `((upstream-name . "freetypeharfbuzz")))
    (build-system r-build-system)
    (arguments
     (list
      ;; 6 tests fail with accuracy errors.
      #:tests? #false
      #:phases
      '(modify-phases %standard-phases
         (add-after 'unpack 'prepare-static-libraries
           (lambda* (#:key inputs #:allow-other-keys)
             (mkdir-p "src/target/include")
             (let ((freetype (assoc-ref inputs "static-freetype"))
                   (harfbuzz (assoc-ref inputs "static-harfbuzz")))
               (substitute* "src/Makevars.in"
                 (("include @MK_FILE@") "") ; do not build static libs
                 (("^HB_STATIC_LIB =.*")
                  (string-append "HB_STATIC_LIB = " harfbuzz "/lib/libharfbuzz.a\n"))
                 (("^FT_STATIC_LIB =.*")
                  (string-append "FT_STATIC_LIB = " freetype "/lib/libfreetype.a\n")))
               (copy-recursively (string-append freetype "/include")
                                 "src/target/include")
               (copy-recursively (string-append harfbuzz "/include")
                                 "src/target/include")))))))
    (propagated-inputs
     (list r-fontquiver))
    ;; This may defeat the purpose of this package as our versions of freetype
    ;; and harfbuzz obviously differ from the tarballs offered by this
    ;; project.  On the other hand, Guix arguably does a better job at
    ;; "ensur[ing] deterministic computation".
    (native-inputs
     `(("r-testthat" ,r-testthat)
       ("static-freetype"
        ,(package
           (inherit (static-package freetype))
           (arguments
            `(#:configure-flags
              (list "--enable-static=yes"
                    "--with-pic=yes"
                    "--without-zlib"
                    "--without-bzip2"
                    "--without-png"
                    "--without-harfbuzz")))))
       ("static-harfbuzz"
        ,(package
           (inherit (static-package harfbuzz))
           (arguments
            `(#:tests? #false ; fail because shared library is disabled
              #:configure-flags
              (list "--enable-static=yes"
		    "--enable-shared=no"
		    "--with-pic=yes"
		    "--with-freetype=yes"
		    "--without-icu"
		    "--without-cairo"
		    "--without-fontconfig"
		    "--without-glib")))))))
    (inputs
     (list zlib))
    (home-page "https://cran.r-project.org/package=freetypeharfbuzz")
    (synopsis "Deterministic computation of text box metrics")
    (description
     "Unlike other tools that dynamically link to the Cairo stack,
freetypeharfbuzz is statically linked to specific versions of the FreeType and
harfbuzz libraries.  This ensures deterministic computation of text box
extents for situations where reproducible results are crucial (for instance
unit tests of graphics).")
    (license license:gpl3)))

(define-public r-vdiffr
  (package
    (name "r-vdiffr")
    (version "1.0.8")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "vdiffr" version))
       (sha256
        (base32
         "16zdb910dc40s79f336mdpr0zymxbjh84vx41051hq4gfx54y342"))))
    (properties `((upstream-name . "vdiffr")))
    (build-system r-build-system)
    ;; Tests require r-ggplot2, which creates a dependency cycle in pillar.
    (arguments (list #:tests? #false))
    (inputs (list libpng zlib))
    (propagated-inputs
     (list r-cpp11
           r-diffobj
           r-glue
           r-htmltools
           r-lifecycle
           r-rlang
           r-testthat
           r-xml2))
    (native-inputs (list r-testthat))
    (home-page "https://github.com/r-lib/vdiffr")
    (synopsis "Visual regression testing and graphical diffing")
    (description
     "This package is an extension to the testthat package that makes it easy
to add graphical unit tests.  It provides a Shiny application to manage the
test cases.")
    (license license:gpl3)))

(define-public r-highlight
  (package
    (name "r-highlight")
    (version "0.5.1")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "highlight" version))
       (sha256
        (base32
         "06sirfmkdl355rfr5bb475829v7zx1spkz82vi31vl55jzijq54m"))))
    (properties `((upstream-name . "highlight")))
    (build-system r-build-system)
    (home-page "https://github.com/hadley/highlight")
    (synopsis "Syntax highlighter for R code")
    (description
     "This package provides a syntax highlighter for R code based on the
results of the R parser.  It supports rendering in HTML and LaTeX markup.  It
includes a custom Sweave driver performing syntax highlighting of R code
chunks.")
    (license license:gpl3+)))

(define-public r-highs
  (package
    (name "r-highs")
    (version "1.10.0-2")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "highs" version))
       (sha256
        (base32 "1mm8v3cy9c3k0b609m40gasvkkl105qrsrslxxbrskfpgph4g2pq"))))
    (properties
     '((upstream-name . "highs")
       (updater-extra-native-inputs . ("cmake-minimal" "which"))
       (updater-ignored-native-inputs . ("gfortran"))))
    (build-system r-build-system)
    (propagated-inputs (list r-checkmate r-rcpp))
    (native-inputs (list cmake-minimal which))
    (home-page "https://gitlab.com/roigrp/solver/highs")
    (synopsis "HiGHS optimization solver")
    (description
     "This package provides an R interface to @code{HiGHS}, an optimization
solver.  It is designed for solving mixed-integer optimization problems with
quadratic or linear objectives and linear constraints.")
    (license license:gpl2+)))

(define-public r-clustree
  (package
    (name "r-clustree")
    (version "0.5.1")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "clustree" version))
       (sha256
        (base32
         "05yizn8hcf4nsibypxahp2mz64sy10vli776mi0d2gvfb5p4kwmm"))))
    (properties `((upstream-name . "clustree")))
    (build-system r-build-system)
    (propagated-inputs
     (list r-checkmate
           r-dplyr
           r-ggplot2
           r-ggraph
           r-ggrepel
           r-igraph
           r-rlang
           r-tidygraph
           r-viridis))
    (native-inputs
     (list r-knitr r-testthat))
    (home-page "https://github.com/lazappi/clustree")
    (synopsis "Visualize clusterings at different resolutions")
    (description
     "Deciding what resolution to use can be a difficult question when
approaching a clustering analysis.  One way to approach this problem is to
look at how samples move as the number of clusters increases.  This package
allows you to produce clustering trees, a visualization for interrogating
clusterings as resolution increases.")
    (license license:gpl3)))

(define-public r-textshaping
  (package
    (name "r-textshaping")
    (version "1.0.1")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "textshaping" version))
       (sha256
        (base32
         "0bx8zf62xk9shgh3anxl2rlwgp4x2q1q9saqg6awqj3sdj951gvv"))))
    (properties `((upstream-name . "textshaping")))
    (build-system r-build-system)
    (inputs
     (list freetype fribidi harfbuzz zlib))
    (propagated-inputs
     (list r-cpp11 r-lifecycle r-stringi r-systemfonts))
    (native-inputs
     (list pkg-config r-knitr r-testthat))
    (home-page "https://github.com/r-lib/textshaping")
    (synopsis "Bindings to the HarfBuzz and Fribidi libraries for text shaping")
    (description
     "This package provides access to the text shaping functionality in the
HarfBuzz library and the bidirectional algorithm in the Fribidi library.  This
is a low-level utility package mainly for graphic devices that expands upon
the font tool-set provided by the @code{systemfonts} package.")
    (license license:expat)))

(define-public r-ragg
  (package
    (name "r-ragg")
    (version "1.4.0")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "ragg" version))
       (sha256
        (base32
         "0xq93vipy7i8pgij57xkawigxv1p2lb3aax56asi3k631qndrk4c"))))
    (properties `((upstream-name . "ragg")))
    (build-system r-build-system)
    (inputs
     (list freetype libjpeg-turbo libpng libtiff zlib))
    (propagated-inputs
     (list r-systemfonts r-textshaping))
    (native-inputs
     (list pkg-config r-testthat))
    (home-page "https://ragg.r-lib.org")
    (synopsis "Graphic devices based on AGG")
    (description
     "Anti-Grain Geometry (AGG) is a high-quality and high-performance 2D
drawing library.  The ragg package provides a set of graphic devices based on
AGG to use as alternative to the raster devices provided through the
@code{grDevices} package.")
    (license license:expat)))

(define-public r-downlit
  (package
    (name "r-downlit")
    (version "0.4.4")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "downlit" version))
       (sha256
        (base32
         "0a7q90623ahcadqg0b3a0qylachq7nghf50f0v0lip2axvf7ghsm"))))
    (properties `((upstream-name . "downlit")))
    (build-system r-build-system)
    ;; 5 tests require Internet access.
    (arguments (list #:tests? #false))
    (propagated-inputs
     (list r-brio
           r-desc
           r-digest
           r-evaluate
           r-fansi
           r-memoise
           r-rlang
           r-vctrs
           r-withr
           r-yaml))
    (native-inputs (list r-testthat))
    (home-page "https://downlit.r-lib.org/")
    (synopsis "Syntax highlighting and automatic linking")
    (description
     "This package provides syntax highlighting of R code, specifically
designed for the needs of RMarkdown packages like @code{pkgdown},
@code{hugodown}, and @code{bookdown}.  It includes linking of function calls
to their documentation on the web, and automatic translation of ANSI escapes
in output to the equivalent HTML.")
    (license license:expat)))

(define-public r-pkgdown
  (package
    (name "r-pkgdown")
    (version "2.1.3")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "pkgdown" version))
       (sha256
        (base32
         "13mcy41a1pfj2my2jb4kv8dvjbkx00rli0v1a45cr1zalf54raks"))))
    (properties
     '((upstream-name . "pkgdown")
       (updater-ignored-native-inputs . ("r-diffviewer"))))
    (build-system r-build-system)
    ;; Many tests require internet access.  Some need r-quarto.  This causes
    ;; 38 tests to fail, but we cannot easily disable just those and keep the
    ;; passing 646 tests.
    (arguments (list #:tests? #false))
    (inputs (list pandoc))
    (propagated-inputs
     (list r-bslib
           r-callr
           r-cli
           r-desc
           r-downlit
           r-fontawesome
           r-fs
           r-httr2
           r-jsonlite
           r-openssl
           r-purrr
           r-ragg
           r-rlang
           r-rmarkdown
           r-tibble
           r-whisker
           r-withr
           r-xml2
           r-yaml))
    (native-inputs
     ;; The updater adds lots of extra inputs that we actually don't need.
     (list r-htmltools
           r-htmlwidgets
           r-knitr
           r-learnr
           r-lifecycle
           r-magick
           r-pkgload
           r-quarto
           r-testthat
           r-viridislite))
    (home-page "https://pkgdown.r-lib.org")
    (synopsis "Make static HTML documentation for an R package")
    (description
     "The goal of this package is to generate an attractive and useful website
from a source package.  @code{pkgdown} converts your documentation, vignettes,
README file, and more to HTML making it easy to share information about your
package online.")
    (license license:expat)))

(define-public r-prereg
  (package
    (name "r-prereg")
    (version "0.6.0")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "prereg" version))
       (sha256
        (base32
         "039nrl5cirsx1ysh214dr6xnn1h6h3f90im6k9dgmzfksxdqigpw"))))
    (properties `((upstream-name . "prereg")))
    (build-system r-build-system)
    (propagated-inputs
     (list r-rmarkdown
           ;; The package provides a custom LaTex template in
           ;; inst/rmd/prereg_form.tex, which depends on these packages:
           texlive-amsmath
           texlive-booktabs
           texlive-etoolbox
           texlive-fancyhdr
           texlive-fancyvrb
           texlive-geometry
           texlive-graphics
           texlive-iftex
           texlive-listings
           texlive-polyglossia
           texlive-threeparttable
           texlive-titlesec
           texlive-titling
           texlive-tools
           texlive-ulem
           texlive-upquote
           (texlive-local-tree (list texlive-lm))))
    (native-inputs (list r-testthat))
    (home-page "https://github.com/crsh/prereg")
    (synopsis
     "R Markdown Templates to preregister Scientific Studies")
    (description
     "This package provides a collection of templates to author
preregistration documents for scientific studies in PDF format.")
    (license license:gpl3)))

(define-public r-ez
  (package
    (name "r-ez")
    (version "4.4-0")
    (source
      (origin
        (method url-fetch)
        (uri (cran-uri "ez" version))
        (sha256
          (base32
            "0a58s94x576dfz7wcbivrr2hmdh5x1vy16zwkqp9fmdzqx38pagq"))))
    (properties `((upstream-name . "ez")))
    (build-system r-build-system)
    (propagated-inputs
      (list r-car
            r-ggplot2
            r-lme4
            r-mass
            r-matrix
            r-mgcv
            r-plyr
            r-reshape2
            r-scales
            r-stringr))
    (home-page "https://github.com/mike-lawrence/ez")
    (synopsis "Easy Analysis and Visualization of Factorial Experiments")
    (description
     "Facilitates easy analysis of factorial experiments, including purely
within-Ss designs (a.k.a. \"repeated measures\"), purely between-Ss designs,
and mixed within-and-between-Ss designs.  The functions in this package aim to
provide simple, intuitive and consistent specification of data analysis and
visualization.  Visualization functions also include design visualization for
pre-analysis data auditing, and correlation matrix visualization.  Finally,
this package includes functions for non-parametric analysis, including
permutation tests and bootstrap resampling.  The bootstrap function obtains
predictions either by cell means or by more advanced/powerful mixed effects
models, yielding predictions and confidence intervals that may be easily
visualized at any level of the experiment's design.")
    (license license:gpl2+)))

(define-public r-qdapregex
  (package
    (name "r-qdapregex")
    (version "0.7.10")
    (source
      (origin
        (method url-fetch)
        (uri (cran-uri "qdapRegex" version))
        (sha256
          (base32
            "126zh9gm7hqa1yb20pb16qy36ixs6sdslvlxqjh55cw9y0wfhgdh"))))
    (properties `((upstream-name . "qdapRegex")))
    (build-system r-build-system)
    (propagated-inputs (list r-stringi))
    (native-inputs (list r-testthat))
    (home-page "https://trinker.github.com/qdapRegex/")
    (synopsis
      "Regular Expression Removal, Extraction, and Replacement Tools")
    (description
      "This package provides a collection of regular expression tools
associated with the @code{qdap} package that may be useful outside of the
context of discourse analysis.  Tools include removal/extraction/replacement of
abbreviations, dates, dollar amounts, email addresses, hash tags, numbers,
percentages, citations, person tags, phone numbers, times, and zip codes.")
    (license license:gpl2)))

(define-public r-mgsub
  (package
    (name "r-mgsub")
    (version "1.7.3")
    (source
      (origin
        (method url-fetch)
        (uri (cran-uri "mgsub" version))
        (sha256
          (base32
            "1mci6x65h94qiz9cwikx2inbrwkykv43zbs8abfbx416zrh2bbn9"))))
    (properties `((upstream-name . "mgsub")))
    (build-system r-build-system)
    (native-inputs (list r-knitr r-testthat))
    (home-page
      "https://cran.r-project.org/package=mgsub")
    (synopsis
      "Safe, Multiple, Simultaneous String Substitution")
    (description
      "Designed to enable simultaneous substitution in strings in a safe
fashion.  Safe means it does not rely on placeholders (which can cause errors
in same length matches).")
    (license license:expat)))

(define-public r-textshape
  (package
    (name "r-textshape")
    (version "1.7.5")
    (source
      (origin
        (method url-fetch)
        (uri (cran-uri "textshape" version))
        (sha256
          (base32
            "1g193dg4rhw8a1iwkyqsswlj95h9irm9xziclwc1mhd3jm5wyify"))))
    (properties `((upstream-name . "textshape")))
    (build-system r-build-system)
    (propagated-inputs
      (list r-data-table r-slam r-stringi))
    (native-inputs (list r-testthat))
    (home-page "https://github.com/trinker/textshape")
    (synopsis "Tools for Reshaping Text")
    (description
      "Tools that can be used to reshape and restructure text data.")
    (license license:gpl2)))

(define-public r-syuzhet
  (package
    (name "r-syuzhet")
    (version "1.0.7")
    (source
      (origin
        (method url-fetch)
        (uri (cran-uri "syuzhet" version))
        (sha256
          (base32
            "0cpjg16hwn6843jdxp4h94qjw1wwwblvjzg30w54rac08m62nkxg"))))
    (properties `((upstream-name . "syuzhet")))
    (build-system r-build-system)
    (propagated-inputs
      (list r-dplyr
            r-dtt
            r-nlp
            r-rlang
            r-textshape
            r-tidyr
            r-zoo))
    (native-inputs (list r-knitr r-testthat))
    (home-page "https://github.com/mjockers/syuzhet")
    (synopsis
      "Extracts Sentiment and Sentiment-Derived Plot Arcs from Text")
    (description
      "Extracts sentiment and sentiment-derived plot arcs from text using a
variety of sentiment dictionaries conveniently packaged for consumption by R
users.  Implemented dictionaries include @dfn{syuzhet} (default) developed in the
Nebraska Literary Lab, @dfn{afinn} developed by Finn Arup Nielsen, @dfn{bing}
developed by Minqing Hu and Bing Liu, and @dfn{nrc} developed by Mohammad, Saif
M.  and Turney, Peter D.  Applicable references are available in
@file{README.md} and in the documentation for the @code{get_sentiment}
function.  The package also provides a hack for implementing Stanford's coreNLP
sentiment parser.  The package provides several methods for plot arc
normalization.")
    (license license:gpl3)))

(define-public r-lexicon
  (package
    (name "r-lexicon")
    (version "1.2.1")
    (source
      (origin
        (method url-fetch)
        (uri (cran-uri "lexicon" version))
        (sha256
          (base32
            "0x7rscsh6par2lj11sby7bmz41cxn63iiw51lgh29z09cg8j606c"))))
    (properties `((upstream-name . "lexicon")))
    (build-system r-build-system)
    (propagated-inputs
      (list r-data-table r-syuzhet))
    (home-page "https://github.com/trinker/lexicon")
    (synopsis "Lexicons for Text Analysis")
    (description
      "This package provides a collection of lexical hash tables, dictionaries,
and word lists.")
    (license license:gpl3)))

(define-public r-english
  (package
    (name "r-english")
    (version "1.2-6")
    (source
      (origin
        (method url-fetch)
        (uri (cran-uri "english" version))
        (sha256
          (base32
            "1g3nmy5p8wj3ix1vp1qmkmy3dyqisrw0md8cjrx4klqkp0wqlms9"))))
    (properties `((upstream-name . "english")))
    (build-system r-build-system)
    (native-inputs (list r-knitr))
    (home-page
      "https://cran.r-project.org/package=english")
    (synopsis "Translate Integers into English")
    (description
      "Allow numbers to be presented in an English language version, one, two,
three, ...  Ordinals are also available, first, second, third, ...  and
indefinite article choice, \"a\" or \"an\".")
    (license license:gpl2)))

(define-public r-textclean
  (package
    (name "r-textclean")
    (version "0.9.3")
    (source
      (origin
        (method url-fetch)
        (uri (cran-uri "textclean" version))
        (sha256
          (base32
            "0kgjh6c4f14qkjc4fds7q7rpf4nkma3p0igm54fplmm3p853nvrz"))))
    (properties `((upstream-name . "textclean")))
    (build-system r-build-system)
    (propagated-inputs
      (list r-data-table
            r-english
            r-glue
            r-lexicon
            r-mgsub
            r-qdapregex
            r-stringi
            r-textshape))
    (native-inputs (list r-testthat))
    (home-page "https://github.com/trinker/textclean")
    (synopsis "Text Cleaning Tools")
    (description
      "Tools to clean and process text.  Tools are geared at checking for
substrings that are not optimal for analysis and replacing or removing them
(normalizing) with more analysis friendly substrings (see Sproat, Black, Chen,
Kumar, Ostendorf, & Richards (2001) @url{doi:10.1006/csla.2001.0169}) or
extracting them into new variables.  For example, emoticons are often used in
text but not always easily handled by analysis algorithms.  The
@code{replace_emoticon()} function replaces emoticons with word equivalents.")
    (license license:gpl2)))

(define-public r-striprtf
  (package
    (name "r-striprtf")
    (version "0.6.0")
    (source
      (origin
        (method url-fetch)
        (uri (cran-uri "striprtf" version))
        (sha256
          (base32
            "1c8z2qf1kp43ir4dmyxq6hc46dclq8vx3ggkj02p8j1icjswm9bh"))))
    (properties `((upstream-name . "striprtf")))
    (build-system r-build-system)
    (propagated-inputs
      (list r-magrittr r-rcpp r-stringr))
    (native-inputs (list r-testthat))
    (home-page "https://github.com/kota7/striprtf")
    (synopsis "Extract Text from RTF File")
    (description
      "Extracts plain text from @dfn{Rich Text Format} (RTF) file.")
    (license license:expat)))

(define-public r-ndjson
  (package
    (name "r-ndjson")
    (version "0.9.1")
    (source
      (origin
        (method url-fetch)
        (uri (cran-uri "ndjson" version))
        (sha256
          (base32
            "0l5d24f0n0h2jbrisp8xpr9hsbzjryc62h961lmhp4kqnqrvw423"))
        (modules '((guix build utils)))
        (snippet
         ;; unvendor gzstream
         '(for-each delete-file '("src/gzstream.cpp" "src/gzstream.h")))))
    (properties
     '((upstream-name . "ndjson")
       (updater-extra-inputs . ("gzstream"))))
    (build-system r-build-system)
    (arguments
     '(#:phases
       (modify-phases %standard-phases
         (add-after 'unpack 'use-system-gzstream
           (lambda* (#:key inputs #:allow-other-keys)
            (substitute* "src/Makevars"
             (("PKG_LIBS = " all)
              (string-append all "-lgzstream "))))))))
    (inputs (list gzstream zlib))
    (propagated-inputs
      (list r-data-table r-rcpp r-tibble))
    (home-page "https://gitlab.com/hrbrmstr/ndjson")
    (synopsis
      "Wicked-Fast @dfn{Streaming JSON} (ndjson) Reader")
    (description
      "@dfn{Streaming JSON} (ndjson) has one JSON record per-line and many
modern ndjson files contain large numbers of records.  These constructs may not
be columnar in nature, but it is often useful to read in these files and
\"flatten\" the structure out to enable working with the data in an R
@code{data.frame}-like context.  Functions are provided that make it possible
to read in plain ndjson files or compressed (@code{gz}) ndjson files and either
validate the format of the records or create \"flat\" @code{data.table}
structures from them.")
    (license license:expat)))

(define-public r-streamr
  (package
    (name "r-streamr")
    (version "0.4.5")
    (source
      (origin
        (method url-fetch)
        (uri (cran-uri "streamR" version))
        (sha256
          (base32
            "1clx3b0j2515r1nmnl6ki7qw5n54q3x2jvqv3zrc00kq71mlj7ix"))))
    (properties `((upstream-name . "streamR")))
    (build-system r-build-system)
    (propagated-inputs
      (list r-ndjson r-rcurl r-rjson))
    (home-page
      "https://cran.r-project.org/package=streamR")
    (synopsis
      "Access to Twitter Streaming API via R")
    (description
      "This package provides functions to access Twitter's filter, sample, and
user streams, and to parse the output into data frames.")
    (license license:gpl2)))

(define-public r-strex
  (package
    (name "r-strex")
    (version "2.0.1")
    (source (origin
              (method url-fetch)
              (uri (cran-uri "strex" version))
              (sha256
               (base32
                "1dd6gsx45rqwwdj25034hzqj3wg62v0zqrdv2xq8qx3ylixv0v9q"))))
    (properties `((upstream-name . "strex")))
    (build-system r-build-system)
    (propagated-inputs
     (list r-checkmate
           r-lifecycle
           r-magrittr
           r-rlang
           r-stringi
           r-stringr))
    (native-inputs (list r-knitr r-testthat))
    (home-page "https://rorynolan.github.io/strex/")
    (synopsis "Extra string manipulation functions")
    (description
     "Strex is a collection of string manipulation functions not provided by
the @code{stringi} or @code{stringr} packages.  The foremost of these is the
extraction of numbers from strings.  There are many other handy
functionalities in strex.")
    (license license:gpl3)))

(define-public r-readods
  (package
    (name "r-readods")
    (version "2.3.2")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "readODS" version))
       (sha256
        (base32
         "0xil9ysp4qfx6wvd0672mx043h7hw7qvspcp05sc676p0rw9jrrf"))))
    (properties `((upstream-name . "readODS")))
    (build-system r-build-system)
    (propagated-inputs
     (list r-cellranger
           r-cpp11
           r-minty
           r-stringi
           r-tibble
           r-vctrs
           r-zip))
    (native-inputs (list r-knitr r-readr r-spelling r-testthat r-withr))
    (home-page
     "https://cran.r-project.org/package=readODS")
    (synopsis "Read and Write ODS Files")
    (description
     "This package lets you import @dfn{OpenDocument Spreadsheet} (ODS) into R
as a data frame.  It also supports writing data frames to an ODS file.")
    (license license:gpl3)))

(define-public r-qpdf
  (package
    (name "r-qpdf")
    (version "1.3.5")
    (source
     (origin
      (method url-fetch)
      (uri (cran-uri "qpdf" version))
      (sha256
       (base32
        "0yn41pjr86cw3i1s0050c9f36xmxgqrymrkczsa6zz1i392rg6kh"))
      (modules '((guix build utils)))
      (snippet
       '(begin
           ;; unvendor libqpdf
          (delete-file-recursively "src/libqpdf")
          (delete-file-recursively "src/include/qpdf")))))
    (properties
     `((upstream-name . "qpdf")
       (updater-extra-inputs . ("qpdf"))))
    (build-system r-build-system)
    (arguments
     '(#:phases
       (modify-phases %standard-phases
         (add-after 'unpack 'configure
           (lambda _ (setenv "EXTERNAL_QPDF" "1"))))))
    (inputs
      (list libjpeg-turbo qpdf zlib))
    (propagated-inputs
      (list r-askpass r-curl r-rcpp))
    (native-inputs (list pkg-config r-testthat))
    (home-page "https://github.com/ropensci/qpdf")
    (synopsis
      "Split, Combine and Compress PDF Files")
    (description
      "Content-preserving transformations transformations of PDF files such as
split, combine, and compress.  This package interfaces directly to the
@code{qpdf} C++ API and does not require any command line utilities.  Note that
@code{qpdf} does not read actual content from PDF files: to extract text and
data you need the @code{pdftools} package.")
    (license license:asl2.0)))

(define-public r-pbdmpi
  (package
    (name "r-pbdmpi")
    (version "0.5-3")
    (source (origin
              (method url-fetch)
              (uri (cran-uri "pbdMPI" version))
              (sha256
               (base32
                "027j1h0k6xjsd8i3v5z36lkwlxm4d7lflzmhbj1ag0ydvq27lm0b"))))
    (properties
     '((upstream-name . "pbdMPI")
       (updater-extra-inputs . ("openmpi"))))
    (build-system r-build-system)
    (arguments
     (list
      ;; Tests fail with: "You need at least 2 MPI ranks for this test"
      #:test-types '(list "vignettes")
      #:phases
      `(modify-phases %standard-phases
         (add-before 'install 'mpi-setup
           ,%openmpi-setup))))
    (inputs (list openmpi))
    (propagated-inputs (list r-float))
    (native-inputs (list pkg-config))
    (home-page "https://pbdr.org/")
    (synopsis "Programming with Big Data -- Interface to MPI")
    (description
     "This package provides an efficient interface to MPI by utilizing S4
classes and methods with a focus on @dfn{Single Program/Multiple Data} (SPMD)
parallel programming style, which is intended for batch parallel execution.")
    (license license:mpl2.0)))

(define-public r-pdftools
  (package
    (name "r-pdftools")
    (version "3.5.0")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "pdftools" version))
       (sha256
        (base32
         "03k3l016hvzmzp4aknsn4j95kw818jhwr1yyhdk3wl0pyiz09gvc"))))
    (properties
     '((upstream-name . "pdftools")
       (updater-extra-inputs . ("poppler"))))
    (build-system r-build-system)
    (inputs (list poppler zlib))
    (propagated-inputs (list r-qpdf r-rcpp))
    (native-inputs (list pkg-config r-testthat))
    (home-page "https://docs.ropensci.org/pdftools/")
    (synopsis "Text Extraction, Rendering and Converting of PDF Documents")
    (description
     "This package provides utilities based on @code{libpoppler} for
extracting text, fonts, attachments and metadata from a PDF file.  It also
supports high quality rendering of PDF documents into PNG, JPEG, TIFF format,
or into raw bitmap vectors for further processing in R.")
    (license license:expat)))

(define-public r-antiword
  (package
    (name "r-antiword")
    (version "1.3.4")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "antiword" version))
       (sha256
        (base32
         "0750zh9jzxfk2r2n8gc4l2vlkvr6x9w0wziswbb5s1nipqcnx8ab"))
       (modules '((guix build utils)))
       ;; unvendor libantiword
       (snippet
        '(delete-file-recursively "src"))))
    (properties
     `((upstream-name . "antiword")
       (updater-extra-inputs . ("antiword"))))
    (build-system r-build-system)
    (arguments
     (list
      #:phases
      #~(modify-phases %standard-phases
          (add-after 'unpack 'use-system-antiword
            (lambda _
              (substitute* "R/antiword.R"
                (("system.file\\(\"bin\", package = \"antiword\"\\)")
                 (string-append "\"" #$(this-package-input "antiword") "/bin\""))))))))
    (inputs (list antiword))
    (propagated-inputs (list r-sys))
    (home-page "https://github.com/ropensci/antiword#readme")
    (synopsis "Extract text from Microsoft Word documents")
    (description
     "This package wraps the @code{AntiWord} utility to extract text from
Microsoft Word documents.  The utility only supports the old @code{doc}
format, not the new XML based @code{docx} format.  Use the @code{xml2} package
to read the latter.")
    (license license:gpl2)))

(define-public r-readtext
  (package
    (name "r-readtext")
    (version "0.91")
    (source
      (origin
        (method url-fetch)
        (uri (cran-uri "readtext" version))
        (sha256
          (base32
            "0bzaq0vx6c83i4xf7p9zwka7h7jbv1qfy6w4v3kljx30hl048dpn"))))
    (properties `((upstream-name . "readtext")))
    (build-system r-build-system)
    ;; Tests require Internet access.
    (arguments (list #:tests? #false))
    (propagated-inputs
     (list r-antiword
           r-data-table
           r-digest
           r-httr
           r-jsonlite
           r-pdftools
           r-pillar
           r-readods
           r-readxl
           r-streamr
           r-stringi
           r-striprtf
           r-xml2))
    (native-inputs (list r-knitr r-testthat))
    (home-page "https://github.com/quanteda/readtext")
    (synopsis "Import and handling for plain and formatted text files")
    (description
     "This package provides functions for importing and handling text files
and formatted text files with additional meta-data, such including @code{.csv},
@code{.tab}, @code{.json}, @code{.xml}, @code{.html}, @code{.pdf}, @code{.doc},
@code{.docx}, @code{.rtf}, @code{.xls}, @code{.xlsx}, and others.")
    (license license:gpl3)))

(define-public r-packcircles
  (package
    (name "r-packcircles")
    (version "0.3.7")
    (source
      (origin
        (method url-fetch)
        (uri (cran-uri "packcircles" version))
        (sha256
          (base32
            "17z3kmvszg3r6d6p4bagcrdamx13bpgq95mylwyv4wr9rvn5ph6d"))))
    (properties `((upstream-name . "packcircles")))
    (build-system r-build-system)
    (propagated-inputs (list r-checkmate r-rcpp))
    (native-inputs (list r-knitr))
    (home-page
      "https://github.com/mbedward/packcircles")
    (synopsis "Circle Packing")
    (description
      "Algorithms to find arrangements of non-overlapping circles.")
    (license license:expat)))

;; Cannot unbundle liblwgeom, because PostGIS does not support building it on
;; its own.
(define-public r-lwgeom
  (package
    (name "r-lwgeom")
    (version "0.2-14")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "lwgeom" version))
       (sha256
        (base32
         "174jpsri9xpr9zb5hvzqhbhnajqw3aa38ajy1skl7ky8vgvnrnr6"))))
    (properties `((upstream-name . "lwgeom")))
    (build-system r-build-system)
    (inputs
     (list geos proj sqlite zlib))
    (propagated-inputs
     (list r-rcpp r-sf r-units))
    (native-inputs (list pkg-config r-geosphere r-sp r-testthat))
    (home-page "https://github.com/r-spatial/lwgeom/")
    (synopsis "Bindings to Selected 'liblwgeom' Functions for Simple Features")
    (description
     "Access to selected functions found in
@url{https://github.com/postgis/postgis/tree/master/liblwgeom,liblwgeom}, the
light-weight geometry library used by @url{http://postgis.net/,PostGIS}.")
    (license license:gpl2)))

(define-public r-stars
  (package
    (name "r-stars")
    (version "0.6-8")
    (source
      (origin
        (method url-fetch)
        (uri (cran-uri "stars" version))
        (sha256
          (base32
            "136k3hspskj3sq8q1vs8vaysw7rdq303rdixdn15xyzzf1ss1wql"))))
    (properties
     '((upstream-name . "stars")
       (updater-extra-native-inputs
        . ("r-cubelyr" "r-exactextractr" "r-ncmeta"))
       ;; These haven't been packaged yet, but they also don't seem necessary.
       (updater-ignored-native-inputs
        . ("r-cubble" "r-ncdfgeom" "r-openstreetmap"))))
    (build-system r-build-system)
    (propagated-inputs
      (list r-abind r-classint r-rlang r-sf r-units))
    (native-inputs (list r-cubelyr
                         r-dplyr
                         r-exactextractr
                         r-ggplot2
                         r-knitr
                         r-maps
                         r-ncmeta
                         r-raster
                         r-rnetcdf
                         r-sp
                         r-terra
                         r-testthat
                         r-xts))
    (home-page "https://r-spatial.github.io/stars/")
    (synopsis "Spatiotemporal arrays, raster and vector data cubes")
    (description
     "This is a package for reading, manipulating, writing and plotting
spatiotemporal arrays (raster and vector data cubes) in @code{R}, using
@code{GDAL} bindings provided by @code{sf}, and @code{NetCDF} bindings by
@code{ncmeta} and @code{RNetCDF}.")
    (license license:asl2.0)))

(define-public r-tmaptools
  (package
    (name "r-tmaptools")
    (version "3.2")
    (source
      (origin
        (method url-fetch)
        (uri (cran-uri "tmaptools" version))
        (sha256
          (base32
            "1fjhknc03nz66pvwvg3ifjsfgkqfc1il274zmm5fs3rqz74zhxya"))))
    (properties `((upstream-name . "tmaptools")))
    (build-system r-build-system)
    (propagated-inputs
      (list r-dichromat
            r-lwgeom
            r-magrittr
            r-rcolorbrewer
            r-sf
            r-stars
            r-units
            r-viridislite
            r-xml))
    (home-page
      "https://github.com/mtennekes/tmaptools")
    (synopsis "Thematic Map Tools")
    (description
      "Set of tools for reading and processing spatial data.  The aim is to
supply the workflow to create thematic maps.  This package also facilitates
@code{tmap}, the package for visualizing thematic maps.")
    (license license:gpl3)))

(define-public r-rwiener
  (package
    (name "r-rwiener")
    (version "1.3-3")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "RWiener" version))
       (sha256
        (base32 "0afrgflyfjv4jqm04had74zz4cs934zwvyxaan1r4qpg383kibpq"))))
    (properties `((upstream-name . "RWiener")))
    (build-system r-build-system)
    (home-page "https://github.com/yeagle/RWiener")
    (synopsis "Wiener process distribution functions")
    (description
     "This package provides Wiener process distribution functions, namely the
Wiener first passage time density, CDF, quantile and random functions.  It
additionally supplies a modelling function (@code{wdm}) and further methods
for the resulting object.")
    (license license:gpl2+)))

(define-public r-rworldmap
  (package
    (name "r-rworldmap")
    (version "1.3-8")
    (source
      (origin
        (method url-fetch)
        (uri (cran-uri "rworldmap" version))
        (sha256
          (base32
            "007avjl7jhllybp82illrn8v38a85j6xbzk5pvykfx8ayx4wc3m6"))))
    (properties `((upstream-name . "rworldmap")))
    (build-system r-build-system)
    (propagated-inputs
      (list r-fields r-raster r-sp r-terra))
    (home-page
      "https://github.com/AndySouth/rworldmap/")
    (synopsis "Mapping Global Data")
    (description
      "Enables mapping of country level and gridded user datasets.")
    (license license:gpl2+)))

(define-public r-rtweet
  (package
    (name "r-rtweet")
    (version "2.0.0")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "rtweet" version))
       (sha256
        (base32
         "1w41a1a5mgg06gvs468vrg9pax2nrnkiqhwllxmkk0i7s15gvi42"))))
    (properties `((upstream-name . "rtweet")))
    (build-system r-build-system)
    (propagated-inputs
     (list r-bit64
           r-curl
           r-httr
           r-httr2
           r-jsonlite
           r-lifecycle
           r-progress
           r-rlang
           r-tibble
           r-withr))
    (native-inputs (list r-knitr r-testthat))
    (home-page "https://docs.ropensci.org/rtweet/")
    (synopsis "Collect Twitter data")
    (description
     "This package implements tools designed to collect and organize Twitter
data via @url{https://developer.twitter.com/en/docs,Twitter's REST and stream
Application Program Interfaces (API)}.")
    (license license:expat)))

(define-public r-intervals
  (package
    (name "r-intervals")
    (version "0.15.5")
    (source
      (origin
        (method url-fetch)
        (uri (cran-uri "intervals" version))
        (sha256
          (base32
            "0p6fqw311fni5zaw4hy7zcsjrfmrvb03s4amj0szdr3yqki7p40i"))))
    (properties `((upstream-name . "intervals")))
    (build-system r-build-system)
    (home-page "https://github.com/edzer/intervals")
    (synopsis
      "Tools for Working with Points and Intervals")
    (description
      "Tools for working with and comparing sets of points and intervals.")
    (license license:artistic2.0)))

(define-public r-eyelinker
  (package
    (name "r-eyelinker")
    (version "0.2.1")
    (source
      (origin
        (method url-fetch)
        (uri (cran-uri "eyelinker" version))
        (sha256
          (base32
            "0wijd45p6j2qal6wnj7zywks8p9v3m9cmyp7axmk44mrjdjx2i71"))))
    (properties `((upstream-name . "eyelinker")))
    (build-system r-build-system)
    (propagated-inputs
      (list r-intervals r-readr r-stringi r-stringr r-tibble))
    (native-inputs (list r-knitr r-testthat))
    (home-page
      "https://github.com/a-hurst/eyelinker")
    (synopsis
      "Import ASC Files from EyeLink Eye Trackers")
    (description
      "Imports plain-text ASC data files from EyeLink eye trackers into
(relatively) tidy data frames for analysis and visualization.")
    (license license:gpl3)))

(define-public r-btm
  (package
    (name "r-btm")
    (version "0.3.7")
    (source
      (origin
        (method url-fetch)
        (uri (cran-uri "BTM" version))
        (sha256
          (base32
            "0lal2fr2lpaky03hrc1gb15kky3s5sr9rbkmrp3v9g2iksd7b5yb"))))
    (properties `((upstream-name . "BTM")))
    (build-system r-build-system)
    (propagated-inputs (list r-rcpp))
    (home-page "https://github.com/bnosac/BTM")
    (synopsis "Biterm Topic Models for Short Text")
    (description
      "Biterm Topic Models find topics in collections of short texts.  It is a
word co-occurrence based topic model that learns topics by modeling word-word
co-occurrences patterns which are called biterms.  This in contrast to
traditional topic models like Latent Dirichlet Allocation and Probabilistic
Latent Semantic Analysis which are word-document co-occurrence topic models.  A
biterm consists of two words co-occurring in the same short text window.  This
context window can for example be a twitter message, a short answer on a
survey, a sentence of a text or a document identifier.  The techniques are
explained in detail in the paper 'A Biterm Topic Model For Short Text' by
Xiaohui Yan, Jiafeng Guo, Yanyan Lan, Xueqi Cheng (2013)
@url{https://github.com/xiaohuiyan/xiaohuiyan.github.io/blob/master/paper/\
BTM-WWW13.pdf}.")
    (license license:asl2.0)))

(define-public r-delaporte
  (package
    (name "r-delaporte")
    (version "8.4.1")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "Delaporte" version))
       (sha256
        (base32
         "1gv0js21x5sh54vjkvyh41ph1ixk1nw7ajm111fwz95prd9wx04v"))))
    (properties `((upstream-name . "Delaporte")))
    (build-system r-build-system)
    (native-inputs (list gfortran))
    (home-page "https://github.com/aadler/Delaporte")
    (synopsis "Statistical functions for the Delaporte distribution")
    (description
     "This package provides probability mass, distribution, quantile,
random-variate generation, and method-of-moments parameter-estimation
functions for the Delaporte distribution with parameterization based on
Vose (2008).  The Delaporte is a discrete probability distribution which can
be considered the convolution of a negative binomial distribution with a
Poisson distribution.  Alternatively, it can be considered a counting
distribution with both Poisson and negative binomial components.  It has been
studied in actuarial science as a frequency distribution which has more
variability than the Poisson, but less than the negative binomial.")
    (license license:bsd-2)))

(define-public r-rjsonio
  (package
    (name "r-rjsonio")
    (version "2.0.0")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "RJSONIO" version))
       (sha256
        (base32
         "0ai0gfgszj4z65hgn6px8a5hhaf12y2rc2bra1cxdf3q0higiiz9"))))
    (properties `((upstream-name . "RJSONIO")))
    (build-system r-build-system)
    (home-page "https://cran.r-project.org/package=RJSONIO")
    (synopsis "Serialize R objects to JSON")
    (description
     "This is a package that allows conversion to and from data in JavaScript
Object Notation (JSON) format.  This allows R objects to be inserted into
Javascript/ECMAScript/ActionScript code and allows R programmers to read and
convert JSON content to R objects.  This is an alternative to the @code{rjson}
package.")
    (license license:bsd-3)))

(define-public r-revgeo
  (package
    (name "r-revgeo")
    (version "0.15")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "revgeo" version))
       (sha256
        (base32
         "1ns7d1817475lriss6wwgvdm6lj760p40yxqaifla13c2xb73a55"))))
    (properties `((upstream-name . "revgeo")))
    (build-system r-build-system)
    (propagated-inputs
     (list r-rcurl r-rjsonio))
    (home-page "https://cran.r-project.org/package=revgeo")
    (synopsis "Reverse geocoding")
    (description
     "The @code{revgeo} procedure allows you to use the Photon geocoder for
OpenStreetMap, Google Maps, and Bing to reverse geocode coordinate pairs with
minimal hassle.")
    (license license:gpl3+)))

(define-public r-qpcr
  (package
    (name "r-qpcr")
    (version "1.4-1")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "qpcR" version))
       (sha256
        (base32
         "1r01q7jv3w59yx1gc0qw91rq7rvdhqsi8y57sqqkmwyqfw2x2vsv"))))
    (properties `((upstream-name . "qpcR")))
    (build-system r-build-system)
    (propagated-inputs
     (list r-mass r-matrix r-minpack-lm r-rgl r-robustbase))
    (home-page "https://cran.r-project.org/package=qpcR")
    (synopsis "Modelling and analysis of real-time PCR data")
    (description
     "This is a package for model fitting, optimal model selection and
calculation of various features that are essential in the analysis of
quantitative real-time polymerase chain reaction (qPCR).")
    (license license:gpl2+)))

(define-public r-textplot
  (package
    (name "r-textplot")
    (version "0.2.2")
    (source
      (origin
        (method url-fetch)
        (uri (cran-uri "textplot" version))
        (sha256
          (base32
            "1ag2h365zsx0fxbl05s2yfhf1q13p40akvbqg4qwsb5ynh2a56bf"))))
    (properties `((upstream-name . "textplot")))
    (build-system r-build-system)
    (propagated-inputs
      (list r-data-table r-lattice r-matrix))
    (native-inputs (list r-knitr))
    (home-page "https://github.com/bnosac/textplot")
    (synopsis "Text Plots")
    (description
      "Visualise complex relations in texts.  This is done by providing
functionalities for displaying text co-occurrence networks, text correlation
networks, dependency relationships as well as text clustering.  Feel free to
join the effort of providing interesting text visualisations.")
    (license license:gpl2)))

(define-public r-gsa
  (package
    (name "r-gsa")
    (version "1.03.3")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "GSA" version))
       (sha256
        (base32
         "0b18b8n6dh3yx9vp5b7ym25590x9qrcbprs5vjnkj0zlj1hphnal"))))
    (properties `((upstream-name . "GSA")))
    (build-system r-build-system)
    (home-page "https://statweb.stanford.edu/~tibs/GSA/")
    (synopsis "Gene set analysis")
    (description "This package lets you determine the significance of
pre-defined sets of genes with respect to an outcome variable, such as a group
indicator, a quantitative variable or a survival time.")
    ;; Any version of the LGPL
    (license license:lgpl3+)))

(define-public r-gsalib
  (package
    (name "r-gsalib")
    (version "2.2.1")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "gsalib" version))
       (sha256
        (base32
         "145zyc2sqa0acn9crilpw5njms7w7ca3jgl499lhsahlb6ws98rx"))))
    (build-system r-build-system)
    (home-page "https://cran.r-project.org/web/packages/gsalib")
    (synopsis "Utility functions for GATK")
    (description "This package contains utility functions used by the Genome
Analysis Toolkit (GATK) to load tables and plot data.  The GATK is a toolkit
for variant discovery in high-throughput sequencing data.")
    (license license:expat)))

(define-public r-intrees
  (package
    (name "r-intrees")
    (version "1.4")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "inTrees" version))
       (sha256
        (base32 "18gbw7v4xbsxdifk32qga3h3j17w40ljs1mkk0b4fzwin9z4sh27"))))
    (properties `((upstream-name . "inTrees")))
    (build-system r-build-system)
    (propagated-inputs (list r-arules
                             r-data-table
                             r-gbm
                             r-rrf
                             r-xgboost
                             r-xtable))
    (home-page "https://cran.r-project.org/package=inTrees")
    (synopsis "Interpret Tree Ensembles")
    (description
     "For tree ensembles such as random forests, regularized random forests and
gradient boosted trees, this package provides functions for: extracting,
measuring and pruning rules; selecting a compact rule set; summarizing rules
into a learner; calculating frequent variable interactions; formatting rules in
latex code.  Reference: Interpreting tree ensembles with @code{inTrees} (Houtao
Deng, 2019, <doi:10.1007/s41060-018-0144-8>).")
    (license license:gpl3+)))

(define-public r-randomforestexplainer
  (package
    (name "r-randomforestexplainer")
    (version "0.10.1")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "randomForestExplainer" version))
       (sha256
        (base32 "1ny8c3vn2zvdx12avwvlm4lp648jigkrkcvnhf5qmj8rh0w069v0"))))
    (properties `((upstream-name . "randomForestExplainer")))
    (build-system r-build-system)
    (propagated-inputs (list r-data-table
                             r-dplyr
                             r-dt
                             r-ggally
                             r-ggplot2
                             r-ggrepel
                             r-randomforest
                             r-ranger
                             r-reshape2
                             r-rmarkdown))
    (native-inputs (list r-knitr r-testthat))
    (home-page "https://github.com/ModelOriented/randomForestExplainer")
    (synopsis
     "Explaining and Visualizing Random Forests in Terms of Variable Importance")
    (description
     "This package provides a set of tools to help explain which variables are most
important in a random forests.  Various variable importance measures are
calculated and visualized in different settings in order to get an idea on how
their importance changes depending on our criteria (Hemant Ishwaran and Udaya B.
Kogalur and Eiran Z. Gorodeski and Andy J. Minn and Michael S. Lauer (2010)
<doi:10.1198/jasa.2009.tm08622>, Leo Breiman (2001)
<doi:10.1023/A:1010933404324>).")
    (license (list license:gpl2+ license:gpl3+))))

(define-public r-randomforestsrc
  (package
    (name "r-randomforestsrc")
    (version "2.9.3")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "randomForestSRC" version))
       (sha256
        (base32
         "05ifvj49jv0n5p6k46milpgj9r10sc5aw23fypyyibdgwpwvwixw"))))
    (properties
     `((upstream-name . "randomForestSRC")))
    (build-system r-build-system)
    (home-page "https://cran.r-project.org/web/packages/randomForestSRC/")
    (synopsis "Random forests for survival, regression, and classification")
    (description
     "This package implements fast OpenMP parallel computing of Breiman's
random forests for survival, competing risks, regression and classification
based on Ishwaran and Kogalur's popular random survival forests (RSF) package.
It handles missing data and now includes multivariate, unsupervised forests,
quantile regression and solutions for class imbalanced data.  It provides a
fast interface using subsampling and confidence regions for variable
importance.")
    (license license:gpl3+)))

(define-public r-rrf
  (package
    (name "r-rrf")
    (version "1.9.4.1")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "RRF" version))
       (sha256
        (base32 "05sswrqjrwyyk9aha7fvvw78iymgv89y0asl5cqfl9fg7gsw9ghs"))))
    (properties `((upstream-name . "RRF")))
    (build-system r-build-system)
    (native-inputs (list gfortran))
    (home-page "https://sites.google.com/site/houtaodeng/rrf")
    (synopsis "Regularized random forest")
    (description
     "Feature Selection with Regularized Random Forest.  This package is based
on the @code{randomForest} package by Andy Liaw.  The key difference is the
@code{RRF()} function that builds a regularized random forest.  Fortran
original by Leo Breiman and Adele Cutler, R port by Andy Liaw and Matthew
Wiener, Regularized random forest for classification by Houtao Deng,
Regularized random forest for regression by Xin Guan.  Reference: Houtao
Deng (2013) <doi:10.48550/@code{arXiv.1306.0237>}.")
    (license license:gpl2+)))

(define-public r-contfrac
  (package
    (name "r-contfrac")
    (version "1.1-12")
    (source
      (origin
        (method url-fetch)
        (uri (cran-uri "contfrac" version))
        (sha256
          (base32
            "0sq5c7ny235yrkv2xc4insgxby6rvzc1qsj8h301cd2if3lwbgwm"))))
    (properties `((upstream-name . "contfrac")))
    (build-system r-build-system)
    (home-page
      "https://github.com/RobinHankin/contfrac")
    (synopsis "Continued Fractions")
    (description
      "Various utilities for evaluating continued fractions.")
    (license license:gpl2)))

(define-public r-coop
  (package
    (name "r-coop")
    (version "0.6-3")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "coop" version))
       (sha256
        (base32 "0ww99ssgawsgn6rqy838wbx6iirzdrzyxirvz084ih8j50blx420"))))
    (properties `((upstream-name . "coop")))
    (build-system r-build-system)
    (home-page "https://github.com/wrathematics/coop")
    (synopsis
     "Fast covariance, correlation, and cosine similarity computations")
    (description
     "R-coop offers implementations of covariance, correlation and cosine
similarity.  The implementations are fast and memory-efficient and their use
is resolved automatically based on the input data, handled by R's S3 methods.
Full descriptions of the algorithms and benchmarks are available in the
package vignettes.")
    (license license:bsd-2)))

(define-public r-elliptic
  (package
    (name "r-elliptic")
    (version "1.4-0")
    (source
      (origin
        (method url-fetch)
        (uri (cran-uri "elliptic" version))
        (sha256
          (base32
            "1dhba0yfxjd5rlqsxp5a7s2hclfkla9wigsr39dlma67l6qjjmxn"))))
    (properties `((upstream-name . "elliptic")))
    (build-system r-build-system)
    (inputs (list pari-gp))
    (propagated-inputs (list r-mass))
    (native-inputs (list r-calibrator r-emulator))
    (home-page "https://github.com/RobinHankin/elliptic")
    (synopsis "Weierstrass and Jacobi elliptic functions")
    (description
     "This package provides a suite of elliptic and related functions
including Weierstrass and Jacobi forms.  It also includes various tools for
manipulating and visualizing complex functions.")
    (license license:gpl2)))

(define-public r-hypergeo
  (package
    (name "r-hypergeo")
    (version "1.2-14")
    (source
      (origin
        (method url-fetch)
        (uri (cran-uri "hypergeo" version))
        (sha256
          (base32
            "1r3hcmp44qf1fqk7ipxs3918zfd30ksmb5bpmjvj1jj3amfrldxz"))))
    (properties `((upstream-name . "hypergeo")))
    (build-system r-build-system)
    (propagated-inputs
      (list r-contfrac r-desolve r-elliptic))
    (home-page
      "https://cran.r-project.org/web/packages/hypergeo/")
    (synopsis "The Gauss Hypergeometric Function")
    (description
      "The Gaussian hypergeometric function for complex numbers.")
    (license license:gpl2)))

(define-public r-gganimate
  (package
    (name "r-gganimate")
    (version "1.0.9")
    (source
      (origin
        (method url-fetch)
        (uri (cran-uri "gganimate" version))
        (sha256
          (base32
            "016nky797h4093qrpynq5rr1p7h4chpv1hyngpcs2csr1064rjmz"))))
    (properties `((upstream-name . "gganimate")))
    (build-system r-build-system)
    (arguments
     `(#:phases
       (modify-phases %standard-phases
         (add-after 'unpack 'absolute-paths
           (lambda* (#:key inputs #:allow-other-keys)
             (substitute* "R/renderers.R"
               (("'ffmpeg'")
                (string-append "'" (assoc-ref inputs "ffmpeg") "/bin/ffmpeg'"))))))))
    (inputs
      ;; For video output.
      (list ffmpeg))
    (propagated-inputs
      (list r-cli
            r-ggplot2
            r-glue
            r-lifecycle
            r-progress
            r-rlang
            r-scales
            r-stringi
            r-transformr
            r-tweenr
            r-vctrs
            ;; For GIF/SVG output. gifski is faster, but depends on Rust.
            r-magick
            ;; For HTML output.
            r-base64enc
            r-htmltools))
    (native-inputs (list r-knitr r-testthat))
    (home-page "https://gganimate.com")
    (synopsis "Grammar of Animated Graphics")
    (description
      "This package extends the grammar of graphics as implemented by
@code{ggplot2} to include the description of animation.  It does this by
providing a range of new grammar classes that can be added to the plot object
in order to customise how it should change with time.")
    (license license:expat)))

;; This library bundles ‘date’ from (gnu packages calendar). We cannot unbundle
;; it, because its C++ libtz.so is built with different compiler flags than
;; ours.
(define-public r-tzdb
 (package
    (name "r-tzdb")
    (version "0.5.0")
    (source
      (origin
        (method url-fetch)
        (uri (cran-uri "tzdb" version))
        (sha256
          (base32
            "1ns7ygy35lyya0cdaxxvvcqn7cm2422svnfinzfjywpsvcvm439q"))))
    (properties `((upstream-name . "tzdb")))
    (build-system r-build-system)
    (propagated-inputs (list r-cpp11))
    (native-inputs (list r-testthat))
    (home-page "https://github.com/r-lib/tzdb")
    (synopsis "Time Zone Database Information")
    (description
      "This package provides an up-to-date copy of the Internet Assigned
Numbers Authority (IANA) Time Zone Database.  It is updated periodically to
reflect changes made by political bodies to time zone boundaries, UTC offsets,
and daylight saving time rules.  Additionally, this package provides a C++
interface for working with the @code{date} library. @code{date} provides
comprehensive support for working with dates and date-times, which this package
exposes to make it easier for other R packages to utilize.  Headers are
provided for calendar specific calculations, along with a limited interface for
time zone manipulations.")
    (license license:expat)))

(define-public r-vroom
  (package
    (name "r-vroom")
    (version "1.6.5")
    (source
      (origin
        (method url-fetch)
        (uri (cran-uri "vroom" version))
        (sha256
          (base32
            "0qapkgn5k9g07l48scgln8y1k6fkkzsq5la5fjfh9if9b0ga5p3v"))))
    (properties `((upstream-name . "vroom")))
    (build-system r-build-system)
    (arguments
     (list
      #:phases
      '(modify-phases %standard-phases
         (add-after 'unpack 'disable-failing-test
           (lambda _
             ;; This test produces an unexpected warning.
             (substitute* "tests/testthat/test-vroom.R"
               (("expect_warning\\(expect_equal\\(as.data.frame\\(x\\), y\\), NA\\)") ""))))
         (add-before 'check 'set-timezone
           (lambda* (#:key inputs #:allow-other-keys)
             ;; Two tests would fail without this.
             (setenv "TZ" "UTC+1")
             (setenv "TZDIR"
                     (search-input-directory inputs
                                             "share/zoneinfo")))))))
    (propagated-inputs
     (list r-bit64
           r-cli
           r-cpp11
           r-crayon
           r-glue
           r-hms
           r-lifecycle
           r-progress
           r-rlang
           r-tibble
           r-tidyselect
           r-tzdb
           r-vctrs
           r-withr))
    (native-inputs (list r-knitr r-testthat tzdata-for-tests))
    (home-page "https://vroom.r-lib.org")
    (synopsis
      "Read and Write Rectangular Text Data")
    (description
      "This package reads and writes data files like @acronym{CSV},
@acronym{TSV} and @acronym{FWF}.  When reading it uses a quick initial indexing
step, then reads the values lazily, so only the data you actually use needs to
be read.  The writer formats the data in parallel and writes to disk
asynchronously from formatting.")
    (license license:expat)))

(define-public r-rmisc
  (package
    (name "r-rmisc")
    (version "1.5.1")
    (source (origin
              (method url-fetch)
              (uri (cran-uri "Rmisc" version))
              (sha256
               (base32
                "1h6jb0xwkyhm9lwm7nj9bhrb5dhrsifvkpqkrd594j1lz74dar8x"))))
    (build-system r-build-system)
    (propagated-inputs
     (list r-lattice r-plyr))
    (home-page "https://cran.r-project.org/web/packages/Rmisc/")
    (synopsis "Ryan Miscellaneous")
    (description "The Rmisc library contains functions for data analysis and
utility operations.")
    (license license:gpl3)))

(define-public r-rsq
  (package
    (name "r-rsq")
    (version "2.7")
    (source (origin
              (method url-fetch)
              (uri (cran-uri "rsq" version))
              (sha256
               (base32
                "1dnx7cn533wg5gqvggfpq3hfid924ccywxnw5sw0l50m4p0p1p5g"))))
    (properties `((upstream-name . "rsq")))
    (build-system r-build-system)
    (propagated-inputs
     (list r-deming
           r-deriv
           r-lme4
           r-mass
           r-matrix
           r-mcr
           r-nlme))
    (home-page "https://cran.r-project.org/package=rsq")
    (synopsis "R-squared and related measures")
    (description
     "Calculate generalized R-squared, partial R-squared, and partial correlation
coefficients for generalized linear (mixed) models (including quasi models
with well defined variance functions).")
    (license license:gpl2)))

(define-public r-webutils
  (package
    (name "r-webutils")
    (version "1.2.2")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "webutils" version))
       (sha256
        (base32 "07k6d37pscnbsqxg4rpxr0zxrylpv9z1f3s8c6nwd3fhpwjs4d55"))))
    (properties
     '((upstream-name . "webutils")
       (updater-extra-native-inputs . ("r-httpuv"))))
    (build-system r-build-system)
    (propagated-inputs
     (list r-curl r-jsonlite))
    (native-inputs (list r-httpuv r-testthat))
    (home-page "https://github.com/jeroen/webutils")
    (synopsis "Utility functions for developing web applications")
    (description
     "This package parses HTTP request data in @code{application/json},
@code{multipart/form-data}, or @code{application/x-www-form-urlencoded}
format.  It includes an example of hosting and parsing HTML form data in R
using either @code{httpuv} or @code{Rhttpd}.")
    (license license:expat)))

(define-public r-protolite
  (package
    (name "r-protolite")
    (version "2.3.1")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "protolite" version))
       (sha256
        (base32 "1k4p2sraxirjq746rx80pbnwjiafyr8r63j29ybky64x7zb6zm7f"))))
    (properties
     `((upstream-name . "protolite")
       (updater-extra-inputs . ("protobuf"))
       (updater-extra-native-inputs . ("protobuf"))))
    (build-system r-build-system)
    (inputs
     (list protobuf))
    (propagated-inputs
     (list r-jsonlite r-rcpp))
    (native-inputs
     (list pkg-config protobuf r-sf r-testthat))
    (home-page "https://github.com/jeroen/protolite")
    (synopsis "Highly optimized protocol buffer serializers")
    (description
     "This package provides pure C++ implementations for reading and writing
several common data formats based on Google protocol-buffers.  It currently
supports @code{rexp.proto} for serialized R objects, @code{geobuf.proto} for
binary geojson, and @code{mvt.proto} for vector tiles.  This package uses the
auto-generated C++ code by protobuf-compiler, hence the entire serialization
is optimized at compile time.  The @code{RProtoBuf} package on the other hand
uses the protobuf runtime library to provide a general-purpose toolkit for
reading and writing arbitrary protocol-buffer data in R.")
    (license license:expat)))

(define-public r-opencpu
  (package
    (name "r-opencpu")
    (version "2.2.14")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "opencpu" version))
       (sha256
        (base32 "0gq97fcjwycnxkn73fiwp2qs6pnbs81qsjk93vq3s9mj22rk7l04"))
       (snippet
        '(for-each delete-file
                   '("inst/test/jquery-1.10.2.min.js"
                     "inst/test/bootstrap/js/bootstrap.min.js")))))
    (properties
     `((upstream-name . "opencpu")
       (updater-ignored-inputs . ("apparmor"))
       (updater-extra-native-inputs . ("js-jquery"))))
    (build-system r-build-system)
    (arguments
     (list
      #:modules '((guix build utils)
                  (guix build r-build-system)
                  (srfi srfi-1))
      #:phases
      #~(modify-phases %standard-phases
          (add-after 'unpack 'process-javascript
            (lambda* (#:key inputs #:allow-other-keys)
              (with-directory-excursion "inst/test/"
                (call-with-values
                    (lambda ()
                      (unzip2
                       `((,(assoc-ref inputs "js-jquery")
                          "jquery-1.10.2.min.js")
                         ("bootstrap/js/bootstrap.js"
                          "bootstrap/js/bootstrap.min.js"))))
                  (lambda (sources targets)
                    (for-each (lambda (source target)
                                (format #true "Processing ~a --> ~a~%"
                                        source target)
                                (invoke "esbuild" source "--minify"
                                        (string-append "--outfile=" target)))
                              sources targets)))))))))
    (inputs
     (list pandoc))
    (propagated-inputs
     (list r-brew
           r-curl
           r-evaluate
           r-httpuv
           r-jsonlite
           r-knitr
           r-mime
           r-openssl
           r-protolite
           r-rappdirs
           r-remotes
           r-rlang
           r-sys
           r-vctrs
           r-webutils
           r-zip))
    (native-inputs
     `(("esbuild" ,esbuild)
       ("r-knitr" ,r-knitr)
       ("r-r-rsp" ,r-r-rsp)
       ("js-jquery"
        ,(origin
           (method url-fetch)
           (uri "https://code.jquery.com/jquery-1.10.2.js")
           (sha256
            (base32
             "0ah5ivczcv62rj8bxwam7ar0f4il544jbn983vwfvkykl506gpla"))))))
    (home-page "https://www.opencpu.org")
    (synopsis "API for embedded scientific computing")
    (description
     "This package provides a system for embedded scientific computing and
reproducible research with R.  The OpenCPU server exposes a simple but
powerful HTTP API for RPC and data interchange with R.  This provides a
reliable and scalable foundation for statistical services or building R web
applications.  The OpenCPU server runs either as a single-user development
server within the interactive R session, or as a multi-user stack based on
Apache2.")
    (license license:asl2.0)))

(define-public r-exactextractr
  (package
    (name "r-exactextractr")
    (version "0.10.0")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "exactextractr" version))
       (sha256
        (base32
         "1pj3145c20r4hnyyrynzmps96a4fpgn408lrl6b9bs79y33c6zwv"))))
    (properties
     '((upstream-name . "exactextractr")
       (updater-extra-native-inputs . ("r-ncdf4"))))
    (build-system r-build-system)
    (inputs (list geos))
    (propagated-inputs
     (list r-raster r-rcpp r-sf))
    (native-inputs
     (list r-ncdf4 r-knitr r-testthat))
    (home-page "https://isciences.gitlab.io/exactextractr/")
    (synopsis "Fast extraction from raster datasets using polygons")
    (description
     "This package provides a replacement for the @code{extract} function from
the @code{raster} package that is suitable for extracting raster values using
@code{sf} polygons.")
    (license license:asl2.0)))

(define-public r-stringfish
  (package
    (name "r-stringfish")
    (version "0.17.0")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "stringfish" version))
       (sha256
        (base32
         "0x6nad21q7shsl7wjzldb6si7j09dyxksrpq29cxphh79d0ga2ly"))))
    (properties
     '((upstream-name . "stringfish")
       (updater-extra-inputs . ("pcre2"))))
    (build-system r-build-system)
    (arguments
     (list
      ;; Tests require r-qs, which depends on this package.
      #:tests? #false
      #:phases
      #~(modify-phases %standard-phases
          (add-after 'unpack 'use-system-tbb
            (lambda _
              (setenv "TBB_ROOT" #$(this-package-input "tbb"))))
          (add-before 'install 'relax-gcc-14-strictness
            (lambda _
              ;; XXX FIXME: $HOME/.R/Makevars seems to be the only way to
              ;; set custom CFLAGS for R?
              (setenv "HOME" (getcwd))
              (mkdir-p ".R")
              (with-directory-excursion ".R"
                (with-output-to-file "Makevars"
                  (lambda _
                    (display (string-append
                              "CXXFLAGS=-g -O2"
                              " -Wno-error=changes-meaning\n"))))))))))
    (inputs (list pcre2 tbb-2020))
    (propagated-inputs
     (list r-rcpp r-rcppparallel))
    (native-inputs
     (list pkg-config r-knitr))
    (home-page "https://github.com/traversc/stringfish")
    (synopsis "Alternative string implementation")
    (description
     "This package provides an extendable, performant and multithreaded
@code{alt-string} implementation backed by C++ vectors and strings.")
    (license license:gpl3)))

(define-public r-rapiserialize
  (package
    (name "r-rapiserialize")
    (version "0.1.4")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "RApiSerialize" version))
       (sha256
        (base32
         "1jb31laigm6zbjr5l10xdfriblsz3yv0n09y4lbs34qglyn79f96"))))
    (properties `((upstream-name . "RApiSerialize")))
    (build-system r-build-system)
    (home-page
     "https://cran.r-project.org/package=RApiSerialize")
    (synopsis "R API serialization")
    (description
     "This package provides other packages with access to the internal R
serialization code.  Access to this code is provided at the C function level
by using the registration of native function mechanism.  Client packages
simply include a single header file RApiSerializeAPI.h provided by this
package.")
    (license license:gpl2+)))

(define-public r-qs
  (package
    (name "r-qs")
    (version "0.27.3")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "qs" version))
       (sha256
        (base32
         "0s24sggs2nxxdsfa1snd7bz2cmncxarv5s4v59a8r0i419fkf2vf"))))
    (properties
     '((upstream-name . "qs")
       (updater-extra-native-inputs . ("r-data-table" "r-dplyr"))))
    (build-system r-build-system)
    (arguments
     (list
      #:phases
      '(modify-phases %standard-phases
         ;; XXX: tests/correctness_testing.R aborts when doing a data.frame test.
         (add-after 'unpack 'disable-bad-tests
           (lambda _
             (delete-file "tests/correctness_testing.R"))))))
    (inputs (list lz4 zlib (list zstd "lib")))
    (propagated-inputs
     (list r-bh r-rapiserialize r-rcpp r-stringfish))
    (native-inputs
     (list pkg-config r-data-table r-dplyr r-knitr r-testthat))
    (home-page "https://github.com/traversc/qs")
    (synopsis "Quick serialization of R objects")
    (description
     "This package provides functions for quickly writing and reading any R
object to and from disk.")
    (license license:gpl3)))

(define-public r-tfruns
  (package
    (name "r-tfruns")
    (version "1.5.3")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "tfruns" version))
       (sha256
        (base32
         "0z0cbw4fr374s82ds0vdxmd37bbd6yrixwgby26qzkjr7dvzsbmy"))))
    (properties `((upstream-name . "tfruns")))
    (build-system r-build-system)
    (propagated-inputs
     (list r-base64enc
           r-config
           r-jsonlite
           r-magrittr
           r-reticulate
           r-rlang
           r-rstudioapi
           r-tidyselect
           r-whisker
           r-yaml))
    (native-inputs (list r-knitr r-testthat))
    (home-page "https://github.com/rstudio/tfruns")
    (synopsis "Training run tools for TensorFlow")
    (description
     "Create and manage unique directories for each TensorFlow training run.
This package provides a unique, time stamped directory for each run along with
functions to retrieve the directory of the latest run or latest several
runs.")
    (license license:asl2.0)))

(define-public r-zzlite
  (package
    (name "r-zzlite")
    (version "0.1.2")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "zzlite" version))
       (sha256
        (base32
         "0vi1slx2s4r5zf82lazqv0c3m12xq73wlgsbz6af4y00h0bkr3ps"))))
    (properties `((upstream-name . "zzlite")))
    (build-system r-build-system)
    (arguments
     (list
      #:phases
      '(modify-phases %standard-phases
         ;; These tests require internet access.
         (add-after 'unpack 'delete-bad-tests
           (lambda _
             (delete-file "tests/testthat/test-zz_format.R")
             (delete-file "tests/testthat/test-zz_get_info.R"))))))
    (propagated-inputs
     (list r-httr r-jsonlite))
    (native-inputs
     (list r-httptest r-knitr r-testthat))
    (home-page "https://cran.r-project.org/package=zzlite")
    (synopsis "Wrapper for the Zamzar file conversion API")
    (description
     "This package provides a minor collection of HTTP wrappers for the Zamzar
file conversion API.  The wrappers makes it easy to utilize the API and thus
convert between more than 100 different file formats (ranging from audio
files, images, movie formats, etc., etc.) through an R session.")
    (license license:gpl3)))

(define-public r-ztree
  (package
    (name "r-ztree")
    (version "1.0.7")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "zTree" version))
       (sha256
        (base32
         "005zk6wpchpss6865ki35yawgf668pn70163ah97rnfkhfaswm6y"))))
    (properties `((upstream-name . "zTree")))
    (build-system r-build-system)
    (propagated-inputs
     (list r-plyr))
    (home-page "https://cran.r-project.org/package=zTree")
    (synopsis "Functions to import data from z-Tree into R")
    (description
     "This package provides tools for reading @code{.xls} and @code{.sbj}
files which are written by the proprietary program z-Tree for developing and
carrying out economic experiments.")
    (license license:gpl3)))

(define-public r-distributionutils
  (package
    (name "r-distributionutils")
    (version "0.6-2")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "DistributionUtils" version))
       (sha256
        (base32
         "01fand751znsv519naldrii598yw3jlgjkws0v8h3mggr4jib3l0"))))
    (properties
     `((upstream-name . "DistributionUtils")))
    (build-system r-build-system)
    (native-inputs
     (list gfortran))
    (home-page "https://cran.r-project.org/package=DistributionUtils")
    (synopsis "Distribution utilities")
    (description
     "This package provides utilities for dealing with distributions.
Functionality includes sample skewness and kurtosis, log-histogram, tail
plots, moments by integration, changing the point about which a moment is
calculated, functions for testing distributions using inversion tests and the
Massart inequality.  Also included is an implementation of the incomplete
Bessel K function.")
    (license license:gpl2+)))

(define-public r-ztpln
  (package
    (name "r-ztpln")
    (version "0.1.2")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "ztpln" version))
       (sha256
        (base32
         "1b22m72a8117yrgq5k1gzsrbx6yrsrj7bpd49lh7x3vbaz56c0wr"))))
    (properties `((upstream-name . "ztpln")))
    (build-system r-build-system)
    (propagated-inputs
     (list r-distributionutils r-mixtools r-rcpp r-rcppeigen
           r-rcppnumerical))
    (native-inputs
     (list r-knitr r-testthat))
    (home-page "https://github.com/mattocci27/ztpln")
    (synopsis "Zero-truncated Poisson lognormal distribution")
    (description
     "This package provides functions for obtaining the density, random
variates and maximum likelihood estimates of the Zero-truncated Poisson
lognormal distribution and their mixture distribution.")
    (license license:expat)))

(define-public r-zscorer
  (package
    (name "r-zscorer")
    (version "0.3.1")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "zscorer" version))
       (sha256
        (base32
         "0aijhs0fyird5gq68x4dxchb02mxa7ijk10k9zjhngghxbjj7iqn"))))
    (properties `((upstream-name . "zscorer")))
    (build-system r-build-system)
    (propagated-inputs
     (list r-shiny))
    (native-inputs
     (list r-knitr r-testthat))
    (home-page "https://github.com/nutriverse/zscorer")
    (synopsis "Child Anthropometry z-Score Calculator")
    (description
     "This package provides a tool for calculating z-scores and centiles for
weight-for-age, length/height-for-age, weight-for-length/height, BMI-for-age,
head circumference-for-age, age circumference-for-age, subscapular
skinfold-for-age, triceps skinfold-for-age based on the WHO Child Growth
Standards.")
    (license license:agpl3+)))

(define-public r-zra
  (package
    (name "r-zra")
    (version "0.2")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "ZRA" version))
       (sha256
        (base32
         "1sx1q5yf68hhlb5j1hicpj594rmgajqr25llg7ax416j0m2rnagi"))))
    (properties `((upstream-name . "ZRA")))
    (build-system r-build-system)
    (propagated-inputs
     (list r-dygraphs r-forecast))
    (home-page "https://cran.r-project.org/package=ZRA")
    (synopsis "Dynamic plots for time series forecasting")
    (description
     "This package combines a forecast of a time series, using the function @code{forecast},
with the dynamic plots from @code{dygraphs}.")
    (license license:gpl2+)))

(define-public r-rfigshare
  (package
    (name "r-rfigshare")
    (version "0.3.8")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "rfigshare" version))
       (sha256
        (base32
         "10shwl1y9220m7ld5w9fjsjzy5yg8myrz9cz97ps9z2bw7bvka5j"))))
    (properties `((upstream-name . "rfigshare")))
    (build-system r-build-system)
    ;; Tests attempt to connect to api.figshare.com
    (arguments (list #:test-types '(list "vignettes")))
    (propagated-inputs
     (list r-ggplot2
           r-httpuv
           r-httr
           r-rjsonio
           r-xml
           r-yaml))
    (native-inputs
     (list r-knitr r-testthat))
    (home-page "https://github.com/ropensci/rfigshare")
    (synopsis "R Interface to figshare")
    (description
     "This package provides an interface to figshare, a scientific repository
to archive and assign DOIs to data, software, figures, and more.")
    (license license:cc0)))

(define-public r-dismo
  (package
    (name "r-dismo")
    (version "1.3-16")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "dismo" version))
       (sha256
        (base32
         "0lr0cgs2ldihq0pfi1rxs7bzrii832g979r88dplm98lankj75p7"))
       (snippet
        '(for-each delete-file
                   (list "inst/java/dismo.jar"
                         "inst/java/maxent.jar")))))
    (properties
     `((upstream-name . "dismo")
       (updater-extra-inputs . ("java-maxent"))
       (updater-ignored-inputs . ("openjdk"))))
    (build-system r-build-system)
    (arguments
     (list
      #:modules '((guix build utils)
                  (guix build r-build-system)
                  ((guix build ant-build-system) #:prefix java:))
      #:imported-modules
      (cons '(guix build ant-build-system)
            %r-build-system-modules)
      #:phases
      #~(modify-phases %standard-phases
          (add-after 'unpack 'build-jars
            (lambda* (#:key inputs #:allow-other-keys)
              (let ((maxent (search-input-file inputs
                                               "/share/java/maxent/maxent.jar")))
                (install-file maxent "inst/java/")
                (with-directory-excursion "java"
                  (invoke "javac" "-cp" maxent "mebridge.java")
                  (invoke "jar" "cvf" "../inst/java/dismo.jar"
                          "mebridge.class")))))
          (add-after 'install 'strip-jar-timestamps
            (assoc-ref java:%standard-phases 'strip-jar-timestamps)))))
    (inputs
     (list java-maxent))
    (propagated-inputs
     (list r-raster r-rcpp r-sp r-terra))
    (native-inputs
     (list `(,icedtea-8 "jdk") zip))
    (home-page "https://rspatial.org/raster/sdm/")
    (synopsis "Species distribution modeling")
    (description
     "This package provides methods for species distribution modeling, i.e.,
predicting the environmental similarity of any site to that of the locations
of known occurrences of a species.")
    (license license:gpl3+)))

(define-public r-paws-common
  (package
    (name "r-paws-common")
    (version "0.8.4")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "paws.common" version))
       (sha256
        (base32
         "11wsmrpca02x4jhg4msi3l0gk2jkpd4i0zk2pdxlsqry6v9hvjgm"))))
    (properties
     '((upstream-name . "paws.common")
       (updater-ignored-native-inputs . ("r-iam"))))
    (build-system r-build-system)
    (arguments
     (list
      #:phases
      '(modify-phases %standard-phases
         ;; These tests require internet access.
         (add-after 'unpack 'delete-bad-tests
           (lambda _
             (delete-file "tests/testthat/test_logging.R")
             (delete-file "tests/testthat/test_net.R"))))))
    (propagated-inputs
     (list r-base64enc
           r-curl
           r-digest
           r-httr2
           r-jsonlite
           r-rcpp
           r-xml2))
    (native-inputs (list r-mockery r-testthat r-withr))
    (home-page "https://cran.r-project.org/package=paws.common")
    (synopsis "Paws low-level Amazon Web Services API")
    (description
     "This package provides functions for making low-level API requests to
Amazon Web Services.  The functions handle building, signing, and sending
requests, and receiving responses.  They are designed to help build
higher-level interfaces to individual services, such as Simple Storage
Service (S3).")
    (license license:asl2.0)))

(define-public r-paws-customer-engagement
  (package
    (name "r-paws-customer-engagement")
    (version "0.9.0")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "paws.customer.engagement" version))
       (sha256
        (base32
         "079mjaw4jpszkws21j7p74rcyc4idpn8f2zjhxxs6hcvs9sn39a6"))))
    (properties
     '((upstream-name . "paws.customer.engagement")
       (updater-ignored-native-inputs . ("r-paws"))))
    (build-system r-build-system)
    (propagated-inputs
     (list r-paws-common))
    (home-page "https://github.com/paws-r/paws")
    (synopsis "Amazon Web Services customer engagement services")
    (description
     "This package provides an interface to Amazon Web Services customer
engagement services, including Simple Email Service, Connect contact center
service, and more.")
    (license license:asl2.0)))

(define-public r-paws-cost-management
  (package
    (name "r-paws-cost-management")
    (version "0.9.0")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "paws.cost.management" version))
       (sha256
        (base32
         "01ws2f3nkb00xwxjm1vv4z23p0didh6i52d75x7jyq17aqizgd0p"))))
    (properties
     '((upstream-name . "paws.cost.management")
       (updater-ignored-native-inputs . ("r-paws"))))
    (build-system r-build-system)
    (propagated-inputs
     (list r-paws-common))
    (home-page "https://github.com/paws-r/paws")
    (synopsis "Amazon Web Services cost management services")
    (description
     "This package provides an interface to Amazon Web Services cost
management services, including cost and usage reports, budgets, pricing, and
more.")
    (license license:asl2.0)))

(define-public r-paws-developer-tools
  (package
    (name "r-paws-developer-tools")
    (version "0.9.0")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "paws.developer.tools" version))
       (sha256
        (base32 "1b2df0pby3fjbsjz6xw1x6h74jvnpjvdpkww8a9d7va76fgbn8lp"))))
    (properties
     '((upstream-name . "paws.developer.tools")
       (updater-ignored-native-inputs . ("r-paws"))))
    (build-system r-build-system)
    (propagated-inputs
     (list r-paws-common))
    (home-page "https://github.com/paws-r/paws")
    (synopsis "Amazon Web Services developer tools services")
    (description
     "This package provides an interface to Amazon Web Services developer
tools services, including version control, continuous integration and
deployment, and more.")
    (license license:asl2.0)))

(define-public r-paws-end-user-computing
  (package
    (name "r-paws-end-user-computing")
    (version "0.9.0")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "paws.end.user.computing" version))
       (sha256
        (base32 "1ijzdlsbj15kgk0m8xkpmjbb2wgpkzb1i6kiz109h6h6fr6lmwjv"))))
    (properties
     '((upstream-name . "paws.end.user.computing")
       (updater-ignored-native-inputs . ("r-paws"))))
    (build-system r-build-system)
    (propagated-inputs
     (list r-paws-common))
    (home-page "https://github.com/paws-r/paws")
    (synopsis "Amazon Web Services end user computing services")
    (description
     "This package provides an interface to Amazon Web Services end user
computing services, including collaborative document editing, mobile intranet,
and more.")
    (license license:asl2.0)))

(define-public r-paws-application-integration
  (package
    (name "r-paws-application-integration")
    (version "0.9.0")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "paws.application.integration" version))
       (sha256
        (base32
         "0j72ly19khlzvxxg2i5dg15dka78khwsiiwg4vp1czwvvy7lldy6"))))
    (properties
     '((upstream-name . "paws.application.integration")
       (updater-ignored-native-inputs . ("r-paws"))))
    (build-system r-build-system)
    (propagated-inputs
     (list r-paws-common))
    (home-page "https://github.com/paws-r/paws")
    (synopsis "Amazon Web Services application integration services")
    (description
     "This package provides an interface to Amazon Web Services application
integration services, including Simple Queue Service (SQS) message queue,
Simple Notification Service (SNS) publish/subscribe messaging, and more.")
    (license license:asl2.0)))

(define-public r-paws-security-identity
  (package
    (name "r-paws-security-identity")
    (version "0.9.0")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "paws.security.identity" version))
       (sha256
        (base32
         "1v93ybjlbnkpw2rknsq8fr7iqj9yk4f8ixij0h7sxnwq6xn3jyzl"))))
    (properties
     '((upstream-name . "paws.security.identity")
       (updater-ignored-native-inputs . ("r-paws"))))
    (build-system r-build-system)
    (propagated-inputs
     (list r-paws-common))
    (home-page "https://github.com/paws-r/paws")
    (synopsis "Amazon Web Services security, identity, and compliance services")
    (description
     "This package provides an interface to Amazon Web Services security,
identity, and compliance services, including the Identity and Access
Management (IAM) service for managing access to services and resources, and
more.")
    (license license:asl2.0)))

(define-public r-paws-analytics
  (package
    (name "r-paws-analytics")
    (version "0.9.0")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "paws.analytics" version))
       (sha256
        (base32
         "0l53k9n78wb0w6fhgmk1z3yqpijb0f162a8bz90b14jmx3fsdsa0"))))
    (properties
     '((upstream-name . "paws.analytics")
       (updater-ignored-native-inputs . ("r-paws"))))
    (build-system r-build-system)
    (propagated-inputs
     (list r-paws-common))
    (home-page "https://github.com/paws-r/paws")
    (synopsis "Amazon Web Services analytics services")
    (description
     "This package provides an interface to Amazon Web Services analytics
services, including Elastic MapReduce Hadoop and Spark big data service,
Elasticsearch search engine, and more.")
    (license license:asl2.0)))

(define-public r-paws-machine-learning
  (package
    (name "r-paws-machine-learning")
    (version "0.9.0")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "paws.machine.learning" version))
       (sha256
        (base32
         "1y72smpmfzizh5433v5971p3bkbmcsq9rrw1rp2ih9m1v6hxnx1d"))))
    (properties
     '((upstream-name . "paws.machine.learning")
       (updater-ignored-native-inputs . ("r-paws"))))
    (build-system r-build-system)
    (propagated-inputs
     (list r-paws-common))
    (home-page "https://github.com/paws-r/paws")
    (synopsis "Amazon Web Services machine learning services")
    (description
     "This package provides an interface to Amazon Web Services machine
learning services, including SageMaker managed machine learning service,
natural language processing, speech recognition, translation, and more.")
    (license license:asl2.0)))

(define-public r-paws-management
  (package
    (name "r-paws-management")
    (version "0.9.0")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "paws.management" version))
       (sha256
        (base32
         "0lc4dq1nyawlfxnab22fzcdpg67h57lk32l5kvf2b89kil6pzn2k"))))
    (properties
     '((upstream-name . "paws.management")
       (updater-ignored-native-inputs . ("r-paws"))))
    (build-system r-build-system)
    (propagated-inputs
     (list r-paws-common))
    (home-page "https://github.com/paws-r/paws")
    (synopsis "Amazon Web Services management and governance services")
    (description
     "This package provides an interface to Amazon Web Services management and
governance services, including CloudWatch application and infrastructure
monitoring, Auto Scaling for automatically scaling resources, and more.")
    (license license:asl2.0)))

(define-public r-paws-networking
  (package
    (name "r-paws-networking")
    (version "0.9.0")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "paws.networking" version))
       (sha256
        (base32
         "1nl0dg0saigqkv5qq2mqbxcb1552qyizfa3j0lpsfarhz61x90jd"))))
    (properties
     '((upstream-name . "paws.networking")
       (updater-ignored-native-inputs . ("r-paws"))))
    (build-system r-build-system)
    (propagated-inputs
     (list r-paws-common))
    (home-page "https://github.com/paws-r/paws")
    (synopsis "Amazon Web Services networking and content delivery services")
    (description
     "This package provides an interface to Amazon Web Services networking and
content delivery services, including Route 53 Domain Name System service,
CloudFront content delivery, load balancing, and more.")
    (license license:asl2.0)))

(define-public r-paws-database
  (package
    (name "r-paws-database")
    (version "0.9.0")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "paws.database" version))
       (sha256
        (base32
         "0ml0cbjggzajqbirq3lk6gv6kb9im5pc3vc2bj8rfv01y1a0ha0m"))))
    (properties
     '((upstream-name . "paws.database")
       (updater-ignored-native-inputs . ("r-paws"))))
    (build-system r-build-system)
    (propagated-inputs
     (list r-paws-common))
    (home-page "https://github.com/paws-r/paws")
    (synopsis
     "Amazon Web Services Database Services")
    (description
     "This package provides an interface to Amazon Web Services database
services, including Relational Database Service (RDS), DynamoDB NoSQL
database, and more.")
    (license license:asl2.0)))

(define-public r-paws-storage
  (package
    (name "r-paws-storage")
    (version "0.9.0")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "paws.storage" version))
       (sha256
        (base32
         "0f2h58svjziijglnk8bl702pygr4pwx9bicqh9j0blhwgi104gp5"))))
    (properties
     '((upstream-name . "paws.storage")
       (updater-ignored-native-inputs . ("r-paws"))))
    (build-system r-build-system)
    (propagated-inputs
     (list r-paws-common))
    (home-page "https://github.com/paws-r/paws")
    (synopsis "Amazon Web Services storage services")
    (description
     "This package provides an interface to Amazon Web Services storage
services, including Simple Storage Service (S3).")
    (license license:asl2.0)))

(define-public r-paws-compute
  (package
    (name "r-paws-compute")
    (version "0.9.0")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "paws.compute" version))
       (sha256
        (base32
         "0vhqbsidam05phiv43idyp6gxa47vdp523m0w3casky5wa0i09my"))))
    (properties
     '((upstream-name . "paws.compute")
       (updater-ignored-native-inputs . ("r-paws"))))
    (build-system r-build-system)
    (propagated-inputs
     (list r-paws-common))
    (home-page "https://github.com/paws-r/paws")
    (synopsis "Amazon Web Services compute services")
    (description
     "This package provides an interface to Amazon Web Services compute
services, including Elastic Compute Cloud (EC2), Lambda
functions-as-a-service, containers, batch processing, and more.")
    (license license:asl2.0)))

(define-public r-paws
  (package
    (name "r-paws")
    (version "0.9.0")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "paws" version))
       (sha256
        (base32
         "1qrj24yz9cnlg1hw8siyrjvi9z7899628cgzgfm2gfyg77hl9m8j"))))
    (properties `((upstream-name . "paws")))
    (build-system r-build-system)
    (propagated-inputs
     (list r-paws-analytics
           r-paws-application-integration
           r-paws-common
           r-paws-compute
           r-paws-cost-management
           r-paws-customer-engagement
           r-paws-database
           r-paws-developer-tools
           r-paws-end-user-computing
           r-paws-machine-learning
           r-paws-management
           r-paws-networking
           r-paws-security-identity
           r-paws-storage))
    (home-page "https://github.com/paws-r/paws")
    (synopsis "Amazon Web Services software development kit")
    (description
     "This package provides an interface to Amazon Web Services, including
storage, database, and compute services, such as Simple Storage Service (S3),
DynamoDB NoSQL database, and Lambda functions-as-a-service.")
    (license license:asl2.0)))

(define-public r-zoomgroupstats
  (package
    (name "r-zoomgroupstats")
    (version "0.1.0")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "zoomGroupStats" version))
       (sha256
        (base32
         "0gndiq92cy6gi7f833hdjvqii3cn83wz5rjvygcvjl3dw4pwv966"))))
    (properties
     '((upstream-name . "zoomGroupStats")
       (updater-extra-native-inputs . ("tzdata-for-tests"))))
    (build-system r-build-system)
    (arguments
     (list
      #:phases
      '(modify-phases %standard-phases
         (add-before 'check 'set-timezone
           (lambda* (#:key inputs #:allow-other-keys)
             (setenv "TZ" "UTC")
             (setenv "TZDIR"
                     (search-input-directory inputs
                                             "share/zoneinfo")))))))
    (propagated-inputs
     (list r-data-table
           r-dplyr
           r-lubridate
           r-magick
           r-openxlsx
           r-paws
           r-pbapply
           r-stringr
           r-syuzhet))
    (native-inputs (list r-knitr r-testthat tzdata-for-tests))
    (home-page "http://zoomgroupstats.org")
    (synopsis "Analyze text, audio, and video from Zoom meetings")
    (description
     "This package provides utilities for processing and analyzing the files
that are exported from a recorded Zoom meeting.  This includes analyzing data
captured through video cameras and microphones, the text-based chat, and
meta-data.  You can analyze aspects of the conversation among meeting
participants and their emotional expressions throughout the meeting.")
    (license license:expat)))

(define-public r-zoom
  (package
    (name "r-zoom")
    (version "2.0.6")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "zoom" version))
       (sha256
        (base32
         "05ikad4j1qi5y8mn77n9bw7d6ic3api9d7mbcn855w8xcc69ja4q"))))
    (properties `((upstream-name . "zoom")))
    (build-system r-build-system)
    ;; FIXME Tests fail with: could not find function "test_that", even though
    ;; r-testthat is available.
    (arguments (list #:tests? #false))
    (native-inputs (list r-testthat))
    (home-page "https://github.com/cbarbu/R-package-zoom")
    (synopsis "Spatial data visualization tool")
    (description
     "This package provides @code{zm}, a utility that allows you to
zoom/navigate any plot when called with any active plot.")
    (license license:gpl3+)))

(define-public r-zoolog
  (package
    (name "r-zoolog")
    (version "1.1.0")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "zoolog" version))
       (sha256
        (base32
         "06g44gjk9w73996n4h1a2q8kcd6q2mvm1vhx0iq0785gvrz18pj9"))))
    (properties `((upstream-name . "zoolog")))
    (build-system r-build-system)
    (propagated-inputs
     (list r-rdpack r-stringi))
    (native-inputs
     (list r-knitr r-testthat))
    (home-page "https://josempozo.github.io/zoolog/")
    (synopsis "Zooarchaeological analysis with log-ratios")
    (description
     "This package includes functions and reference data to generate and
manipulate log-ratios (also known as @dfn{log size index} (LSI) values) from
measurements obtained on zooarchaeological material.  Log ratios are used to
compare the relative (rather than the absolute) dimensions of animals from
archaeological contexts.  The zoolog package is also able to seamlessly
integrate data and references with heterogeneous nomenclature, which is
internally managed by a zoolog thesaurus.")
    (license license:gpl3)))

(define-public r-filehash
  (package
    (name "r-filehash")
    (version "2.4-6")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "filehash" version))
       (sha256
        (base32
         "1cc1xq6vpk5cmsr4w5i6nvkx36grd38dds4lys4gmijlldml92sm"))))
    (properties `((upstream-name . "filehash")))
    (build-system r-build-system)
    (propagated-inputs (list r-digest))
    (home-page "http://github.com/rdpeng/filehash")
    (synopsis "Simple key-value database")
    (description
     "This package implements a simple key-value style database where
character string keys are associated with data values that are stored on the
disk.  A simple interface is provided for inserting, retrieving, and deleting
data from the database.  Utilities are provided that allow filehash databases
to be treated much like environments and lists are already used in R.  These
utilities are provided to encourage interactive and exploratory analysis on
large datasets.")
    (license license:gpl2+)))

(define-public r-mlearning
  (package
    (name "r-mlearning")
    (version "1.2.1")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "mlearning" version))
       (sha256
        (base32
         "0fh28i36smpybhzd2kni435m7wf20i3yib6h7jy173r1v5adzkba"))))
    (properties `((upstream-name . "mlearning")))
    (build-system r-build-system)
    (propagated-inputs
     (list r-class
           r-e1071
           r-ipred
           r-mass
           r-nnet
           r-randomforest
           r-rpart))
    (native-inputs (list r-testthat))
    (home-page "https://www.sciviews.org/zooimage")
    (synopsis "Machine learning algorithms with unified interface")
    (description
     "This package provides a unified interface to various machine learning
algorithms.  Confusion matrices are provided too.")
    (license license:gpl2+)))

(define-public r-zooimage
  (package
    (name "r-zooimage")
    (version "5.5.2")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "zooimage" version))
       (sha256
        (base32
         "0ck8w0zb9l1n9xvjwqshq9q9l8pigy3yslq2hnfbgcwk17kk9mp8"))))
    (properties `((upstream-name . "zooimage")))
    (build-system r-build-system)
    (propagated-inputs
     (list r-digest
           r-dt
           r-filehash
           r-jpeg
           r-mass
           r-mda
           r-mlearning
           r-png
           r-shiny
           r-svdialogs
           r-svmisc
           r-tiff))
    (native-inputs (list r-testthat))
    (home-page "https://www.sciviews.org/zooimage")
    (synopsis "Analysis of numerical plankton images")
    (description
     "This package provides a solution for analyzing digital images of
plankton.  In combination with ImageJ, an image analysis system, it processes
digital images, measures individuals, trains for automatic classification of
taxa, and finally, measures plankton samples (abundances, total and partial
size spectra or biomasses, etc.).")
    (license license:gpl2+)))

(define-public r-zooarch
  (package
    (name "r-zooarch")
    (version "1.2")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "zooaRch" version))
       (sha256
        (base32
         "0grc378xppv0303sf4flfqz5002vq5a23nzbq4bsff41rww7dihc"))))
    (properties `((upstream-name . "zooaRch")))
    (build-system r-build-system)
    (propagated-inputs (list r-ggplot2))
    (native-inputs (list r-knitr))
    (home-page
     "https://cran.r-project.org/package=zooaRch")
    (synopsis
     "Analytical Tools for Zooarchaeological Data")
    (description
     "The analysis and inference of faunal remains recovered from
archaeological sites concerns the field of zooarchaeology.  The zooaRch
package provides analytical tools to make inferences on zooarchaeological
data.  Functions in this package allow users to read, manipulate, visualize,
and analyze zooarchaeological data.")
    (license license:gpl2+)))

(define-public r-zonebuilder
  (package
    (name "r-zonebuilder")
    (version "0.1.0")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "zonebuilder" version))
       (sha256
        (base32
         "1m58bhk2hfpm2n35af506plyapgsak31q1z0wp0jc7v7447bvzyx"))))
    (properties `((upstream-name . "zonebuilder")))
    (build-system r-build-system)
    (propagated-inputs
     (list r-rcolorbrewer r-sf))
    (native-inputs
     (list r-knitr))
    (home-page "https://github.com/zonebuilders/zonebuilder")
    (synopsis "Create and explore geographic zoning systems")
    (description
     "This package provides functions, documentation and example data to help
divide geographic space into discrete polygons (zones).  The functions are
motivated by research into the merits of different zoning systems.  A flexible
@code{ClockBoard} zoning system is provided, which breaks-up space by
concentric rings and radial lines emanating from a central point.")
    (license license:gpl3)))

(define-public r-mmwrweek
  (package
    (name "r-mmwrweek")
    (version "0.1.3")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "MMWRweek" version))
       (sha256
        (base32
         "1l1ks44v52iggw9nhs56lfj6804yab5b17k8fzrc6h1kvj3vda0s"))))
    (properties `((upstream-name . "MMWRweek")))
    (build-system r-build-system)
    ;; FIXME Tests fail with: could not find function "context"
    (arguments (list #:tests? #false))
    (native-inputs (list r-testthat))
    (home-page "http://wwwn.cdc.gov/nndss/document/MMWR_Week_overview.pdf")
    (synopsis "Convert dates to MMWR day, week, and year")
    (description
     "The first day of any MMWR week is Sunday.  MMWR week numbering is
sequential beginning with 1 and incrementing with each week to a maximum of 52
or 53.  MMWR week #1 of an MMWR year is the first week of the year that has at
least four days in the calendar year.  This package provides functionality to
convert dates to MMWR day, week, and year and the reverse.")
    (license license:gpl2+)))

(define-public r-cca
  (package
    (name "r-cca")
    (version "1.2.2")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "CCA" version))
       (sha256
        (base32 "0r1f7m64608hq6bpw36wsw6fr4s8bj26x4062brqgn5dbpqlgczk"))))
    (properties `((upstream-name . "CCA")))
    (build-system r-build-system)
    (propagated-inputs (list r-fda r-fields))
    (home-page "https://cran.r-project.org/package=CCA")
    (synopsis "Canonical correlation analysis")
    (description
     "This package contains a set of functions that extend the @code{cancor}
function.  These functions provide new numerical and graphical outputs.  It
also includes a regularized extension of the canonical correlation analysis to
deal with datasets with more variables than observations.")
    (license license:gpl2+)))

(define-public r-cccd
  (package
    (name "r-cccd")
    (version "1.6")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "cccd" version))
       (sha256
        (base32 "0cxh19jqappc6zq9nz3m40ybdmsp12mf7yvflsz96wks3ly2ld4y"))))
    (properties `((upstream-name . "cccd")))
    (build-system r-build-system)
    (propagated-inputs (list r-deldir r-fnn r-igraph r-proxy))
    (home-page "https://cran.r-project.org/package=cccd")
    (synopsis "Class cover catch digraphs")
    (description
     "This package provides tools to create Class Cover Catch Digraphs,
neighborhood graphs, and relatives.")
    (license license:gpl2+)))

(define-public r-crul
  (package
    (name "r-crul")
    (version "1.5.0")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "crul" version))
       (sha256
        (base32
         "17dx3qhdssk0zanp73g0d7h3imhwh9ydzs009fbrspw1s9w3fwyv"))))
    (properties `((upstream-name . "crul")))
    (build-system r-build-system)
    (propagated-inputs
     (list r-curl
           r-httpcode
           r-jsonlite
           r-mime
           r-r6
           r-urltools))
    (native-inputs (list r-knitr r-testthat))
    (home-page "https://github.com/ropensci/crul")
    (synopsis "HTTP client")
    (description
     "This package provides a simple HTTP client, with tools for making HTTP
requests, and mocking HTTP requests.  The package is built on R6, and takes
inspiration from Ruby's @code{faraday} gem.")
    (license license:expat)))

(define-public r-gistr
  (package
    (name "r-gistr")
    (version "0.9.0")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "gistr" version))
       (sha256
        (base32
         "0ac9ikrdg6i8xvlma0gizvsdva46408lk7hvsgkqirhy2ljy02hp"))))
    (properties `((upstream-name . "gistr")))
    (build-system r-build-system)
    (propagated-inputs
     (list r-assertthat
           r-crul
           r-dplyr
           r-httr
           r-jsonlite
           r-knitr
           r-magrittr
           r-rmarkdown))
    (native-inputs (list r-knitr r-testthat))
    (home-page "https://github.com/ropensci/gistr")
    (synopsis "Work with Gists in browser")
    (description
     "This package allows the user to create new Github gists, update gists
with new files, rename files, delete files, get and delete gists, star and
un-star them, fork them, open a gist in your default browser, get an embed
code for a gist, list gist commits, and get rate limit information when
authenticated.")
    (license license:expat)))

(define-public r-rbokeh
  (package
    (name "r-rbokeh")
    (version "0.5.2")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "rbokeh" version))
       (sha256
        (base32
         "1h2fpzqf17pw9d09r1g1iyxsj5qma4fsk8vnar7f1z4fjyypvi6q"))
       (snippet
        '(for-each delete-file '("inst/htmlwidgets/lib/bokehjs/bokeh-widgets.min.js"
                                 "inst/htmlwidgets/lib/bokehjs/bokeh.min.js")))))
    (properties `((upstream-name . "rbokeh")))
    (build-system r-build-system)
    (arguments
     (list
      #:tests? #false ;XXX: the one included test fails for unknown reasons
      #:phases
      `(modify-phases %standard-phases
         (add-after 'unpack 'process-javascript
           (lambda* (#:key inputs #:allow-other-keys)
             (with-directory-excursion "inst/htmlwidgets/lib/bokehjs"
               (let ((mapping
                      `((,(assoc-ref inputs "js-bokeh-widgets")
                         . "bokeh-widgets.min.js")
                        (,(assoc-ref inputs "js-bokeh")
                         . "bokeh.min.js"))))
                 (for-each (lambda (source target)
                             (format #true "Processing ~a --> ~a~%"
                                     source target)
                             (invoke "esbuild" source "--minify"
                                     (string-append "--outfile=" target)))
                           (map car mapping)
                           (map cdr mapping)))))))))
    (propagated-inputs
     (list r-digest
           r-gistr
           r-hexbin
           r-htmlwidgets
           r-jsonlite
           r-lazyeval
           r-magrittr
           r-maps
           r-pryr
           r-scales))
    ;; Version 0.12.15 is mentioned in lib/htmlwidgets/rbokeh.yaml.
    (native-inputs
     `(("esbuild" ,esbuild)
       ("js-bokeh-widgets"
        ,(origin
           (method url-fetch)
           (uri "https://unpkg.com/bokehjs@0.12.15/build/js/bokeh-widgets.js")
           (sha256
            (base32
             "07v9lrkfcbdznpb10qqwi4m660zp65g85vlnfw7kn83zmkxkhhxy"))))
       ("js-bokeh"
        ,(origin
           (method url-fetch)
           (uri "https://unpkg.com/bokehjs@0.12.15/build/js/bokeh.js")
           (sha256
            (base32
             "1pq0059aad7d2jv50nv9449p3w0gbkxkl0mhblc76m5d9qjqav2q"))))
       ("r-knitr" ,r-knitr)
       ("r-testthat" ,r-testthat)))
    (home-page "https://cran.r-project.org/web/packages/rbokeh/")
    (synopsis "R interface for the Bokeh visualization library")
    (description
     "This package provides a native R plotting library that provides a
flexible declarative interface for creating interactive web-based graphics,
backed by the @url{https://bokeh.pydata.org/, Bokeh visualization library}.")
    (license license:expat)))

(define-public r-fauxpas
  (package
    (name "r-fauxpas")
    (version "0.5.2")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "fauxpas" version))
       (sha256
        (base32
         "1xhyws6nr9ayir4sykvhyaf1aprx9rjm2xyb3p5ikd26l5hp7l44"))))
    (properties `((upstream-name . "fauxpas")))
    (build-system r-build-system)
    (propagated-inputs
     (list r-httpcode r-r6 r-whisker))
    (native-inputs
     (list r-crul r-knitr r-testthat))
    (home-page "https://docs.ropensci.org/fauxpas")
    (synopsis "HTTP error helpers")
    (description
     "This package provides HTTP error helpers.  Methods are included for
general purpose HTTP error handling, as well as individual methods for every
HTTP status code, both via status code numbers as well as their descriptive
names.  It supports the ability to adjust behavior to stop, message or
warning.  It includes the ability to use a custom whisker template to have any
configuration of status code, short description, and verbose message.")
    (license license:expat)))

(define-public r-webmockr
  (package
    (name "r-webmockr")
    (version "2.0.0")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "webmockr" version))
       (sha256
        (base32
         "048skbz57f7xzg1c88j6hhpgyg4nnrx41w5wrh7lm0r71k2kaq2f"))))
    (properties
     '((upstream-name . "webmockr")
       (updater-extra-native-inputs . ("r-xml2"))
       ;; Avoid dependency cycle.
       (updater-ignored-native-inputs . ("r-vcr"))))
    (build-system r-build-system)
    (propagated-inputs
     (list r-cli
           r-crul
           r-curl
           r-fauxpas
           r-jsonlite
           r-magrittr
           r-r6
           r-rlang
           r-urltools))
    (native-inputs (list r-httr r-httr2 r-testthat r-xml2))
    (home-page "https://github.com/ropensci/webmockr")
    (synopsis "Stubbing and setting expectations on HTTP Requests")
    (description
     "This is a package for stubbing and setting expectations on HTTP
requests.  It includes tools for stubbing HTTP requests, including expected
request conditions and response conditions.  You can match on HTTP method,
query parameters, request body, headers and more.  It can be used for unit
tests or outside of a testing context.")
    (license license:expat)))

(define-public r-iotools
  (package
    (name "r-iotools")
    (version "0.3-5")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "iotools" version))
       (sha256
        (base32 "12xlf31aawj5sxanb2m63r665a9x5v87q4ig8qkvaygpdg51gycw"))))
    (properties `((upstream-name . "iotools")))
    (build-system r-build-system)
    (home-page "https://www.rforge.net/iotools")
    (synopsis "I/O tools for streaming")
    (description "This package provides basic I/O tools for streaming and data
parsing.")
    ;; GPL 2 or GPL 3.
    (license license:gpl3)))

(define-public r-whisker
  (package
    (name "r-whisker")
    (version "0.4.1")
    (source (origin
              (method url-fetch)
              (uri (cran-uri "whisker" version))
              (sha256
               (base32
                "1g7jy6dnc5igs7yqy1n7cmy0ia8dm2yi3qj1mil2y0q88m4m2ldz"))))
    (build-system r-build-system)
    ;; Fails with: could not find function "whisker.render"
    (arguments (list #:tests? #false))
    (home-page "https://github.com/edwindj/whisker")
    (synopsis "Logicless mustache templating for R")
    (description
     "This package provides logicless templating, with a syntax that is not
limited to R.")
    (license license:gpl3+)))

(define-public r-withr
  (package
    (name "r-withr")
    (version "3.0.2")
    (source (origin
              (method url-fetch)
              (uri (cran-uri "withr" version))
              (sha256
               (base32
                "18y1jbyf6b70zm0kyjdjhdzyskhsbaww3j0kpyjcqxfjjgs0afha"))))
    (build-system r-build-system)
    ;; Tests require r-testthat, which indirectly depends on this package.
    (arguments (list #:tests? #false))
    (native-inputs
     (list r-knitr))
    (home-page "https://github.com/jimhester/withr")
    (synopsis "Run code with temporarily modified global state")
    (description
     "This package provides a set of functions to run R code in an environment
in which global state has been temporarily modified.  Many of these functions
were originally a part of the r-devtools package.")
    (license license:gpl2+)))

(define-public r-wordspace
  (package
    (name "r-wordspace")
    (version "0.2-8")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "wordspace" version))
       (sha256
        (base32 "17fqd4zrsklv2ik3lg00x66yasfh1kyhs3k9ri6lrk56wwv6hzb2"))))
    (properties `((upstream-name . "wordspace")))
    (build-system r-build-system)
    (propagated-inputs
     (list r-cluster r-iotools r-mass r-matrix r-rcpp r-sparsesvd))
    (native-inputs (list r-knitr r-testthat))
    (home-page "https://wordspace.r-forge.r-project.org/")
    (synopsis "Distributional semantic models in R")
    (description
     "The wordspace package turns R into an interactive laboratory for
empirical research on @dfn{distributional semantic models} (DSM).  It consists
of a small set of carefully designed functions, most of which

@itemize
@item encapsulate non-trivial R operations in a user-friendly manner or
@item provide efficient and memory-lean C implementations of key operations.
@end itemize
")
    (license license:gpl3)))

(define-public r-maxlik
  (package
    (name "r-maxlik")
    (version "1.5-2.1")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "maxLik" version))
       (sha256
        (base32 "0pcjhf8r7xz93qp4phs6l4i56y30ksivgv5ysnjh6khbdmicfm6h"))))
    (properties `((upstream-name . "maxLik")))
    (build-system r-build-system)
    (propagated-inputs (list r-generics r-misctools r-sandwich))
    (native-inputs (list r-mass))
    (home-page "https://cran.r-project.org/package=maxLik")
    (synopsis "Maximum Likelihood Estimation and related tools")
    (description
     "This package provides functions for @dfn{Maximum Likelihood} (ML) estimation,
non-linear optimization, and related tools.  It includes a unified way to call
different optimizers, and classes and methods to handle the results from the
Maximum Likelihood viewpoint.  It also includes a number of convenience tools
for testing and developing your own models.")
    (license license:gpl2+)))

(define-public r-misctools
  (package
    (name "r-misctools")
    (version "0.6-28")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "miscTools" version))
       (sha256
        (base32 "089vb57ynqzqa9ppalqfgn0n5wazfjng2kc7z4wgb2ll40hjyk5x"))))
    (properties `((upstream-name . "miscTools")))
    (build-system r-build-system)
    (propagated-inputs (list r-digest))
    (native-inputs (list r-ecdat))
    (home-page "http://www.micEcon.org")
    (synopsis "Miscellaneous tools and utilities")
    (description
     "This package provides miscellaneous small tools and utilities.  Many of
them facilitate the work with matrices, e.g. inserting rows or columns,
creating symmetric matrices, or checking for semidefiniteness.  Other tools
facilitate the work with regression models, e.g. extracting the standard
errors, obtaining the number of (estimated) parameters, or calculating
R-squared values.")
    (license license:gpl2+)))

(define-public r-mockery
  (package
    (name "r-mockery")
    (version "0.4.4")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "mockery" version))
       (sha256
        (base32
         "1hs550i2nqnn1yyx2sd7babamkq3sm7cxiwzcj8wlps5yah208h7"))))
    (properties `((upstream-name . "mockery")))
    (build-system r-build-system)
    (propagated-inputs
     (list r-testthat))
    (native-inputs
     (list r-knitr r-testthat))
    (home-page "https://github.com/jfiksel/mockery")
    (synopsis "Mocking library for R")
    (description
     "The two main functionalities of this package are creating mock
objects (functions) and selectively intercepting calls to a given function
that originate in some other function.  It can be used with any testing
framework available for R.  Mock objects can be injected with either this
package's own @code{stub} function or a similar @code{with_mock} facility
present in the @code{testthat} package.")
    (license license:expat)))

(define-public r-mockr
  (package
    (name "r-mockr")
    (version "0.2.2")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "mockr" version))
       (sha256
        (base32 "0bbrsgw4nb9265zrb45nxjk0xgmxkykvyv2ygcq1j3jrqqh9a688"))))
    (properties `((upstream-name . "mockr")))
    (build-system r-build-system)
    ;; One test failure because of an unexpected warning.
    (arguments (list #:tests? #false))
    (propagated-inputs (list r-rlang r-withr))
    (native-inputs (list r-knitr r-testthat))
    (home-page "https://krlmlr.github.io/mockr/")
    (synopsis "Mocking in R")
    (description
     "This package provides a means to mock a package function, i.e.,
temporarily substitute it for testing.  It was designed as a drop-in
replacement for the now deprecated @code{testthat::with_mock()} and
@code{testthat::local_mock()}.")
    (license license:gpl3)))

(define-public r-zoltr
  (package
    (name "r-zoltr")
    (version "1.0.2")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "zoltr" version))
       (sha256
        (base32
         "0qpkrxq527vcgwbvg5b5p1xmzwcz73i426jkb1pp1wixj9z823n3"))))
    (properties `((upstream-name . "zoltr")))
    (build-system r-build-system)
    (propagated-inputs
     (list r-base64url
           r-data-table
           r-dplyr
           r-httr
           r-jsonlite
           r-lubridate
           r-magrittr
           r-mmwrweek
           r-readr
           r-rlang))
    (native-inputs (list r-devtools r-knitr r-mockery r-testthat r-webmockr))
    (home-page "https://github.com/reichlab/zoltr")
    (synopsis "Interface to the Zoltar forecast repository API")
    (description
     "Zoltar is a website that provides a repository of model forecast results
in a standardized format and a central location.  It supports storing,
retrieving, comparing, and analyzing time series forecasts for prediction
challenges of interest to the modeling community.  This package provides
functions for working with the Zoltar API, including connecting and
authenticating, getting information about projects, models, and forecasts,
deleting and uploading forecast data, and downloading scores.")
    (license license:gpl3)))

(define-public r-zoib
  (package
    (name "r-zoib")
    (version "1.6")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "zoib" version))
       (sha256
        (base32
         "1px4jjjpn6ikngzlxz1i6fgld9cy5lv6nqn1bjin4q6sqqixyx2j"))))
    (properties `((upstream-name . "zoib")))
    (build-system r-build-system)
    (propagated-inputs
     (list r-abind r-coda r-formula r-rjags))
    (home-page "https://www.r-project.org")
    (synopsis "Bayesian inference for beta regression")
    (description
     "This package lets you fit beta regression and zero-or-one inflated beta
regression and obtain Bayesian inference of the model via the Markov Chain
Monte Carlo approach implemented in JAGS.")
    (license license:gpl3+)))

(define-public r-logger
  (package
    (name "r-logger")
    (version "0.4.0")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "logger" version))
       (sha256
        (base32 "1ph4al2ish2c3zpznr2zn7wg4hjn1bslywc1vv6smrxfcch3n90g"))))
    (properties
     '((upstream-name . "logger")
       (updater-extra-native-inputs
        . ("r-devtools" "r-pander" "r-r-utils"))))
    (build-system r-build-system)
    (native-inputs (list r-devtools r-knitr r-pander r-r-utils r-testthat))
    (home-page "https://daroczig.github.io/logger/")
    (synopsis "Lightweight and flexible logging utility")
    (description
     "Inspired by the the @code{futile.logger} R package and @code{logging}
Python module, this utility provides a flexible and extensible way of
formatting and delivering log messages with low overhead.")
    (license license:agpl3+)))

(define-public r-fasterize
  (package
    (name "r-fasterize")
    (version "1.1.0")
    (source
      (origin
        (method url-fetch)
        (uri (cran-uri "fasterize" version))
        (sha256
          (base32 "0prpnbd1v3r5yxg42q9jdkgbz8h5090klgzwxmi83h2ya17s06i3"))))
    (properties `((upstream-name . "fasterize")))
    (build-system r-build-system)
    (propagated-inputs
      (list r-raster r-rcpp r-rcpparmadillo r-wk))
    (native-inputs (list r-geos r-knitr r-testthat))
    (home-page "https://github.com/ecohealthalliance/fasterize")
    (synopsis "Fast Polygon to Raster Conversion")
    (description
"This package provides a drop-in replacement for @code{rasterize} from
the @code{raster} package that takes sf-type objects, and is much faster.
There is support for the main options provided by the @code{rasterize}
function, including setting the field used and background value, and
options for aggregating multi-layer rasters.")
    (license license:expat)))

(define-public r-bien
  (package
    (name "r-bien")
    (version "1.2.7")
    (source
      (origin
        (method url-fetch)
        (uri (cran-uri "BIEN" version))
        (sha256
          (base32 "0qcc1dl7hv7a1n0lsf4hdih0qdi3bcw2v3gj8wh7w4vzf464y61p"))))
    (properties `((upstream-name . "BIEN")))
    (build-system r-build-system)
    (native-inputs
      (list r-knitr r-testthat))
    (propagated-inputs
      (list r-ape
            r-dbi
            r-doparallel
            r-foreach
            r-rpostgresql
            r-sf
            r-terra))
    (home-page "https://cran.r-project.org/package=BIEN")
    (synopsis "Tools for accessing the BIEN database")
    (description
     "This package provides tools for accessing the Botanical Information and
Ecology Network (BIEN) database.  The BIEN database contains cleaned and
standardized botanical data including occurrence, trait, plot and taxonomic
data.  This package provides functions that query the BIEN database by
constructing and executing optimized SQL queries.")
    (license license:expat)))

(define-public r-varhandle
  (package
    (name "r-varhandle")
    (version "2.0.6")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "varhandle" version))
       (sha256
        (base32 "0xy5w7cz9sb0xmxvzajg4sf0ip2ihxc5nimh10awchvkywzgsyjf"))))
    (properties `((upstream-name . "varhandle")))
    (build-system r-build-system)
    (home-page "https://codeberg.org/mehrad/varhandle")
    (synopsis "Functions for robust variable handling")
    (description
     "This package contains some functions to help users (especially data
explorers) to make more sense of their variables and take the most out of
variables and hardware resources.  Functions in this package are supposed to
be efficient and easy to use.")
    (license license:gpl2+)))

(define-public r-vgam
  (package
    (name "r-vgam")
    (version "1.1-13")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "VGAM" version))
       (sha256
        (base32 "17qibarkf6a0snsggrnmkjp9l7dmybyzb2j2pgjzlx39vdi8sf5y"))))
    (properties `((upstream-name . "VGAM")))
    (build-system r-build-system)
    (native-inputs
     (list gfortran))
    (home-page "https://www.stat.auckland.ac.nz/~yee/VGAM")
    (synopsis "Vector generalized linear and additive models")
    (description
    "This package is an implementation of about 6 major classes of statistical
regression models.  Currently only fixed-effects models are implemented, i.e.,
no random-effects models.  Many (150+) models and distributions are estimated
by maximum likelihood estimation (MLE) or penalized MLE, using Fisher scoring.
VGLMs can be loosely thought of as multivariate generalised linear models.")
    (license license:gpl2+)))

(define-public r-vipor
  (package
    (name "r-vipor")
    (version "0.4.7")
    (source (origin
              (method url-fetch)
              (uri (cran-uri "vipor" version))
              (sha256
               (base32
                "17hb6y1i9bva0fr4k9m6wncmnzdjad1b7fhsvfhva4xavpll3bds"))))
    (build-system r-build-system)
    ;; Vignettes need r-beeswarm and r-ggbeeswarm, leading to a dependency
    ;; cycle.
    (arguments (list #:test-types '(list "tests")))
    (native-inputs (list r-testthat))
    (home-page "https://cran.r-project.org/web/packages/vipor")
    (synopsis "Plot categorical data using noise and density estimates")
    (description
     "This package provides tools to generate a violin point plot, a
combination of a violin/histogram plot and a scatter plot by offsetting points
within a category based on their density using quasirandom noise.")
    (license license:gpl2+)))

(define-public r-viridis
  (package
    (name "r-viridis")
    (version "0.6.5")
    (source (origin
              (method url-fetch)
              (uri (cran-uri "viridis" version))
              (sha256
               (base32
                "0p00s24d8bsifw3r0afwrx98bqixnf5krpbw42hfwp8ipsv5qaw6"))))
    (build-system r-build-system)
    (propagated-inputs
     (list r-ggplot2 r-gridextra r-viridislite))
    (native-inputs
     (list r-knitr r-testthat)) ; for vignettes
    (home-page "https://github.com/sjmgarnier/viridis")
    (synopsis "Matplotlib default color map")
    (description
     "This package is a port of the new @url{matplotlib,
http://matplotlib.org/} color maps (@code{viridis}--the default--,
@code{magma}, @code{plasma}, and @code{inferno}) to R.  These color maps are
designed in such a way that they will analytically be perfectly
perceptually-uniform, both in regular form and also when converted to
black-and-white.  They are also designed to be perceived by readers with the
most common form of color blindness.")
    (license license:x11)))

(define-public r-viridislite
  (package
    (name "r-viridislite")
    (version "0.4.2")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "viridisLite" version))
       (sha256
        (base32
         "18g1rk24kr47jl01r70vvni2146fl9xxpjcvjp6d5k6y64fi2gw9"))))
    (properties `((upstream-name . "viridisLite")))
    (build-system r-build-system)
    (native-inputs (list r-testthat))
    (home-page "https://github.com/sjmgarnier/viridisLite")
    (synopsis "Default color maps from matplotlib")
    (description
     "This package is a port of the new @code{matplotlib} color maps
(@code{viridis}, @code{magma}, @code{plasma} and @code{inferno}) to R.
matplotlib is a popular plotting library for Python.  These color maps are
designed in such a way that they will analytically be perfectly
perceptually-uniform, both in regular form and also when converted to
black-and-white.  They are also designed to be perceived by readers with the
most common form of color blindness.  This is the @code{lite} version of the
more complete @code{viridis} package.")
    (license license:expat)))

(define-public r-ggh4x
  (package
    (name "r-ggh4x")
    (version "0.3.1")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "ggh4x" version))
       (sha256
        (base32
         "11szf1jwc23bc3615fwk89vc8rwhwhl6515d49n1423mxqqc1z6q"))))
    (properties `((upstream-name . "ggh4x")))
    (build-system r-build-system)
    (arguments
     (list
      #:phases
      '(modify-phases %standard-phases
         (add-after 'unpack 'delete-bad-tests
           (lambda _
             ;; FIXME: Tests in this file fail for unknown reasons.
             (delete-file "tests/testthat/test-stat_theodensity.R"))))))
    (propagated-inputs
     (list r-cli
           r-ggplot2
           r-gtable
           r-lifecycle
           r-rlang
           r-s7
           r-scales
           r-vctrs))
    (native-inputs
     (list r-knitr r-testthat))
    (home-page "https://github.com/teunbrand/ggh4x")
    (synopsis "Extension for ggplot2")
    (description "This package is a @code{ggplot2} extension.  It provides some
utility functions that do not entirely fit within the grammar of graphics
concept.  The package extends @code{ggpplots} facets through customisation, by
setting individual scales per panel, resizing panels and providing nested
facets.  It also allows multiple colour, fill scales per plot and hosts a
smaller collection of stats, geoms and axis guides.")
    (license license:expat)))

(define-public r-gghalves
  (package
    (name "r-gghalves")
    (version "0.1.4")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "gghalves" version))
       (sha256
        (base32
         "1qsxq2zbz4zcpqc7949apznn9f2c959jwwx010bl4gf2p6vchfx7"))))
    (properties `((upstream-name . "gghalves")))
    (build-system r-build-system)
    (propagated-inputs
     (list r-ggplot2 r-gtable))
    (native-inputs
     (list r-knitr))
    (home-page "https://github.com/erocoar/gghalves")
    (synopsis "Compose half-half plots using your favourite geoms")
    (description "This package provides a @code{ggplot2} extension for easy
plotting of half-half geom combinations.  Think half boxplot and half
jitterplot, or half violinplot and half dotplot.")
    (license license:expat)))

(define-public r-zoeppritz
  (package
    (name "r-zoeppritz")
    (version "1.0-9")
    (source (origin
              (method url-fetch)
              (uri (cran-uri "zoeppritz" version))
              (sha256
               (base32
                "0bl1hrghyv5vjs02r2f5k9p7l4ialwdpl7si14lz8lbb0r1a6fwq"))))
    (properties `((upstream-name . "zoeppritz")))
    (build-system r-build-system)
    (home-page "https://cran.r-project.org/package=zoeppritz")
    (synopsis "Seismic reflection and scattering coefficients for waves")
    (description
     "The @code{r-zoeppritz} package calculates and plots scattering matrix
coefficients or scattering amplitudes, for seismological P and S-waves at an
interface.")
    (license license:gpl2+)))

(define-public r-ztable
  (package
    (name "r-ztable")
    (version "0.2.3")
    (source (origin
              (method url-fetch)
              (uri (cran-uri "ztable" version))
              (sha256
               (base32
                "1ps7ix0hc84s0p0ra6bkjxky3cffs1rvdcagqzj78lbdq22dk5j8"))))
    (build-system r-build-system)
    (propagated-inputs
     (list r-flextable
           r-magrittr
           r-officer
           r-rcolorbrewer
           r-rstudioapi
           r-scales
           r-stringr))
    (native-inputs
     (list r-knitr r-testthat))
    (home-page "https://cran.r-project.org/web/packages/ztable")
    (synopsis "Zebra-striped tables in LaTeX and HTML formats for R")
    (description
     "This package provides functions to make zebra-striped tables (tables
with alternating row colors) in LaTeX and HTML formats easily from
@code{data.frame}, @code{matrix}, @code{lm}, @code{aov}, @code{anova},
@code{glm}, @code{coxph}, @code{nls}, @code{fitdistr}, @code{mytable} and
@code{cbind.mytable} objects.")
    (license license:gpl2+)))

(define-public r-metadat
  (package
    (name "r-metadat")
    (version "1.4-0")
    (source (origin
              (method url-fetch)
              (uri (cran-uri "metadat" version))
              (sha256
               (base32
                "019zxxq138mzpkx2hl61as7jyccrxmc61yq3bjy2khrw0pp6sp9a"))))
    (properties `((upstream-name . "metadat")))
    (build-system r-build-system)
    (propagated-inputs (list r-mathjaxr))
    (native-inputs (list r-testthat))
    (home-page "https://github.com/wviechtb/metadat")
    (synopsis "Meta-Analysis Datasets")
    (description
     "This package provides a collection of meta-analysis datasets for teaching
purposes, illustrating/testing meta-analytic methods, and validating published
analyses.")
    (license license:gpl2+)))

(define-public r-mathjaxr
  (package
    (name "r-mathjaxr")
    (version "1.8-0")
    (source (origin
              (method url-fetch)
              (uri (cran-uri "mathjaxr" version))
              (sha256
               (base32
                "0d0h686zdif2khjwnib9l7fwpy0l3zg5bixhyxa5diq13k2rf8gb"))
              (modules '((guix build utils)))
              (snippet
               '(begin
                  (delete-file-recursively "src/mathjax/es5/input")
                  (delete-file-recursively "src/mathjax/es5/output")
                  (delete-file "src/mathjax/es5/tex-chtml-full.js")))))
    (properties `((upstream-name . "mathjaxr")))
    (build-system r-build-system)
    (arguments
     (list
      #:phases
      `(modify-phases %standard-phases
         (add-after 'unpack 'use-js-mathjax
           (lambda* (#:key inputs #:allow-other-keys)
             (symlink
              (search-input-directory
               inputs "/share/javascript/mathjax/es5/output")
              "src/mathjax/es5/output")
             (symlink
              (search-input-directory
               inputs "/share/javascript/mathjax/es5/input")
              "src/mathjax/es5/input")
             (symlink
              (search-input-file
               inputs "/share/javascript/mathjax/es5/tex-chtml-full.js")
              "src/mathjax/es5/tex-chtml-full.js"))))))
    (inputs
     (list js-mathjax-for-r-mathjaxr))
    (home-page "https://github.com/wviechtb/mathjaxr")
    (synopsis "Use Mathjax in Rd Files")
    (description
     "This package provides MathJax and macros to enable its use within Rd files
for rendering equations in the HTML help files.")
    (license (list license:asl2.0 license:gpl3))))

(define-public r-spacefillr
  (package
    (name "r-spacefillr")
    (version "0.4.0")
    (source (origin
              (method url-fetch)
              (uri (cran-uri "spacefillr" version))
              (sha256
               (base32
                "1dk8w9gml8h7cgikikq0c2g7kd8adyalxsmm88fd2cpgslysb2sx"))))
    (properties `((upstream-name . "spacefillr")))
    (build-system r-build-system)
    (propagated-inputs (list r-rcpp))
    (home-page "https://github.com/tylermorganwall/spacefillr")
    (synopsis "Space-Filling Random and Quasi-Random Sequences")
    (description
     "@code{spacefillr} enables generation of random and quasi-random
space-filling sequences.  It supports the following sequences: Halton, Sobol,
Owen-scrambled Sobol, Owen-scrambled Sobol with errors distributed as blue
noise, progressive jittered, progressive multi-jittered (PMJ), PMJ with blue
noise, PMJ02, and PMJ02 with blue noise.  The package also includes a C++
API.")
    (license license:expat)))

(define-public r-spacetime
  (package
    (name "r-spacetime")
    (version "1.3-3")
    (source (origin
              (method url-fetch)
              (uri (cran-uri "spacetime" version))
              (sha256
               (base32
                "1bl1lpprq9hbvgmh0bhp76y8brymk06hwxi12bjngh0hdqkw8pi1"))))
    (properties
     '((upstream-name . "spacetime")
       ;; rgdal no longer exists.
       (updater-ignored-native-inputs . ("r-rgdal"))))
    (build-system r-build-system)
    ;; Vignettes fail on file jss816.R with:
    ;; object 'nc' not found
    (arguments (list #:test-types '(list "tests")))
    (propagated-inputs (list r-intervals r-lattice r-sp r-xts r-zoo))
    (native-inputs (list r-knitr r-rcolorbrewer r-rpostgresql r-sf))
    (home-page "https://github.com/edzer/spacetime/")
    (synopsis "Classes and methods for spatio-temporal data")
    (description
     "@command{spacetime} provides classes and methods for spatio-temporal
data, including space-time regular lattices, sparse lattices, irregular data,
and trajectories; utility functions for plotting data as map sequences (lattice
or animation) or multiple time series; methods for spatial and temporal
matching or aggregation, retrieving coordinates, print, summary, etc.")
    (license license:gpl2+)))

(define-public r-tesseract
  (package
    (name "r-tesseract")
    (version "5.2.3")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "tesseract" version))
       (sha256
        (base32 "181fbv1qhqxljr67phkrxahbfgsxa73gzq30zq0wvi38gzbfbnv8"))))
    (properties `((upstream-name . "tesseract")))
    (build-system r-build-system)
    (inputs (list tesseract-ocr
                  zlib))
    (propagated-inputs (list r-curl
                             r-digest
                             r-pdftools
                             r-rappdirs
                             r-rcpp))
    (native-inputs (list pkg-config
                         r-knitr
                         r-spelling))
    (home-page "https://github.com/ropensci/tesseract")
    (synopsis "Open Source OCR Engine")
    (description
     "Bindings to @code{tesseract}: an optical character recognition (OCR) engine
that supports over 100 languages.  The engine is highly configurable in order
to tune the detection algorithms and obtain the best possible results.")
    (license license:asl2.0)))

(define-public r-gstat
  (package
    (name "r-gstat")
    (version "2.1-3")
    (source (origin
              (method url-fetch)
              (uri (cran-uri "gstat" version))
              (sha256
               (base32
                "1lia3vxkv8s9q5svmlg1grhz45ab0ppln69rwcn55vzm6307gp7f"))))
    (properties `((upstream-name . "gstat")))
    (build-system r-build-system)
    (propagated-inputs
     (list r-fnn
           r-lattice
           r-sf
           r-sftime
           r-sp
           r-spacetime
           r-stars
           r-zoo))
    (home-page "https://github.com/r-spatial/gstat/")
    (synopsis "Spatial and spatio-temporal geostatistical modelling,
prediction and simulation")
    (description
     "This package enables variogram modelling, including: simple,
ordinary and universal point or block (co)kriging; spatio-temporal
kriging; and sequential Gaussian or indicator (co)simulation.  It
includes variogram and variogram map plotting utility functions, and
supports @command{sf} and @command{stars}.")
    (license license:gpl2+)))

(define-public r-automap
  (package
    (name "r-automap")
    (version "1.1-16")
    (source (origin
              (method url-fetch)
              (uri (cran-uri "automap" version))
              (sha256
               (base32
                "0vvpmadpdjanriqx866g8dyabv27104svnmymfz7azmijvwp4yna"))))
    (properties `((upstream-name . "automap")))
    (build-system r-build-system)
    (propagated-inputs (list r-ggplot2
                             r-gstat
                             r-lattice
                             r-reshape
                             r-sf
                             r-sp
                             r-stars))
    (home-page "https://cran.r-project.org/package=automap")
    (synopsis "Automatic interpolation package")
    (description
     "@command{automap} performs an automatic interpolation by automatically
estimating the variogram and then calling @command{gstat}.")
    (license (list license:gpl2+ license:gpl3+))))

(define-public r-cartogram
  (package
    (name "r-cartogram")
    (version "0.3.0")
    (source (origin
              (method url-fetch)
              (uri (cran-uri "cartogram" version))
              (sha256
               (base32
                "1vkcp8k9ajrnm14p2fqrcb4vk67503zd0w51h8amcljg3p21wzkl"))))
    (properties `((upstream-name . "cartogram")))
    (build-system r-build-system)
    (propagated-inputs (list r-packcircles r-sf))
    (home-page "https://github.com/sjewo/cartogram/")
    (synopsis "Create cartograms with R")
    (description "This package enables construction of continuous and
non-contiguous area cartograms.")
    (license license:gpl3)))

(define-public r-measurements
  (package
    (name "r-measurements")
    (version "1.5.1")
    (source (origin
              (method url-fetch)
              (uri (cran-uri "measurements" version))
              (sha256
               (base32
                "061xjwsacsk8vblva4s09xdrvd7kfgxydnpgr7imigyny01c5bh9"))))
    (properties `((upstream-name . "measurements")))
    (build-system r-build-system)
    (home-page "https://cran.r-project.org/web/packages/measurements/")
    (synopsis "Tools for units of measurement")
    (description
     "This package provides a collection of tools to make working with physical
measurements easier.  One can convert between metric and imperial units, or
calculate a dimension's unknown value from other dimensions' measurements.")
    (license license:gpl3)))

(define-public r-sungeo
  (package
    (name "r-sungeo")
    (version "1.3.0")
    (source (origin
              (method url-fetch)
              (uri (cran-uri "SUNGEO" version))
              (sha256
               (base32
                "0ydwsrgqknngx7567xwfhwj1jdmi4ip1jxkb5jdy41f7ysy1myd0"))))
    (properties `((upstream-name . "SUNGEO")))
    (build-system r-build-system)
    (native-inputs
     (list r-codetools)) ;recommended package for checking field assignments
    (propagated-inputs
     (list r-automap
           r-cartogram
           r-data-table
           r-dplyr
           r-httr
           r-jsonlite
           r-measurements
           r-packcircles
           r-purrr
           r-rann
           r-raster
           r-rcpp
           r-rcurl
           r-rlang
           r-rmapshaper
           r-sf
           r-spdep
           r-stringr
           r-terra))
    (home-page "https://github.com/zhukovyuri/SUNGEO/")
    (synopsis "Sub-National Geospatial Data Archive: Geoprocessing Toolkit")
    (description
     "Tools for integrating spatially-misaligned GIS datasets.  Part of the
Sub-National Geospatial Data Archive System.")
    (license license:gpl2)))

(define-public r-zigg
  (package
    (name "r-zigg")
    (version "0.0.2")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "zigg" version))
       (sha256
        (base32 "1v1c11ajdjycp24z9afv7mysmih55jaj1r7vh36xxd7m9b2pr93c"))))
    (properties `((upstream-name . "zigg")))
    (build-system r-build-system)
    (home-page "https://github.com/eddelbuettel/zigg")
    (synopsis
     "Lightweight interfaces to the Ziggurat pseudo random number generator")
    (description
     "The Ziggurat pseudo-random number generator (or PRNG) offers a
lightweight and very fast PRNG for the normal, exponential, and uniform
distributions.  It is provided here in a small zero-dependency package.  It
can be used from R as well as from C/C++ code in other packages as is
demonstrated by four included sample packages using four distinct methods to
use the PRNG presented here in client package.")
    (license license:gpl2+)))

;;;
;;; Avoid adding new packages to the end of this file. To reduce the chances
;;; of a merge conflict, place them above by existing packages with similar
;;; functionality or similar names.
;;;
