Skip to content
Prev 293214 / 398502 Next

Data frame vs matrix quirk: Hinky error message?

Many thanks, Ista:

I only looked in "].default" so the answer is: Alternative 4: dumb
Bert. Rap knuckles with ruler.

Actually, indexing by a logical matrix doesn't make much  sense to me
in either case, as it does not have the effect of selecting individual
elements, which is what numeric matrix indices do. But that's a matter
of usage, neither bug nor feature.

If I had gotten something like the error message: "Matrix indices not
allowed for replacement in data frames," I would not have been
surprised. But as you said, the behavior **IS** documented.

Best,
Bert
On Tue, May 1, 2012 at 10:49 AM, Ista Zahn <istazahn at gmail.com> wrote: