Skip to contents

set.char.seed() converts a character vector into an integer used as reproducible seed

Usage

set.char.seed(char)

Arguments

char

a character vector

Value

set.char.seed() takes a character vector and returns a reproducible seed.

Details

Each letter and number in the character vector is assigned a specific number. These 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 vector, otherwise you will get a seed of 0.

Author

JP Monteagudo

Examples

set.char.seed("The Sticky Chicken")
#> [1] 258156544
set.char.seed("lanky tadpole")
#> [1] 1017058471
set.char.seed("Manny said what?")
#> [1] 241593498