Skip to content

Commit

Permalink
updating seed function rmd fail check in macos
Browse files Browse the repository at this point in the history
  • Loading branch information
jpmonteagudo28 committed Aug 2, 2024
1 parent 1b484d0 commit 6573c12
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions R/set.char.seed.R
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
#'
#' @details
#' Each letter and number in the character vector is assigned a specific number. These
#' numbers are concatenated and divided by 2^39 - 1, and the remainder of this division
#' numbers are concatenated and divided by 2^30 - 1, and the remainder of this division
#' is used as the numeric reproducible seed.
#'
#' If you get a warning about 'loss of accuracy", consider using a more succinct character
Expand Down Expand Up @@ -40,7 +40,7 @@ set.char.seed <- function(char) {
num_seed <- as.numeric(paste(split_it, collapse=""))
num_seed

seed <- as.integer( num_seed %% (2^31-1) )
seed <- as.integer( num_seed %% (2^30-1) )
return(seed)
}

2 changes: 1 addition & 1 deletion man/set.char.seed.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion tests/testthat/test-set.char.seed.R
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
test_that("returns a numeric vector 1L", {
expect_equal(set.char.seed("stupefied lepricon"), 649068544)
expect_equal(set.char.seed("hello"), 85121215)
})

#> test passed

0 comments on commit 6573c12

Please sign in to comment.