Skip to content

Commit

Permalink
Depend on R 3.6.0
Browse files Browse the repository at this point in the history
Closes #269
  • Loading branch information
lionel- committed Jul 31, 2024
1 parent afd84aa commit 0242c0a
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 10 deletions.
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ License: MIT + file LICENSE
URL: https://withr.r-lib.org, https://github.com/r-lib/withr#readme
BugReports: https://github.com/r-lib/withr/issues
Depends:
R (>= 3.5.0)
R (>= 3.6.0)
Imports:
graphics,
grDevices
Expand Down
9 changes: 0 additions & 9 deletions R/rng.R
Original file line number Diff line number Diff line change
Expand Up @@ -60,22 +60,13 @@ local_rng_version <- function(version, .local_envir = parent.frame()) {
old
}

on_load(
is_before_3.6 <- getRversion() < "3.6"
)

restore_rng_kind <- function(kind) {
# Silence static analysis linting about `RNGkind()` signature on old
# R versions
RNGkind <- get("RNGkind")

RNGkind(kind[[1]], normal.kind = kind[[2]])

# No sample argument on old R versions
if (is_before_3.6) {
return()
}

# Within a `local_rng_version("3.5.0")`, we restore to `"Rounding"`,
# which causes a warning. See https://github.com/r-lib/withr/issues/167
sample_kind <- kind[[3]]
Expand Down

0 comments on commit 0242c0a

Please sign in to comment.