Re: [Rd] (PR#9202) Re: Bugs with partial name matching

From: Thomas Lumley <tlumley_at_u.washington.edu>
Date: Fri 08 Sep 2006 - 16:20:23 GMT

On Tue, 5 Sep 2006, Anil Maliyekkel wrote:

> This problem does not appear when the following is done
>
> > D = list(ABCD=2:1)
> > D$ABC[]=c(3,4)
> > D
> $ABCD
> [1] 2 1
>
> $ABC
> [1] 3 4
>
<other examples snipped>
>
> It appears to be a sequence specific bug for the $ operator, which
> might explain why it did not occur with my original examples where I
> had a character data column, but did appear where I had a numeric
> data column that was a sequence.

Appearances can be deceptive. The point is that 2:1 and 3:4 are integer vectors but c(3,4) is a double precision vector. Assigning values of a different type into a vector requires copying and so masks the bug.

> Going back to the original partial replacement problem, is there
> anyway to turn off partial matching, or to selectively apply exact
> matching when trying to access a single element?

No.

> I can get the
> desired single element match using the convoluted syntax D["ABC"]
> [[1]] and perform partial replacement operations on a new column.
> However, it would be nice to have single element access operator that
> does exact matching.

It wouldn't fix the bug, and we are running low on symbols that could be used.

         -thomas

Thomas Lumley			Assoc. Professor, Biostatistics
tlumley@u.washington.edu	University of Washington, Seattle

______________________________________________
R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel Received on Sat Sep 09 03:39:34 2006

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.1.8, at Fri 08 Sep 2006 - 20:30:08 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-devel. Please read the posting guide before posting to the list.