Skip to content

Commit

Permalink
skpr v1.7.4: Fix bug in skprGUI where a model with hard to change ter…
Browse files Browse the repository at this point in the history
…ms and a manually specified model would not be converted from a character string to a formula
  • Loading branch information
tylermorganwall committed Dec 3, 2024
1 parent 1d0a744 commit 7e00961
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 11 deletions.
2 changes: 2 additions & 0 deletions .Rbuildignore
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,5 @@
^pkgdown$
^tests/.*$
_\.new\.png$
^compile_commands\.json$
^\.cache$
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,5 @@ src/*.dll
docs
# {shinytest2}: Ignore new debug snapshots for `$expect_values()`
*_.new.png
compile_commands.json
.cache
7 changes: 4 additions & 3 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
Package: skpr
Title: Design of Experiments Suite: Generate and Evaluate Optimal Designs
Date: 2024-07-11
Version: 1.7.3
Date: 2024-12-03
Version: 1.7.4
Authors@R: c(person("Tyler", "Morgan-Wall", email = "tylermw@gmail.com", role = c("aut", "cre")),
person("George", "Khoury", email = "george.m.khoury@gmail.com", role = c("aut")))
Description: Generates and evaluates D, I, A, Alias, E, T, and G optimal designs. Supports generation and evaluation of blocked and split/split-split/.../N-split plot designs. Includes parametric and Monte Carlo power evaluation functions, and supports calculating power for censored responses. Provides a framework to evaluate power using functions provided in other packages or written by the user. Includes a Shiny graphical user interface that displays the underlying code used to create and evaluate the design to improve ease-of-use and make analyses more reproducible. For details, see Morgan-Wall et al. (2021) <doi:10.18637/jss.v099.i01>.
Copyright: Institute for Defense Analyses
Depends:
R (>= 3.0.2)
License: GPL-3
RoxygenNote: 7.3.1
RoxygenNote: 7.3.2
Imports:
utils,
iterators,
Expand All @@ -36,3 +36,4 @@ Encoding: UTF-8
URL: https://github.com/tylermorganwall/skpr,
https://tylermorganwall.github.io/skpr/
BugReports: https://github.com/tylermorganwall/skpr/issues
Config/build/compilation-database: true
2 changes: 1 addition & 1 deletion R/skprGUI.R
Original file line number Diff line number Diff line change
Expand Up @@ -1807,7 +1807,7 @@ skprGUI = function(browser = FALSE, return_app = FALSE, multiuser = FALSE, progr
regex = paste0("(\\b", term, "\\b)|(\\b", term, ":)|(:", term, "\\b)|(\\b", term, "\\s\\*)|(\\*\\s", term, "\\b)|(:", term, ":)")
regularmodel = regularmodel | grepl(regex, modelsplit, perl = TRUE)
}
paste0("~", paste(modelsplit[!regularmodel], collapse = " + "))
as.formula(paste0("~", paste(modelsplit[!regularmodel], collapse = " + ")))
}
}
})
Expand Down
2 changes: 1 addition & 1 deletion src/RcppExports.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ BEGIN_RCPP
END_RCPP
}
// genOptimalDesign
List genOptimalDesign(Eigen::MatrixXd initialdesign, const Eigen::MatrixXd& candidatelist, const std::string condition, const Eigen::MatrixXd& momentsmatrix, Eigen::VectorXd initialRows, Eigen::MatrixXd aliasdesign, const Eigen::MatrixXd& aliascandidatelist, double minDopt, double tolerance, int augmentedrows, int kexchange);
Rcpp::List genOptimalDesign(Eigen::MatrixXd initialdesign, const Eigen::MatrixXd& candidatelist, const std::string condition, const Eigen::MatrixXd& momentsmatrix, Eigen::VectorXd initialRows, Eigen::MatrixXd aliasdesign, const Eigen::MatrixXd& aliascandidatelist, double minDopt, double tolerance, int augmentedrows, int kexchange);
RcppExport SEXP _skpr_genOptimalDesign(SEXP initialdesignSEXP, SEXP candidatelistSEXP, SEXP conditionSEXP, SEXP momentsmatrixSEXP, SEXP initialRowsSEXP, SEXP aliasdesignSEXP, SEXP aliascandidatelistSEXP, SEXP minDoptSEXP, SEXP toleranceSEXP, SEXP augmentedrowsSEXP, SEXP kexchangeSEXP) {
BEGIN_RCPP
Rcpp::RObject rcpp_result_gen;
Expand Down
14 changes: 8 additions & 6 deletions src/genOptimalDesign.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
#include <Rcpp.h>
#include <RcppEigen.h>
// [[Rcpp::depends(RcppEigen)]]
#include <queue>
#include <string>

#include "optimalityfunctions.h"
#include "nullify_alg.h"
Expand All @@ -21,12 +23,12 @@ using namespace Rcpp;
//`@param augmentedrows The rows that are fixed during the design search.
//`@return List of design information.
// [[Rcpp::export]]
List genOptimalDesign(Eigen::MatrixXd initialdesign, const Eigen::MatrixXd& candidatelist,
const std::string condition,
const Eigen::MatrixXd& momentsmatrix, Eigen::VectorXd initialRows,
Eigen::MatrixXd aliasdesign,
const Eigen::MatrixXd& aliascandidatelist,
double minDopt, double tolerance, int augmentedrows, int kexchange) {
Rcpp::List genOptimalDesign(Eigen::MatrixXd initialdesign, const Eigen::MatrixXd& candidatelist,
const std::string condition,
const Eigen::MatrixXd& momentsmatrix, Eigen::VectorXd initialRows,
Eigen::MatrixXd aliasdesign,
const Eigen::MatrixXd& aliascandidatelist,
double minDopt, double tolerance, int augmentedrows, int kexchange) {
RNGScope rngScope;
int nTrials = initialdesign.rows();
double numberrows = initialdesign.rows();
Expand Down

0 comments on commit 7e00961

Please sign in to comment.