diff --git a/R/conformal.R b/R/conformal.R index a9eb20ebe..9d91f6434 100755 --- a/R/conformal.R +++ b/R/conformal.R @@ -80,7 +80,7 @@ conformal_split <- function(x, test, calibration, score, conf_level, ...) { conformal_cv_plus <- function(x, test, R, score, conf_level, ...) { # cross-validation train <- get_modeldata(attr(x, "model")) - idx <- sample(seq_len(nrow(train)), nrow(train)) + idx <- sample.int(nrow(train), nrow(train)) idx <- split(idx, ceiling(seq_along(idx) / (length(idx) / R))) scores <- NULL for (i in idx) { diff --git a/R/methods_MCMCglmm.R b/R/methods_MCMCglmm.R index 66da413f4..460fa4e3a 100644 --- a/R/methods_MCMCglmm.R +++ b/R/methods_MCMCglmm.R @@ -9,7 +9,7 @@ get_predict.MCMCglmm <- function( ndraws_mod <- nrow(model$VCV) if (ndraws < ndraws_mod) { - idx <- sample(seq_len(ndraws_mod), ndraws) + idx <- sample.int(ndraws_mod, ndraws) } else { idx <- seq_len(ndraws_mod) } @@ -32,4 +32,4 @@ get_vcov.MCMCglmm <- function(model, insight::format_warning("The `vcov` argument is not supported for models of this class.") } return(NULL) -} \ No newline at end of file +} diff --git a/R/methods_rstpm2.R b/R/methods_rstpm2.R index dea858b1a..5dcb94cc9 100644 --- a/R/methods_rstpm2.R +++ b/R/methods_rstpm2.R @@ -48,7 +48,7 @@ get_predict.stpm2 <- function(model, newdata = NULL, ...) { sanity_predict_vector(pred = pred, model = model, newdata = newdata) sanity_predict_numeric(pred = pred, model = model, newdata = newdata) out <- data.frame( - rowid = 1:nrow(newdata), + rowid = seq_len(nrow(newdata)), estimate = pred) return(out) } diff --git a/R/slopes.R b/R/slopes.R index 3163a3a27..0676dc5e9 100644 --- a/R/slopes.R +++ b/R/slopes.R @@ -310,7 +310,7 @@ slopes <- function(model, data.table::setDT(out) - lean = getOption("marginaleffects_lean", default = FALSE) + lean <- getOption("marginaleffects_lean", default = FALSE) if (!isTRUE(lean)) { attr(out, "vcov.type") <- get_vcov_label(vcov) attr(out, "newdata") <- newdata # recall