Efficiently adding or removing elements to a vector or list in R?

Posted by Ryan Thompson on Stack Overflow See other posts from Stack Overflow or by Ryan Thompson
Published on 2010-05-06T04:43:57Z Indexed on 2010/05/06 4:48 UTC
Read the original article Hit count: 175

Filed under:
|
|

I'm implementing an algorithm that involves lots of adding and removing things from sets. In R, this is slow because as far as I know, adding or removing things from a vector is slow, since the entire vector has to be re-allocated. Is there a way do do it more efficiently?

© Stack Overflow or respective owner

Related posts about r

    Related posts about vector