-
Notifications
You must be signed in to change notification settings - Fork 66
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Deal with snapshot differences between R CMD check "regular" and "hard" more elegantly #539
Comments
🤨 This is a weird one. Nothing artful from me, though I think your thought to migrate setup code inside of |
Attempt 1 failed: #540 - but we have cleaner tests nonetheless 🤷♀️ |
happening in library(rsample)
library(magrittr)
set.seed(888)
rand_nums <- rnorm(1000, 10, 1)
dat <- data.frame(x = rand_nums)
get_stats <- function(split, ...) {
dat <- analysis(split)
x <- dat[[1]]
tibble::tibble(
term = "mean",
estimate = mean(x, na.rm = TRUE),
std.error = sqrt(var(x, na.rm = TRUE) / sum(!is.na(x)))
)
}
set.seed(456765)
bt_small <- bootstraps(dat, times = 10, apparent = TRUE) %>%
dplyr::mutate(
stats = purrr::map(splits, ~ get_stats(.x)),
junk = 1:11
)
tmp <- int_bca(bt_small, stats, .fn = get_stats)
#> Warning: Recommend at least 1000 non-missing bootstrap resamples for term
#> `mean`.
#>
#> Attaching package: 'purrr'
#> The following object is masked from 'package:magrittr':
#>
#> set_names |
this is kinda weird, because it definitely depends on the loaded packages. You no longer get the message if you remove library(rsample)
set.seed(888)
rand_nums <- rnorm(1000, 10, 1)
dat <- data.frame(x = rand_nums)
get_stats <- function(split, ...) {
dat <- analysis(split)
x <- dat[[1]]
tibble::tibble(
term = "mean",
estimate = mean(x, na.rm = TRUE),
std.error = sqrt(var(x, na.rm = TRUE) / sum(!is.na(x)))
)
}
set.seed(456765)
bt_small <- bootstraps(dat, times = 10, apparent = TRUE) |>
dplyr::mutate(
stats = purrr::map(splits, ~ get_stats(.x)),
junk = 1:11
)
tmp <- int_bca(bt_small, stats, .fn = get_stats)
#> Warning: Recommend at least 1000 non-missing bootstrap resamples for term
#> `mean`. |
In #538 a snapshot changed between R CMD check "regular" and "hard" without the suggested packages.
https://github.com/tidymodels/rsample/actions/runs/10927479579/job/30333727728
The text was updated successfully, but these errors were encountered: