Skip to content

Commit

Permalink
Polish the CRAN release (#3)
Browse files Browse the repository at this point in the history
* Fix ambiguous call to pow function.

* Rename `sim_attribute_classes()` to `attribute_classes()`.

* - Fix Authors@R spacing
- Lower R dependency to pass the oldrel check
- Add dependency on simcdm to greater than 0.1.0

* Spacing + method paper information.

* Remove remote dependency on simcdm

* Switch \code{} to ``

* Missed one of `sim_attribute_classes()` to `attribute_classes()` rename...

* Enable testing on the old release...

* Add release notes.

* Update CRAN comments...
  • Loading branch information
coatless committed Feb 1, 2019
1 parent 2a251a3 commit 9ae70d9
Show file tree
Hide file tree
Showing 11 changed files with 45 additions and 26 deletions.
1 change: 1 addition & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ jobs:
include:
- r: release
- r: devel
- r: oldrel

# If one fails, avoid running the other.
matrix:
Expand Down
9 changes: 5 additions & 4 deletions DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -2,23 +2,25 @@ Package: dina
Type: Package
Title: Bayesian Estimation of DINA Model
Version: 2.0.0
Authors@R: c(person("Steven Andrew", "Culpepper",
Authors@R: c(
person("Steven Andrew", "Culpepper",
email = "sculpepp@illinois.edu",
role = c("aut", "cph"),
comment = c(ORCID = "0000-0003-4226-6176")
),
person("James Joseph", "Balamuta",
email = "balamut2@illinois.edu",
role = c("aut", "cre"),
comment = c(ORCID = "0000-0003-2826-8458"))
comment = c(ORCID = "0000-0003-2826-8458")
)
)
Description: Estimate the Deterministic Input, Noisy "And" Gate (DINA)
cognitive diagnostic model parameters using the Gibbs sampler described
by Culpepper (2015) <doi:10.3102/1076998615595403>.
URL: https://github.com/tmsalab/dina
BugReports: https://github.com/tmsalab/dina/issues
License: GPL (>= 2)
Depends: R (>= 3.5.0), simcdm
Depends: R (>= 3.4.0), simcdm (>= 0.1.0)
LinkingTo: Rcpp (>= 1.0.0), RcppArmadillo (>= 0.9.200), simcdm, rgen
Imports: Rcpp (>= 1.0.0)
Suggests:
Expand All @@ -28,4 +30,3 @@ Suggests:
RoxygenNote: 6.1.1
Roxygen: list(markdown = TRUE)
Encoding: UTF-8
Remotes: tmsalab/simcdm
2 changes: 1 addition & 1 deletion NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
export(DINA_Gibbs)
export(dina)
importFrom(Rcpp,evalCpp)
importFrom(simcdm,sim_attribute_classes)
importFrom(simcdm,attribute_classes)
importFrom(simcdm,sim_dina_items)
importFrom(simcdm,sim_q_matrix)
importFrom(simcdm,sim_subject_attributes)
Expand Down
12 changes: 11 additions & 1 deletion NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,20 @@

- Switched internal portions of the package to use the `simcdm` _C++_ routines
and imported _R_ level-routines.
- Enabled markdown for inline documentiona with roxygen2.
- Switched from `src/init.c` to autogeneration via Rcpp 0.12.15
- Removed miscellaneous RNG seed.

## Documentation

- Enabled markdown for inline documentiona with roxygen2.
- Improved documentation flow

## Deployment

- Added TMSA Lab's Travis-CI configuration for testing across R versions.
- Added Unit Tests for model reproducibility.
- Added code coverage results.

# dina 1.0.2

- Addressed R 3.4 registration requirements.
Expand Down
8 changes: 4 additions & 4 deletions R/RcppExports.R
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@
#' @param Amat A \eqn{C \times K}{C x K} `matrix` of latent classes.
#' @param Q A \eqn{N \times K}{N x K} `matrix` indicating which
#' skills are required for which items.
#' @param ss A \eqn{J} \code{vector} of item slipping parameters.
#' @param gs A \eqn{J} \code{vector} of item guessing parameters.
#' @param ss A \eqn{J} `vector` of item slipping parameters.
#' @param gs A \eqn{J} `vector` of item guessing parameters.
#' @param Y A \eqn{N \times J}{N x J} `matrix` of observed responses.
#' @param PIs A \eqn{C} \code{vector} of latent class probabilities.
#' @param PIs A \eqn{C} `vector` of latent class probabilities.
#' @param ALPHAS A \eqn{N \times K}{N x K} `matrix` of latent attributes.
#' @param delta0 A \eqn{J} `vector` of Dirichlet prior parameters.
#'
Expand Down Expand Up @@ -78,7 +78,7 @@ update_sg <- function(Y, Q, ALPHAS, ss_old, as0, bs0, ag0, bg0) {
#' Steven Andrew Culpepper
#'
#' @seealso
#' [simcdm::sim_dina_items()] and [simcdm::sim_attribute_classes()]
#' [simcdm::sim_dina_items()] and [simcdm::attribute_classes()]
#'
#' @noRd
DINA_Gibbs_cpp <- function(Y, Q, chain_length = 10000L) {
Expand Down
2 changes: 1 addition & 1 deletion R/dina-est.R
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
#' Steven Andrew Culpepper and James Joseph Balamuta
#'
#' @seealso
#' [simcdm::sim_dina_items()] and [simcdm::sim_attribute_classes()]
#' [simcdm::sim_dina_items()] and [simcdm::attribute_classes()]
#'
#' @export
#' @examples
Expand Down
2 changes: 1 addition & 1 deletion R/dina-package.R
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#' @useDynLib "dina", .registration=TRUE
#' @importFrom Rcpp evalCpp
#' @importFrom simcdm sim_dina_items sim_attribute_classes sim_q_matrix sim_subject_attributes
#' @importFrom simcdm sim_dina_items attribute_classes sim_q_matrix sim_subject_attributes
#' @aliases dina-package
"_PACKAGE"
17 changes: 12 additions & 5 deletions cran-comments.md
Original file line number Diff line number Diff line change
@@ -1,18 +1,25 @@
## Test environments
* local OS X install, R 3.5.2
* ubuntu 14.04 (on travis-ci), R 3.5.2
* win-builder (devel and release)

- local OS X install, R 3.5.2
- ubuntu 14.04 (on travis-ci), R 3.5.2
- win-builder (devel and release)

## R CMD check results

0 errors | 0 warnings | 1 note

We have one note related to spelling:
Maintainer: 'James Joseph Balamuta <balamut2@illinois.edu>'

New maintainer:
James Joseph Balamuta <balamut2@illinois.edu>
Old maintainer(s):
Steven Andrew Culpepper <sculpepp@illinois.edu>

Possibly mis-spelled words in DESCRIPTION:
Culpepper (10:8)

The mis-spelled word is the author's last name.
- We are changing the maintainer of the package.
- The mis-spelled word is a package author's last name.

## Reverse dependencies

Expand Down
4 changes: 2 additions & 2 deletions inst/CITATION
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
citHeader("To cite the 'dina' package in publications use:")
citHeader("To cite the 'dina' R package and methods paper in publications use:")

citEntry(entry = "Manual",
title = "{dina: Bayesian Estimation of DINA Model}",
author = personList(as.person("Steven Andrew Culpepper"),
as.person("James Joseph Balamuta")
),
year = 2019,
textVersion = paste("Culpepper, S.A. and Balamuta, J.J. (2019)",
textVersion = paste("Culpepper, S. A. and Balamuta, J. J. (2019)",
"dina: Bayesian Estimation of DINA Model.",
"URL https://cran.r-project.org/package=dina.")
)
Expand Down
2 changes: 1 addition & 1 deletion man/dina.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 6 additions & 6 deletions src/dina-estimation-routine.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@
//' @param Amat A \eqn{C \times K}{C x K} `matrix` of latent classes.
//' @param Q A \eqn{N \times K}{N x K} `matrix` indicating which
//' skills are required for which items.
//' @param ss A \eqn{J} \code{vector} of item slipping parameters.
//' @param gs A \eqn{J} \code{vector} of item guessing parameters.
//' @param ss A \eqn{J} `vector` of item slipping parameters.
//' @param gs A \eqn{J} `vector` of item guessing parameters.
//' @param Y A \eqn{N \times J}{N x J} `matrix` of observed responses.
//' @param PIs A \eqn{C} \code{vector} of latent class probabilities.
//' @param PIs A \eqn{C} `vector` of latent class probabilities.
//' @param ALPHAS A \eqn{N \times K}{N x K} `matrix` of latent attributes.
//' @param delta0 A \eqn{J} `vector` of Dirichlet prior parameters.
//'
Expand Down Expand Up @@ -168,7 +168,7 @@ Rcpp::List update_sg(const arma::mat &Y, const arma::mat &Q,
//' Steven Andrew Culpepper
//'
//' @seealso
//' [simcdm::sim_dina_items()] and [simcdm::sim_attribute_classes()]
//' [simcdm::sim_dina_items()] and [simcdm::attribute_classes()]
//'
//' @noRd
// [[Rcpp::export]]
Expand All @@ -186,10 +186,10 @@ Rcpp::List DINA_Gibbs_cpp(const arma::mat &Y, const arma::mat &Q,
unsigned int K = Q.n_cols;

// Number of Latent Classes (2^k)
unsigned int C = pow(2, K);
unsigned int C = static_cast<unsigned int>(pow(2.0, static_cast<double>(K)));

// Generate the latent class alpha matrix
arma::mat Amat = simcdm::sim_attribute_classes(K);
arma::mat Amat = simcdm::attribute_classes(K);

// Prior values for betas and Dirichlet distribution
arma::vec delta0 = arma::ones<arma::vec>(C);
Expand Down

0 comments on commit 9ae70d9

Please sign in to comment.