Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
strengejacke committed Jan 21, 2025
1 parent 528f8d8 commit 0eb37f9
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 1 addition & 1 deletion R/get_datagrid.R
Original file line number Diff line number Diff line change
Expand Up @@ -805,7 +805,7 @@ get_datagrid.comparisons <- get_datagrid.slopes
} else if (length(parts) == 1) {
# If one, might be a shortcut. or a sampling request
if (grepl("sample", parts, fixed = TRUE)) {
n_to_sample <- .safe(suppressWarning(as.numeric(trim_ws(gsub("sample", "", parts, fixed = TRUE))))) # nolint
n_to_sample <- .safe(as.numeric(trim_ws(gsub("sample", "", parts, fixed = TRUE))))
# do we have a proper definition of the sample size? If not, error
if (is.null(n_to_sample) || is.na(n_to_sample) || !length(n_to_sample)) {
format_error("The token `sample` must be followed by the number of samples to be drawn, e.g. `[sample 15]`.") # nolint
Expand Down
1 change: 1 addition & 0 deletions tests/testthat/test-get_datagrid.R
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ test_that("get_datagrid - terciles, quartiles, mean-sd", {
)

skip_if_not_installed("ggeffects")
skip_if_not_installed("datawizard")
data(efc, package = "ggeffects")
efc$c161sex <- datawizard::to_factor(efc$c161sex)
efc$e16sex <- datawizard::to_factor(efc$e16sex)
Expand Down

0 comments on commit 0eb37f9

Please sign in to comment.