From goodrich at fas.harvard.edu  Fri Dec  7 17:30:14 2007
From: goodrich at fas.harvard.edu (goodrich at fas.harvard.edu)
Date: Fri,  7 Dec 2007 17:30:14 +0100 (CET)
Subject: [Rd] (PR#10500) Bug#454678: followup
Message-ID: <20071207163014.F28722834629@mail.pubhealth.ku.dk>

[I was overlooked on the CC. Hopefully this message does not create a
new bug report.]

> Prof Brian Ripley wrote:
> I would say this was user error (insisting on editing non-existent
> rownames), although the argument is documented.  You could argue that
> there are implicit rownames, but they would be 1, 2 ... not row1, row2
> ....  And rownames(mat) is NULL.
>
> For an interactive function the best solution seems to be to throw an
> error when the user asks for the impossible.
>
> I'll fix it for 2.7.0: it certainly isn't 'important' as it has gone
> undiscovered for many years, and edit.matrix is itself little used.
>
>
> BTW, 1:dim(names)[1] is dangerous: it could be 1:0.  That was the
> motivation for seq_len.

I would agree that it is a rare user error, but my original mistake was
a little more benign than the one that is depicted in the bug report. I
just forgot to call rownames()<- before calling edit(); that could have
happened to anyone. Perhaps one reason why this issue has not been
reported before is that in 2.5.1 at least, it produces an error message
rather than crashing (which I noted in the original bug report to Debian
but that was a little hard to see by the time it got forwarded to
R-bugs). In some ways, I think throwing an error in 2.7.0 would be
better than the behavior of edit.data.frame() in this case, which is to
add row names of 1, 2, ... . -- Thanks, Ben



[Rd] (PR#10500) Bug#454678: followup
goodrich at fas.harvard.edu