[Rd] In C, a fast way to slice a vector?

Saptarshi Guha saptarshi.guha at gmail.com
Sun May 10 17:49:24 CEST 2009

Suppose in the following code,
PROTECT(sr = R_tryEval( .... ))

sr is a RAWSXP vector. I wish to return another RAWSXP starting at
position 13 onwards (base=0).

I could create another RAWSXP of the correct length and then memcpy
the required bytes and length to this new one.

However is there a more efficient method?

Saptarshi Guha

More information about the R-devel mailing list