diff --git a/DESCRIPTION b/DESCRIPTION index 1b8b988..2366645 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -14,7 +14,8 @@ Imports: AlgDesign, flipFormat, flipTransformations, Rcpp (>= 0.12.10), - rstan + rstan, + flipU Suggests: testthat, foreign LinkingTo: Rcpp diff --git a/NAMESPACE b/NAMESPACE index 3b33863..690d616 100644 --- a/NAMESPACE +++ b/NAMESPACE @@ -19,7 +19,7 @@ importFrom(flipFormat,FormatAsPercent) importFrom(flipFormat,FormatWithDecimals) importFrom(flipFormat,HistTable) importFrom(flipFormat,MaxDiffTableClasses) -importFrom(flipFormat,TrimWhitespace) +importFrom(flipU,TrimWhitespace) importFrom(rstan,extract) importFrom(rstan,rstan_options) importFrom(rstan,sampling) diff --git a/R/data.R b/R/data.R index 0c53f2e..17c0497 100644 --- a/R/data.R +++ b/R/data.R @@ -64,7 +64,7 @@ IntegrateDesignAndData <- function(design, version, best, worst, seed, questions } #' @importFrom flipData CalibrateWeight CleanSubset CleanWeights -#' @importFrom flipFormat TrimWhitespace +#' @importFrom flipU TrimWhitespace cleanAndCheckData <- function(design, version = NULL, best, worst, alternative.names, subset = NULL, weights = NULL, characteristics = NULL, seed, questions.left.out = 0) { diff --git a/R/max-diff.R b/R/max-diff.R index 21b45eb..c800ee5 100644 --- a/R/max-diff.R +++ b/R/max-diff.R @@ -175,7 +175,7 @@ Memberships <- function(object) #' \code{print.CorrespondenceAnalysis} #' @param x FitMaxDiff object. #' @param ... further arguments passed to or from other methods. -#' @importFrom flipFormat HistTable MaxDiffTableClasses FormatAsPercent FormatWithDecimals +#' @importFrom flipFormat HistTable MaxDiffTableClasses FormatAsPercent FormatAsReal #' @importFrom stats median quantile #' @export print.FitMaxDiff <- function(x, ...) @@ -193,7 +193,7 @@ print.FitMaxDiff <- function(x, ...) footer <- paste0(footer, "Filters have been applied; ") if (!is.null(x$weights)) footer <- paste0(footer, "Weights have been applied; Effective sample size: ", - FormatWithDecimals(x$effective.sample.size, 2), "; ") + FormatAsReal(x$effective.sample.size, 2), "; ") footer <- paste0(footer, "Number of questions: ", x$n.questions, "; ") if (x$questions.left.out > 0) { @@ -203,8 +203,8 @@ print.FitMaxDiff <- function(x, ...) footer <- paste0(footer, "Alternatives per question: ", x$n.alternatives.per.task, "; ") if (x$algorithm != "HB") { - footer <- paste0(footer, "Log-likelihood: ", FormatWithDecimals(x$log.likelihood, 2), "; ") - footer <- paste0(footer, "BIC: ", FormatWithDecimals(x$bic, 2), "; ") + footer <- paste0(footer, "Log-likelihood: ", FormatAsReal(x$log.likelihood, 2), "; ") + footer <- paste0(footer, "BIC: ", FormatAsReal(x$bic, 2), "; ") } footer <- if (!x$lc && x$algorithm != "HB" && !x$is.mixture.of.normals) @@ -246,7 +246,7 @@ print.FitMaxDiff <- function(x, ...) probs <- x$respondent.probabilities stats.table <- matrix(NA, nrow = ncol(probs), ncol = 1) for (i in 1:ncol(probs)) - stats.table[i, 1] <- FormatWithDecimals(mean(probs[, i], na.rm = TRUE) * 100, 1) + stats.table[i, 1] <- FormatAsReal(mean(probs[, i], na.rm = TRUE) * 100, 1) colnames(stats.table) <- "Mean Probability (%)" HistTable(100 * probs, title = title, subtitle = subtitle, footer = footer, diff --git a/README.md b/README.md new file mode 100644 index 0000000..d3c7108 --- /dev/null +++ b/README.md @@ -0,0 +1,3 @@ +# flipMaxDiff + +Made a couple of code changes that prevented it from running correctly