A Handcart And Mohair - 4 months ago 11

R Question

I understand what

`set.seed()`

- Is it possible to "reset" to something "more random" if you have called
`set.seed()`

earlier in your session? Is that even necessary?`set.seed()`

- Is it possible to view the seed that R is currently using?
- Is there a way to make allow alphanumeric seeds, the way one can enter them at random.org (be sure you are in the advanced mode, and see "Part 3" of the form to see what I mean)?
`set.seed()`

Answer

Just for fun:

```
set.seed.alpha <- function(x) {
require("digest")
hexval <- paste0("0x",digest(x,"crc32"))
intval <- type.convert(hexval) %% .Machine$integer.max
set.seed(intval)
}
```

So you can do:

```
set.seed.alpha("hello world")
```

(in fact `x`

can be any R object, not just an alphanumeric string)