Skip to content
Prev 18825 / 63461 Next

random output with sub(fixed = TRUE)

On Wed, 21 Dec 2005, Roger D. Peng wrote:

            
identical is wrong!  R character strings have a true length and a C-style
length: print() prints the all the characters, even those after embedded 
nuls.  identical uses

 	    if(strcmp(CHAR(STRING_ELT(x, i)),
 		      CHAR(STRING_ELT(y, i))) != 0)

which is C-style.

The issue is character.c:1015 whose nr gets trashed: note the first answer 
in the vector is correct.  So easy to fix.

This code has been as currently for years, so I don't think this is at all 
related to the release of 2.2.1.