%global __brp_check_rpaths %{nil} %global packname aMNLFA %global packver 1.1.2 %global rlibdir /usr/local/lib/R/library Name: R-CRAN-%{packname} Version: 1.1.2 Release: 1%{?dist}%{?buildtag} Summary: Automated Moderated Nonlinear Factor Analysis Using 'M-plus' License: GPL-2 URL: https://cran.r-project.org/package=%{packname} Source0: %{url}&version=%{packver}#/%{packname}_%{packver}.tar.gz BuildRequires: R-devel >= 3.1.0 Requires: R-core >= 3.1.0 BuildArch: noarch BuildRequires: R-utils BuildRequires: R-grDevices BuildRequires: R-graphics BuildRequires: R-stats BuildRequires: R-CRAN-ggplot2 BuildRequires: R-CRAN-MplusAutomation BuildRequires: R-CRAN-reshape2 BuildRequires: R-CRAN-gridExtra BuildRequires: R-CRAN-stringr BuildRequires: R-CRAN-plyr BuildRequires: R-CRAN-devtools BuildRequires: R-CRAN-dplyr BuildRequires: R-CRAN-stringi Requires: R-utils Requires: R-grDevices Requires: R-graphics Requires: R-stats Requires: R-CRAN-ggplot2 Requires: R-CRAN-MplusAutomation Requires: R-CRAN-reshape2 Requires: R-CRAN-gridExtra Requires: R-CRAN-stringr Requires: R-CRAN-plyr Requires: R-CRAN-devtools Requires: R-CRAN-dplyr Requires: R-CRAN-stringi %description Automated generation, running, and interpretation of moderated nonlinear factor analysis models for obtaining scores from observed variables, using the method described by Gottfredson and colleagues (2019) . This package creates M-plus input files which may be run iteratively to test two different types of covariate effects on items: (1) latent variable impact (both mean and variance); and (2) differential item functioning. After sequentially testing for all effects, it also creates a final model by including all significant effects after adjusting for multiple comparisons. Finally, the package creates a scoring model which uses the final values of parameter estimates to generate latent variable scores. nn This package generates TEMPLATES for M-plus inputs, which can and should be inspected, altered, and run by the user. In addition to being presented without warranty of any kind, the package is provided under the assumption that everyone who uses it is reading, interpreting, understanding, and altering every M-plus input and output file. There is no one right way to implement moderated nonlinear factor analysis, and this package exists solely to save users time as they generate M-plus syntax according to their own judgment. %prep %setup -q -c -n %{packname} # fix end of executable files find -type f -executable -exec grep -Iq . {} \; -exec sed -i -e '$a\' {} \; # prevent binary stripping [ -d %{packname}/src ] && find %{packname}/src -type f -exec \ sed -i 's@/usr/bin/strip@/usr/bin/true@g' {} \; || true [ -d %{packname}/src ] && find %{packname}/src/Make* -type f -exec \ sed -i 's@-g0@@g' {} \; || true # don't allow local prefix in executable scripts find -type f -executable -exec sed -Ei 's@#!( )*/usr/local/bin@#!/usr/bin@g' {} \; %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 # remove buildroot from installed files find %{buildroot}%{rlibdir} -type f -exec sed -i "s@%{buildroot}@@g" {} \; %files %{rlibdir}/%{packname}