Ok, a bit more:
The relevant bit in serialize.c that I can see is:
if (ALTREP(s) && stream->version >= 3) {
SEXP info = ALTREP_SERIALIZED_CLASS(s);
SEXP state = ALTREP_SERIALIZED_STATE(s);
if (info != NULL && state != NULL) {
int flags = PackFlags(ALTREP_SXP, LEVELS(s), OBJECT(s), 0, 0);
Hi all,
I don't have a solution yet, but a bit more here:
> .Internal(inspect(x2b))
@7f913826d590 14 REALSXP g0c0 [REF(1)] wrapper [srt=-2147483648,no_na=0]
@7f9137500320 14 REALSXP g0c7 [REF(2),ATT] (len=100, tl=0)
0.45384,0.926371,0.838637,-1.71485,-0.719073,...
ATTRIB:
@7f913826dc
Hi all,
Setting names/dimnames on vectors/matrices of length>=64 returns an ALTREP
wrapper which internally still contains the names/dimnames, and calling
base::serialize on the result writes them out. They are unserialized in the
same way, with the names/dimnames hidden in the ALTREP wrapper,
On Thu, 1 Jul 2021, Konrad Siek wrote:
Thanks!
So what would be the prescribed way of assigning elements to a CPLXSXP if I
needed to?
The first question is whether you need to do this. Or, more to the
point, whether it is safe to do this. In R objects should behave as if
they are not mutable.