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

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

source:
  url:
    - {{ cran_mirror }}/src/contrib/weights_{{ version }}.tar.gz
    - {{ cran_mirror }}/src/contrib/Archive/weights/weights_{{ version }}.tar.gz
  sha256: 7ce7edba6135740cb37c1b41a6d61ca53f7a4010163151916dedea168ba608eb

build:
  merge_build_host: true  # [win]
  number: 0
  rpaths:
    - lib/R/lib/
    - lib/

requirements:
  build:
    - {{ compiler('c') }}              # [not win]
    - {{ compiler('m2w64_c') }}        # [win]
    - {{ posix }}filesystem        # [win]
    - {{ posix }}make
    - {{ posix }}sed               # [win]
    - {{ posix }}coreutils         # [win]
    - {{ posix }}zip               # [win]
    - cross-r-base {{ r_base }}    # [build_platform != target_platform]
  host:
    - r-base
    - r-hmisc
    - r-gdata
    - r-mice
  run:
    - r-base
    - {{ native }}gcc-libs         # [win]
    - r-hmisc
    - r-gdata
    - r-mice

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

about:
  home: https://CRAN.R-project.org/package=weights
  license: GPL-2.0-or-later
  summary: "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_family: GPL2
  license_file:
    - {{ environ["PREFIX"] }}/lib/R/share/licenses/GPL-2

extra:
  recipe-maintainers:
    - conda-forge/r
    - tobiasraabe

# Package: weights
# Title: Weighting and Weighted Statistics
# Version: 1.0.1
# Date: 2020-02-10
# Author: Josh Pasek [aut, cre], with some assistance from Alex Tahk and some code modified from R-core; Additional contributions by Gene Culter and Marcus Schwemmle.
# Maintainer: Josh Pasek <josh@joshpasek.com>
# Depends: Hmisc, gdata, mice
# Description: 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: GPL (>= 2)
# LazyLoad: yes
# NeedsCompilation: yes
# Packaged: 2020-02-10 07:14:00 UTC; jpasek
# Repository: CRAN
# Date/Publication: 2020-02-12 15:20:02 UTC
