[R] how to remove the 'promise' attribute of an R object (.Random.seed)?

Yihui Xie xie at yihui.name
Wed May 23 03:57:58 CEST 2012


Thanks! That is exactly what I did
(https://github.com/yihui/knitr/blob/master/R/cache.R#L44) but I was
wondering if .Random.seed could be better recognized when it is lazy
loaded.

Regards,
Yihui
--
Yihui Xie <xieyihui at gmail.com>
Phone: 515-294-2465 Web: http://yihui.name
Department of Statistics, Iowa State University
2215 Snedecor Hall, Ames, IA


On Tue, May 22, 2012 at 8:08 PM, Duncan Murdoch
<murdoch.duncan at gmail.com> wrote:
>
> You can remove it by a simple assignment:
>
> .Random.seed <- .Random.seed
>
> will do it.  (The reason is that it doesn't copy the object blindly, it
> evaluates the RHS to get 1L, and it's a regular assignment, so that gets put
> into the LHS.)
>
> Duncan Murdoch



More information about the R-help mailing list