[rkward-devel] as.list wrong behaviour

Thomas Friedrichsmeier thomas.friedrichsmeier at ruhr-uni-bochum.de
Tue Jan 4 16:13:41 UTC 2011


Hi,

On Tuesday 04 January 2011, Eduardo de Oliveira Horta wrote:
> > B = 1000
> > oblist = as.list(.GlobalEnv)

the problem appears to be our use of "active bindings" (see 
?makeActiveBinding). Internally, RKWard replaces all objects inside .GlobalEnv 
by active bindings. This allows us to find out, when the objects get modified. 
For almost all purposes, these active bindings behave just like the regular 
object, but apparently, as.list() copies the accessor functions, instead. I do 
wonder whether that is the expected behavior of as.list()...

Either way, RKWard will probably switch to a different strategy for detecting 
when objects get modified, in the not-too-distant future. The problem should go 
away, then. Meanwhile, perhaps you can work around the problem using code like 
this:

oblist <- sapply (ls (all.names=TRUE), function (x) get (x), simplify=FALSE)

Regards
Thomas
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 198 bytes
Desc: This is a digitally signed message part.
URL: <http://mail.kde.org/pipermail/rkward-devel/attachments/20110104/aa13451e/attachment.sig>


More information about the Rkward-devel mailing list