{% set version = '1.6.9' %}

{% set posix = 'm2-' if win else '' %}
{% set native = 'm2w64-' if win else '' %}

package:
  name: r-corpcor
  version: {{ version|replace("-", "_") }}

source:
  fn: corpcor_{{ version }}.tar.gz
  url:
    - https://cran.r-project.org/src/contrib/corpcor_{{ version }}.tar.gz
    - https://cran.r-project.org/src/contrib/Archive/corpcor/corpcor_{{ version }}.tar.gz
  sha256: 2e4fabd1d3936fecea67fa365233590147ca50bb45cf80efb53a10345a8a23c2

build:
  number: 0
  skip: true  # [win32]
  rpaths:
    - lib/R/lib/
    - lib/

requirements:
  build:
    - r-base

  run:
    - r-base

test:
  commands:
    - $R -e "library('corpcor')"  # [not win]
    - "\"%R%\" -e \"library('corpcor')\""  # [win]

about:
  home: http://strimmerlab.org/software/corpcor/
  license: GPL (>= 3)
  summary: 'Implements a James-Stein-type shrinkage estimator for  the covariance matrix, with
    separate shrinkage for variances and correlations.   The details of the method are
    explained in Schafer and Strimmer (2005) <doi:10.2202/1544-6115.1175> and Opgen-Rhein and
    Strimmer (2007) <doi:10.2202/1544-6115.1252>. The approach is both computationally as well
    as statistically very efficient, it is applicable to "small n, large p" data, and always
    returns a positive definite and well-conditioned covariance matrix. In addition to inferring
    the covariance matrix the package also provides shrinkage estimators for partial correlations
    and partial variances. The inverse of the covariance and correlation matrix can be efficiently
    computed, as well as any arbitrary power of the shrinkage correlation matrix. 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_family: GPL3
  license_file: '{{ environ["PREFIX"] }}/lib/R/share/licenses/GPL-3'  # [unix]
  license_file: '{{ environ["PREFIX"] }}\R\share\licenses\GPL-3'  # [win]

extra:
  recipe-maintainers:
    - johanneskoester
    - bgruening
    - daler
    - jdblischak
    - cbrueffer
