FYI,
from the recent R devel NEWS file:
as.vector() and as.double() etc duplicate less when they leave the
mode unchanged but remove attributes.
as.vector(mode = any) no longer duplicates when it does not remove
attributes. This helps memory usage in matrix() and array().
This improvement will
Hi,
I've noticed that as.vector() always allocates a new object, e.g.
x - 1:10;
x - as.vector(x);
tracemem(x);
[1] 0x05622db8
x - as.vector(x);
tracemem[0x05622db8 - 0x05622ec0]: as.vector
x - as.vector(x);
tracemem[0x05622ec0 - 0x05622f18]: as.vector