[R] Error: value of 'SET_CXTAIL' must be a char or NULL, not a 'char'

Duncan Murdoch murdoch at stats.uwo.ca
Sat Apr 19 20:05:31 CEST 2008

On 19/04/2008 1:18 PM, Søren Højsgaard wrote:
> Dear List 
> On windows XP using R.2.6.2 I get the message 
> Error: value of 'SET_CXTAIL' must be a char or NULL, not a 'char'
> in connection with calling C code (using the .Call interface). I have been unable to find any info on this (in Writing R extensions). Can anyone help me with understanding this error? (In case it helps in tracking the problem: I pass two matrices and a list of several matrices to my C function).

The code that produces that error message is in memory.c:

     if(TYPEOF(v) != CHARSXP && TYPEOF(v) != NILSXP)
	error("value of 'SET_CXTAIL' must be a char or NULL, not a '%s'",
     /*CHECK_OLD_TO_NEW(x, v); *//* not needed since not properly traced */
     ATTRIB(x) = v;
     return x;

so it looks as though the error message is a little buggy (it should 
print TYPEOF(v), not TYPEOF(x), or maybe it should test x, not v.)   But 
I don't really know what it's doing.  Are you using a STRSXP somewhere 
that is expecting a CHARSXP?

Duncan Murdoch

More information about the R-help mailing list