On Apr 11, 2014, at 3:47 PM, Romain Francois wrote:
> Hello,
>
> I’ve been using shrinking in
> https://github.com/hadley/dplyr/blob/master/inst/include/tools/ShrinkableVector.h
>
> This defines a ShrinkableVector of some R type (INTSXP, ...) given the
> maximum number of elements it will h
Hello,
I’ve been using shrinking in
https://github.com/hadley/dplyr/blob/master/inst/include/tools/ShrinkableVector.h
This defines a ShrinkableVector of some R type (INTSXP, ...) given the maximum
number of elements it will hold. Then, I reset with SETLENGTH when needed. The
constructor prote
Kevin,
Kevin,
On Apr 10, 2014, at 4:57 PM, Kevin Ushey wrote:
> Suppose I generate an integer vector with e.g.
>
>SEXP iv = PROTECT(allocVector(INTSXP, 100));
>
> and later want to shrink the object, e.g.
>
>shrink(iv, 50);
>
> would simply re-set the length to 50, and allow R to rec
Suppose I generate an integer vector with e.g.
SEXP iv = PROTECT(allocVector(INTSXP, 100));
and later want to shrink the object, e.g.
shrink(iv, 50);
would simply re-set the length to 50, and allow R to reclaim the
memory that was previously used.
Is it possible to do this while respec