%global __brp_check_rpaths %{nil} %global packname ipfr %global packver 1.0.2 %global rlibdir /usr/local/lib/R/library Name: R-CRAN-%{packname} Version: 1.0.2 Release: 3%{?dist}%{?buildtag} Summary: List Balancing for Reweighting and Population Synthesis License: Apache License (== 2.0) URL: https://cran.r-project.org/package=%{packname} Source0: %{url}&version=%{packver}#/%{packname}_%{packver}.tar.gz BuildRequires: R-devel >= 3.2.0 Requires: R-core >= 3.2.0 BuildArch: noarch BuildRequires: R-CRAN-ggplot2 >= 2.2.1 BuildRequires: R-CRAN-mlr >= 2.11 BuildRequires: R-CRAN-magrittr >= 1.5 BuildRequires: R-CRAN-dplyr >= 0.7.3 BuildRequires: R-CRAN-tidyr >= 0.5.1 Requires: R-CRAN-ggplot2 >= 2.2.1 Requires: R-CRAN-mlr >= 2.11 Requires: R-CRAN-magrittr >= 1.5 Requires: R-CRAN-dplyr >= 0.7.3 Requires: R-CRAN-tidyr >= 0.5.1 %description Performs iterative proportional updating given a seed table and an arbitrary number of marginal distributions. This is commonly used in population synthesis, survey raking, matrix rebalancing, and other applications. For example, a household survey may be weighted to match the known distribution of households by size from the census. An origin/ destination trip matrix might be balanced to match traffic counts. The approach used by this package is based on a paper from Arizona State University (Ye, Xin, et. al. (2009) ). Some enhancements have been made to their work including primary and secondary target balance/importance, general marginal agreement, and weight restriction. %prep %setup -q -c -n %{packname} find -type f -executable -exec grep -Iq . {} \; -exec sed -i -e '$a\' {} \; %build %install mkdir -p %{buildroot}%{rlibdir} %{_bindir}/R CMD INSTALL -l %{buildroot}%{rlibdir} %{packname} test -d %{packname}/src && (cd %{packname}/src; rm -f *.o *.so) rm -f %{buildroot}%{rlibdir}/R.css %files %{rlibdir}/%{packname}