From c82b04534ca1fc70978cfadef8d13804d399e55d Mon Sep 17 00:00:00 2001 From: ericward-noaa Date: Wed, 21 Feb 2024 12:03:37 -0800 Subject: [PATCH] Suppressing warning, making example more complicated --- R/fitting.R | 4 ++-- R/get_pars.R | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/R/fitting.R b/R/fitting.R index 0f787af..91705c9 100644 --- a/R/fitting.R +++ b/R/fitting.R @@ -41,7 +41,7 @@ #' y <- matrix(runif(99,1,4), ncol=3) #' design <- data.frame("fac" = sample(letters[1:5], size=nrow(y), replace=TRUE)) #' design$fac <- as.factor(design$fac) -#' fit <- fit_zoid(formula = ~(1|fac), design_matrix = design, data_matrix = y, chains = 1, iter = 100) +#' fit <- fit_zoid(formula = ~(1|fac), design_matrix = design, data_matrix = y, chains = 1, iter = 1000) #' fit_zoid <- function(formula = NULL, design_matrix, @@ -70,7 +70,7 @@ fit_zoid <- function(formula = NULL, est_re <- FALSE re_group_names <- NA if (!is.null(formula)) { - model_frame <- model.frame(formula, design_matrix) + model_frame <- suppressWarnings(model.frame(formula, design_matrix)) model_matrix <- model.matrix(formula, model_frame) # extract the random effects res <- parse_re_formula(formula, design_matrix) diff --git a/R/get_pars.R b/R/get_pars.R index 4326980..5280b6d 100644 --- a/R/get_pars.R +++ b/R/get_pars.R @@ -18,7 +18,7 @@ #' #' @examples #' \donttest{ -#' y <- matrix(c(3.77, 6.63, 2.60, 0.9, 1.44, 0.66, 2.10, 3.57, 1.33), +#' y <- matrix(c(3.77, 6.63, 2.60, 0.9, 1.44, 0.66, 2.10, 3.57, 1.33, 3.4, 1.4, 5), #' nrow = 3, byrow = TRUE #' ) #' # fit a model with no covariates