Displaying 3 results from an estimated 3 matches for "wrap_altrep".
2020 Oct 07
2
Coercion function does not work for the ALTREP object
...l,
The coercion function defined for the ALTREP object will not be called by R
when an assignment operation implicitly introduces coercion for a large
ALTREP object.
For example, If I create a vector of length 10, the ALTREP coercion
function seems to work fine.
```
> x <- 1:10
> y <- wrap_altrep(x)
> .Internal(inspect(y))
@0x000000001f9271c0 13 INTSXP g0c0 [REF(2)] I am altrep
> y[1] <- 1.0
Duplicating object
Coercing object
> .Internal(inspect(y))
@0x000000001f927c08 14 REALSXP g0c0 [REF(1)] I am altrep
```
However, if I create a vector of length 1024, R will give me a normal...
2020 Oct 08
1
Coercion function does not work for the ALTREP object
...t;> R
>> when an assignment operation implicitly introduces coercion for a large
>> ALTREP object.
>>
>> For example, If I create a vector of length 10, the ALTREP coercion
>> function seems to work fine.
>> ```
>> > x <- 1:10
>> > y <- wrap_altrep(x)
>> > .Internal(inspect(y))
>> @0x000000001f9271c0 13 INTSXP g0c0 [REF(2)] I am altrep
>> > y[1] <- 1.0
>> Duplicating object
>> Coercing object
>> > .Internal(inspect(y))
>> @0x000000001f927c08 14 REALSXP g0c0 [REF(1)] I am altrep
>> ``...
2020 Oct 07
0
Coercion function does not work for the ALTREP object
...he ALTREP object will not be called by R
> when an assignment operation implicitly introduces coercion for a large
> ALTREP object.
>
> For example, If I create a vector of length 10, the ALTREP coercion
> function seems to work fine.
> ```
> > x <- 1:10
> > y <- wrap_altrep(x)
> > .Internal(inspect(y))
> @0x000000001f9271c0 13 INTSXP g0c0 [REF(2)] I am altrep
> > y[1] <- 1.0
> Duplicating object
> Coercing object
> > .Internal(inspect(y))
> @0x000000001f927c08 14 REALSXP g0c0 [REF(1)] I am altrep
> ```
>
> However, if I create...