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

luke-tierney at uiowa.edu luke-tierney at uiowa.edu
Wed May 23 04:34:53 CEST 2012


I believe it would be better if the internal code forced the promise
at this point.  I'll have a look; there may be a few other similar
instances worth looking at.

luke

On Tue, 22 May 2012, Yihui Xie wrote:

> 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
>
> ______________________________________________
> R-help at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
>


More information about the R-help mailing list