From 5df1c2b7760c9f808f212cad1c28009344e63c30 Mon Sep 17 00:00:00 2001 From: James J Balamuta Date: Tue, 28 Nov 2023 20:06:31 -0700 Subject: [PATCH] Address CRAN WARN checks in DEVEL (#24) * Re-render documentation and compilation attributes * Update README badges & install text * Bump requirements * Remove specific CXX request --- DESCRIPTION | 8 ++++---- R/RcppExports.R | 2 +- README.Rmd | 15 ++++++++------- README.md | 15 ++++++++------- man/attribute_bijection.Rd | 2 +- man/attribute_classes.Rd | 2 +- man/attribute_inv_bijection.Rd | 2 +- man/sim_dina_attributes.Rd | 2 +- man/sim_dina_class.Rd | 2 +- man/sim_dina_items.Rd | 2 +- man/sim_eta_matrix.Rd | 4 ++-- man/sim_q_matrix.Rd | 2 +- man/sim_subject_attributes.Rd | 2 +- man/simcdm-package.Rd | 13 ++++--------- src/Makevars | 3 --- src/Makevars.win | 3 --- src/RcppExports.cpp | 27 ++++++++++++++++----------- 17 files changed, 51 insertions(+), 55 deletions(-) diff --git a/DESCRIPTION b/DESCRIPTION index e442251..5495bad 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -28,16 +28,16 @@ URL: https://tmsalab.github.io/simcdm, https://github.com/tmsalab/simcdm BugReports: https://github.com/tmsalab/simcdm/issues License: GPL (>= 2) Depends: - R (>= 3.5.0) -Imports: Rcpp (>= 1.0.0) + R (>= 4.1.0) +Imports: Rcpp (>= 1.0.11) LinkingTo: Rcpp, - RcppArmadillo (>= 0.9.200) + RcppArmadillo (>= 0.12.6.6.0) Suggests: testthat, covr, knitr, rmarkdown VignetteBuilder: knitr -RoxygenNote: 6.1.1 +RoxygenNote: 7.2.3 Roxygen: list(markdown = TRUE) Encoding: UTF-8 diff --git a/R/RcppExports.R b/R/RcppExports.R index e671cdf..464dd36 100644 --- a/R/RcppExports.R +++ b/R/RcppExports.R @@ -334,5 +334,5 @@ sim_subject_attributes <- function(N, K, probs = NULL) { # Register entry points for exported C++ functions methods::setLoadAction(function(ns) { - .Call('_simcdm_RcppExport_registerCCallable', PACKAGE = 'simcdm') + .Call(`_simcdm_RcppExport_registerCCallable`) }) diff --git a/README.Rmd b/README.Rmd index 2c895aa..b606b78 100644 --- a/README.Rmd +++ b/README.Rmd @@ -18,10 +18,10 @@ knitr::opts_chunk$set( [![R-CMD-check](https://github.com/tmsalab/simcdm/actions/workflows/R-CMD-check.yaml/badge.svg)](https://github.com/tmsalab/simcdm/actions/workflows/R-CMD-check.yaml) [![Package-License](http://img.shields.io/badge/license-GPL%20(%3E=2)-brightgreen.svg?style=flat)](http://www.gnu.org/licenses/gpl-2.0.html) [![CRAN Version Badge](http://www.r-pkg.org/badges/version/simcdm)](https://cran.r-project.org/package=simcdm) -[![CRAN Status](https://cranchecks.info/badges/worst/simcdm)](https://cran.r-project.org/web/checks/check_results_simcdm.html) +[![CRAN Status](https://badges.cranchecks.info/worst/simcdm.svg)](https://cran.r-project.org/web/checks/check_results_simcdm.html) [![RStudio CRAN Mirror's Monthly Downloads](http://cranlogs.r-pkg.org/badges/simcdm?color=brightgreen)](http://www.r-pkg.org/pkg/simcdm) [![RStudio CRAN Mirror's Total Downloads](http://cranlogs.r-pkg.org/badges/grand-total/simcdm?color=brightgreen)](http://www.r-pkg.org/pkg/simcdm) -[![Coverage test coverage](https://codecov.io/gh/tmsalab/simcdm/branch/master/graph/badge.svg)](https://codecov.io/github/tmsalab/simcdm?branch=master) +[![Coverage test coverage](https://codecov.io/gh/tmsalab/simcdm/branch/main/graph/badge.svg)](https://codecov.io/github/tmsalab/simcdm?branch=main) The goal of `simcdm` is to provide flexible ways to simulate data under @@ -29,13 +29,13 @@ cognitive diagnostic models. ## Installation -You can install simcdm from GitHub with: +You can install `simcdm` from GitHub with: ```{r} #| label: gh-installation #| eval: false -# install.packages("devtools") -devtools::install_github("tmsalab/simcdm") +# install.packages("remotes") +remotes::install_github("tmsalab/simcdm") ``` ## Usage @@ -59,8 +59,9 @@ There are four distinct sets of functions within the package: Functions that use random numbers to simulate values are named with the prefix of `sim_*()`. This is done to allow for functions to be quickly identified and used -through autocomplete inside of the [RStudio IDE](https://www.rstudio.com). At -a later time, the `attribute_*()` will likely be moved to a different package. +through autocomplete inside of the [RStudio IDE](https://www.rstudio.com) or +[VS Code](https://code.visualstudio.com/). At a later time, the `attribute_*()` +will likely be moved to a different package. For more details, please see the [package vignettes](vignettes/): diff --git a/README.md b/README.md index f1bc53a..a02c455 100644 --- a/README.md +++ b/README.md @@ -10,13 +10,13 @@ [![CRAN Version Badge](http://www.r-pkg.org/badges/version/simcdm)](https://cran.r-project.org/package=simcdm) [![CRAN -Status](https://cranchecks.info/badges/worst/simcdm)](https://cran.r-project.org/web/checks/check_results_simcdm.html) +Status](https://badges.cranchecks.info/worst/simcdm.svg)](https://cran.r-project.org/web/checks/check_results_simcdm.html) [![RStudio CRAN Mirror’s Monthly Downloads](http://cranlogs.r-pkg.org/badges/simcdm?color=brightgreen)](http://www.r-pkg.org/pkg/simcdm) [![RStudio CRAN Mirror’s Total Downloads](http://cranlogs.r-pkg.org/badges/grand-total/simcdm?color=brightgreen)](http://www.r-pkg.org/pkg/simcdm) [![Coverage test -coverage](https://codecov.io/gh/tmsalab/simcdm/branch/master/graph/badge.svg)](https://codecov.io/github/tmsalab/simcdm?branch=master) +coverage](https://codecov.io/gh/tmsalab/simcdm/branch/main/graph/badge.svg)](https://codecov.io/github/tmsalab/simcdm?branch=main) The goal of `simcdm` is to provide flexible ways to simulate data under @@ -24,11 +24,11 @@ cognitive diagnostic models. ## Installation -You can install simcdm from GitHub with: +You can install `simcdm` from GitHub with: ``` r -# install.packages("devtools") -devtools::install_github("tmsalab/simcdm") +# install.packages("remotes") +remotes::install_github("tmsalab/simcdm") ``` ## Usage @@ -53,8 +53,9 @@ There are four distinct sets of functions within the package: Functions that use random numbers to simulate values are named with the prefix of `sim_*()`. This is done to allow for functions to be quickly identified and used through autocomplete inside of the [RStudio -IDE](https://www.rstudio.com). At a later time, the `attribute_*()` will -likely be moved to a different package. +IDE](https://www.rstudio.com) or [VS +Code](https://code.visualstudio.com/). At a later time, the +`attribute_*()` will likely be moved to a different package. For more details, please see the [package vignettes](vignettes/): diff --git a/man/attribute_bijection.Rd b/man/attribute_bijection.Rd index 45fcf08..2ef91c0 100644 --- a/man/attribute_bijection.Rd +++ b/man/attribute_bijection.Rd @@ -21,7 +21,7 @@ Computes the powers of 2 from \eqn{0} up to \eqn{K - 1} for biject = attribute_bijection(3) } \seealso{ -\code{\link[simcdm:attribute_inv_bijection]{simcdm::attribute_inv_bijection()}} +\code{\link[=attribute_inv_bijection]{attribute_inv_bijection()}} } \author{ Steven Andrew Culpepper and James Joseph Balamuta diff --git a/man/attribute_classes.Rd b/man/attribute_classes.Rd index d8421b7..e242fd5 100644 --- a/man/attribute_classes.Rd +++ b/man/attribute_classes.Rd @@ -31,7 +31,7 @@ K = 3 alphas = attribute_classes(K) } \seealso{ -\code{\link[simcdm:sim_subject_attributes]{simcdm::sim_subject_attributes()}} and \code{\link[simcdm:attribute_inv_bijection]{simcdm::attribute_inv_bijection()}} +\code{\link[=sim_subject_attributes]{sim_subject_attributes()}} and \code{\link[=attribute_inv_bijection]{attribute_inv_bijection()}} } \author{ James Joseph Balamuta and Steven Andrew Culpepper diff --git a/man/attribute_inv_bijection.Rd b/man/attribute_inv_bijection.Rd index 8275ba0..1355b5c 100644 --- a/man/attribute_inv_bijection.Rd +++ b/man/attribute_inv_bijection.Rd @@ -25,7 +25,7 @@ inv_biject1 = attribute_inv_bijection(5, 1) inv_biject2 = attribute_inv_bijection(5, 2) } \seealso{ -\code{\link[simcdm:attribute_bijection]{simcdm::attribute_bijection()}} +\code{\link[=attribute_bijection]{attribute_bijection()}} } \author{ Steven Andrew Culpepper and James Joseph Balamuta diff --git a/man/sim_dina_attributes.Rd b/man/sim_dina_attributes.Rd index 4e440eb..51dfcd6 100644 --- a/man/sim_dina_attributes.Rd +++ b/man/sim_dina_attributes.Rd @@ -63,7 +63,7 @@ dina_items = sim_dina_items(Alphas, Q, ss, gs) dina_attributes = sim_dina_attributes(Alphas, Q) } \seealso{ -\code{\link[simcdm:sim_dina_class]{simcdm::sim_dina_class()}} and \code{\link[simcdm:sim_dina_items]{simcdm::sim_dina_items()}} +\code{\link[=sim_dina_class]{sim_dina_class()}} and \code{\link[=sim_dina_items]{sim_dina_items()}} } \author{ Steven Andrew Culpepper and James Joseph Balamuta diff --git a/man/sim_dina_class.Rd b/man/sim_dina_class.Rd index 0c04d72..2ef8bb6 100644 --- a/man/sim_dina_class.Rd +++ b/man/sim_dina_class.Rd @@ -71,7 +71,7 @@ ETA = sim_eta_matrix(K, J, Q) Y_sim = sim_dina_class(N, J, CLs, ETA, gs, ss) } \seealso{ -\code{\link[simcdm:sim_dina_attributes]{simcdm::sim_dina_attributes()}} and \code{\link[simcdm:sim_dina_items]{simcdm::sim_dina_items()}} +\code{\link[=sim_dina_attributes]{sim_dina_attributes()}} and \code{\link[=sim_dina_items]{sim_dina_items()}} } \author{ Steven Andrew Culpepper and James Joseph Balamuta diff --git a/man/sim_dina_items.Rd b/man/sim_dina_items.Rd index 665c27d..9fb6471 100644 --- a/man/sim_dina_items.Rd +++ b/man/sim_dina_items.Rd @@ -67,7 +67,7 @@ dina_items = sim_dina_items(Alphas, Q, ss, gs) dina_attributes = sim_dina_attributes(Alphas, Q) } \seealso{ -\code{\link[simcdm:sim_dina_class]{simcdm::sim_dina_class()}} and \code{\link[simcdm:sim_dina_attributes]{simcdm::sim_dina_attributes()}} +\code{\link[=sim_dina_class]{sim_dina_class()}} and \code{\link[=sim_dina_attributes]{sim_dina_attributes()}} } \author{ Steven Andrew Culpepper and James Joseph Balamuta diff --git a/man/sim_eta_matrix.Rd b/man/sim_eta_matrix.Rd index 4c992d1..08dd737 100644 --- a/man/sim_eta_matrix.Rd +++ b/man/sim_eta_matrix.Rd @@ -51,8 +51,8 @@ Q_sim = sim_q_matrix(J, K) ETA_gen = sim_eta_matrix(K, J, Q_sim) } \seealso{ -\code{\link[simcdm:sim_q_matrix]{simcdm::sim_q_matrix()}}, \code{\link[simcdm:attribute_bijection]{simcdm::attribute_bijection()}}, and -\code{\link[simcdm:attribute_inv_bijection]{simcdm::attribute_inv_bijection()}} +\code{\link[=sim_q_matrix]{sim_q_matrix()}}, \code{\link[=attribute_bijection]{attribute_bijection()}}, and +\code{\link[=attribute_inv_bijection]{attribute_inv_bijection()}} } \author{ Steven Andrew Culpepper and James Joseph Balamuta diff --git a/man/sim_q_matrix.Rd b/man/sim_q_matrix.Rd index 09f39c4..68b234f 100644 --- a/man/sim_q_matrix.Rd +++ b/man/sim_q_matrix.Rd @@ -28,7 +28,7 @@ q_matrix_j7_k2 = sim_q_matrix(7, 2) q_matrix_j10_k3 = sim_q_matrix(10, 3) } \seealso{ -\code{\link[simcdm:attribute_bijection]{simcdm::attribute_bijection()}} and \code{\link[simcdm:attribute_inv_bijection]{simcdm::attribute_inv_bijection()}} +\code{\link[=attribute_bijection]{attribute_bijection()}} and \code{\link[=attribute_inv_bijection]{attribute_inv_bijection()}} } \author{ Steven Andrew Culpepper and James Joseph Balamuta diff --git a/man/sim_subject_attributes.Rd b/man/sim_subject_attributes.Rd index 583a43c..c22f072 100644 --- a/man/sim_subject_attributes.Rd +++ b/man/sim_subject_attributes.Rd @@ -40,7 +40,7 @@ probs = rep(1 / (2 ^ K), 2 ^ K) alphas_custom = sim_subject_attributes(N, K, probs) } \seealso{ -\code{\link[simcdm:attribute_classes]{simcdm::attribute_classes()}} and \code{\link[simcdm:attribute_inv_bijection]{simcdm::attribute_inv_bijection()}} +\code{\link[=attribute_classes]{attribute_classes()}} and \code{\link[=attribute_inv_bijection]{attribute_inv_bijection()}} } \author{ James Joseph Balamuta and Steven Andrew Culpepper diff --git a/man/simcdm-package.Rd b/man/simcdm-package.Rd index 0459a6b..a9f82d9 100644 --- a/man/simcdm-package.Rd +++ b/man/simcdm-package.Rd @@ -6,12 +6,7 @@ \alias{simcdm-package} \title{simcdm: Simulate Cognitive Diagnostic Model ('CDM') Data} \description{ -Provides efficient R and 'C++' routines to simulate cognitive diagnostic - model data for Deterministic Input, Noisy "And" Gate ('DINA') and - reduced Reparameterized Unified Model ('rRUM') from - Culpepper and Hudson (2017) , - Culpepper (2015) , and - de la Torre (2009) . +Provides efficient R and 'C++' routines to simulate cognitive diagnostic model data for Deterministic Input, Noisy "And" Gate ('DINA') and reduced Reparameterized Unified Model ('rRUM') from Culpepper and Hudson (2017) \doi{ 10.1177/0146621617707511}, Culpepper (2015) \doi{10.3102/1076998615595403}, and de la Torre (2009) \doi{10.3102/1076998607309474}. } \seealso{ Useful links: @@ -23,16 +18,16 @@ Useful links: } \author{ -\strong{Maintainer}: James Joseph Balamuta \email{balamut2@illinois.edu} (0000-0003-2826-8458) [copyright holder] +\strong{Maintainer}: James Joseph Balamuta \email{balamut2@illinois.edu} (\href{https://orcid.org/0000-0003-2826-8458}{ORCID}) [copyright holder] Authors: \itemize{ - \item Steven Andrew Culpepper \email{sculpepp@illinois.edu} (0000-0003-4226-6176) [copyright holder] + \item Steven Andrew Culpepper \email{sculpepp@illinois.edu} (\href{https://orcid.org/0000-0003-4226-6176}{ORCID}) [copyright holder] } Other contributors: \itemize{ - \item Aaron Hudson \email{awhudson@uw.edu} (0000-0002-9731-2224) [contributor, copyright holder] + \item Aaron Hudson \email{awhudson@uw.edu} (\href{https://orcid.org/0000-0002-9731-2224}{ORCID}) [contributor, copyright holder] } } diff --git a/src/Makevars b/src/Makevars index db20cc5..126bce3 100644 --- a/src/Makevars +++ b/src/Makevars @@ -1,6 +1,3 @@ -# Enable C++11 -CXX_STD = CXX11 - # Enable the header file and OpenMP PKG_CXXFLAGS = -I../inst/include $(SHLIB_OPENMP_CXXFLAGS) diff --git a/src/Makevars.win b/src/Makevars.win index db20cc5..126bce3 100644 --- a/src/Makevars.win +++ b/src/Makevars.win @@ -1,6 +1,3 @@ -# Enable C++11 -CXX_STD = CXX11 - # Enable the header file and OpenMP PKG_CXXFLAGS = -I../inst/include $(SHLIB_OPENMP_CXXFLAGS) diff --git a/src/RcppExports.cpp b/src/RcppExports.cpp index a150ba0..3adbadc 100644 --- a/src/RcppExports.cpp +++ b/src/RcppExports.cpp @@ -9,6 +9,11 @@ using namespace Rcpp; +#ifdef RCPP_USE_GLOBAL_ROSTREAM +Rcpp::Rostream& Rcpp::Rcout = Rcpp::Rcpp_cout_get(); +Rcpp::Rostream& Rcpp::Rcerr = Rcpp::Rcpp_cerr_get(); +#endif + // sim_dina_class arma::mat sim_dina_class(unsigned int N, unsigned int J, const arma::vec& CLASS, const arma::mat& ETA, const arma::vec& gs, const arma::vec& ss); static SEXP _simcdm_sim_dina_class_try(SEXP NSEXP, SEXP JSEXP, SEXP CLASSSEXP, SEXP ETASEXP, SEXP gsSEXP, SEXP ssSEXP) { @@ -43,7 +48,7 @@ RcppExport SEXP _simcdm_sim_dina_class(SEXP NSEXP, SEXP JSEXP, SEXP CLASSSEXP, S if (rcpp_isError_gen) { SEXP rcpp_msgSEXP_gen = Rf_asChar(rcpp_result_gen); UNPROTECT(1); - Rf_error(CHAR(rcpp_msgSEXP_gen)); + Rf_error("%s", CHAR(rcpp_msgSEXP_gen)); } UNPROTECT(1); return rcpp_result_gen; @@ -78,7 +83,7 @@ RcppExport SEXP _simcdm_sim_dina_attributes(SEXP alphasSEXP, SEXP QSEXP) { if (rcpp_isError_gen) { SEXP rcpp_msgSEXP_gen = Rf_asChar(rcpp_result_gen); UNPROTECT(1); - Rf_error(CHAR(rcpp_msgSEXP_gen)); + Rf_error("%s", CHAR(rcpp_msgSEXP_gen)); } UNPROTECT(1); return rcpp_result_gen; @@ -115,7 +120,7 @@ RcppExport SEXP _simcdm_sim_dina_items(SEXP alphasSEXP, SEXP QSEXP, SEXP ssSEXP, if (rcpp_isError_gen) { SEXP rcpp_msgSEXP_gen = Rf_asChar(rcpp_result_gen); UNPROTECT(1); - Rf_error(CHAR(rcpp_msgSEXP_gen)); + Rf_error("%s", CHAR(rcpp_msgSEXP_gen)); } UNPROTECT(1); return rcpp_result_gen; @@ -152,7 +157,7 @@ RcppExport SEXP _simcdm_sim_rrum_main(SEXP QSEXP, SEXP rstarSEXP, SEXP pistarSEX if (rcpp_isError_gen) { SEXP rcpp_msgSEXP_gen = Rf_asChar(rcpp_result_gen); UNPROTECT(1); - Rf_error(CHAR(rcpp_msgSEXP_gen)); + Rf_error("%s", CHAR(rcpp_msgSEXP_gen)); } UNPROTECT(1); return rcpp_result_gen; @@ -189,7 +194,7 @@ RcppExport SEXP _simcdm_sim_rrum_items(SEXP QSEXP, SEXP rstarSEXP, SEXP pistarSE if (rcpp_isError_gen) { SEXP rcpp_msgSEXP_gen = Rf_asChar(rcpp_result_gen); UNPROTECT(1); - Rf_error(CHAR(rcpp_msgSEXP_gen)); + Rf_error("%s", CHAR(rcpp_msgSEXP_gen)); } UNPROTECT(1); return rcpp_result_gen; @@ -223,7 +228,7 @@ RcppExport SEXP _simcdm_attribute_bijection(SEXP KSEXP) { if (rcpp_isError_gen) { SEXP rcpp_msgSEXP_gen = Rf_asChar(rcpp_result_gen); UNPROTECT(1); - Rf_error(CHAR(rcpp_msgSEXP_gen)); + Rf_error("%s", CHAR(rcpp_msgSEXP_gen)); } UNPROTECT(1); return rcpp_result_gen; @@ -258,7 +263,7 @@ RcppExport SEXP _simcdm_attribute_inv_bijection(SEXP KSEXP, SEXP CLSEXP) { if (rcpp_isError_gen) { SEXP rcpp_msgSEXP_gen = Rf_asChar(rcpp_result_gen); UNPROTECT(1); - Rf_error(CHAR(rcpp_msgSEXP_gen)); + Rf_error("%s", CHAR(rcpp_msgSEXP_gen)); } UNPROTECT(1); return rcpp_result_gen; @@ -293,7 +298,7 @@ RcppExport SEXP _simcdm_sim_q_matrix(SEXP JSEXP, SEXP KSEXP) { if (rcpp_isError_gen) { SEXP rcpp_msgSEXP_gen = Rf_asChar(rcpp_result_gen); UNPROTECT(1); - Rf_error(CHAR(rcpp_msgSEXP_gen)); + Rf_error("%s", CHAR(rcpp_msgSEXP_gen)); } UNPROTECT(1); return rcpp_result_gen; @@ -329,7 +334,7 @@ RcppExport SEXP _simcdm_sim_eta_matrix(SEXP KSEXP, SEXP JSEXP, SEXP QSEXP) { if (rcpp_isError_gen) { SEXP rcpp_msgSEXP_gen = Rf_asChar(rcpp_result_gen); UNPROTECT(1); - Rf_error(CHAR(rcpp_msgSEXP_gen)); + Rf_error("%s", CHAR(rcpp_msgSEXP_gen)); } UNPROTECT(1); return rcpp_result_gen; @@ -363,7 +368,7 @@ RcppExport SEXP _simcdm_attribute_classes(SEXP KSEXP) { if (rcpp_isError_gen) { SEXP rcpp_msgSEXP_gen = Rf_asChar(rcpp_result_gen); UNPROTECT(1); - Rf_error(CHAR(rcpp_msgSEXP_gen)); + Rf_error("%s", CHAR(rcpp_msgSEXP_gen)); } UNPROTECT(1); return rcpp_result_gen; @@ -399,7 +404,7 @@ RcppExport SEXP _simcdm_sim_subject_attributes(SEXP NSEXP, SEXP KSEXP, SEXP prob if (rcpp_isError_gen) { SEXP rcpp_msgSEXP_gen = Rf_asChar(rcpp_result_gen); UNPROTECT(1); - Rf_error(CHAR(rcpp_msgSEXP_gen)); + Rf_error("%s", CHAR(rcpp_msgSEXP_gen)); } UNPROTECT(1); return rcpp_result_gen;