Skip to content
Prev 17378 / 63421 Next

Question about SET_LENGTH

SET_LENGTH is in Rdefines.h (you did not say).  It is a wrapper for

 	x = lengthgets(x, n)

and that will do what you want.  HOWEVER, you have changed x and the 
object it points to, so you do need to worry about re-protection.
So, I think that macro is rather dangerous (and it is not the only danger 
lurking in Rdefines.h, which provides no valid way to assign elements of 
character strings or lists any more).

Look and see how lengthgets is used in the R sources.
On Mon, 29 Aug 2005, James Bullard wrote: