[Rd] Dynamic list creation (SEXP in C) returns error "unimplemented type (29) in 'duplicate'" Dynamic list creation (SEXP in C) returns error

Radford Neal radford at cs.toronto.edu
Wed Nov 6 19:15:25 CET 2013


On Wed, Nov 06, 2013 at 02:40:59PM -0300, George Vega Yon wrote:
> Hi! You are right, what I actually use is SET_LENGTH... Is that ok?
> El 06/11/2013 14:00, "Radford Neal" <radford at cs.toronto.edu> escribi?:

Is SET_LENGTH a documented feature of the API?  Not that I can see.

However, it is indeed different from SETLENGTH.  Perhaps your problem
is in the following code you posted:

  REPROTECT(SET_LENGTH(id,    length(lambda) + z), ipx0);
  REPROTECT(SET_LENGTH(lambda,length(lambda) + z), ipx1);

It looks like the first line should have length(id), not length(lambda).

Your usage of REPROTECT and duplicate seems odd.  If you make the
stuff you allocate part of your original list as soon as you allocate
it, you only need to protect the original list.  And it's not clear
why you think you need to duplicate vectors.

   Radford Neal



More information about the R-devel mailing list