diff --git a/NEWS.md b/NEWS.md index 353d852..b79aa42 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,6 +1,6 @@ # tarchetypes 0.7.10 -* Prepare to use `tar_seed_create()` (https://github.com/ropensci/targets/issues/1139). +* Prepare to use `tar_seed_create()` and `tar_seed_set()` (https://github.com/ropensci/targets/issues/1139). Future versions of `tarchetypes` should use these package functions, but this version cannot because of the compatibility constraints of the release cycle. * Migrate tests to `targets` >= 1.3.2.9004 progress statuses ("completed" instead of "built", "dispatched" instead of "started"). # tarchetypes 0.7.9 diff --git a/R/utils_seed.R b/R/utils_seed.R index 5f10a39..b860826 100644 --- a/R/utils_seed.R +++ b/R/utils_seed.R @@ -1,5 +1,5 @@ # TODO: use targets::tar_seed_create() when CRAN targets has it. -tar_seed_create <- function (name, global_seed = NULL) { +tar_seed_create <- function(name, global_seed = NULL) { if (is.null(global_seed)) { global_seed <- targets::tar_option_get("seed") } @@ -10,7 +10,7 @@ tar_seed_create <- function (name, global_seed = NULL) { hash <- digest::digest( object = name, algo = "sha512", - serialize = FALSE, + serialize = FALSE, file = FALSE, seed = 0L ) @@ -18,12 +18,12 @@ tar_seed_create <- function (name, global_seed = NULL) { } # TODO: same -tar_seed_set <- function (seed) { +tar_seed_set <- function(seed) { if (!is.null(seed) && !anyNA(seed)) { set.seed( seed = seed, kind = "default", - normal.kind = "default", + normal.kind = "default", sample.kind = "default" ) }