In the help file for `substring<-` it states:
"If the portion to be replaced is longer than the replacement string, then only the portion the length of the string is replaced."
However, if we give a zero length replacement, then substring will still remove one letter. For example:
> x <- "qwerty"
> substring(x, 1, 5) <- "a"
> substring(x, 1, 5) <- ""
According to my interpretation of the help file, no letter should have been removed because the replacement string has no characters.
This should probably be clarified in the help file, or the behavior of substring should be changed.
Neither R-patched nor R-devel do this: see the FAQ about not reporting bugs which are already fixed.