From tlumley at u.washington.edu  Fri Sep  8 18:20:23 2006
From: tlumley at u.washington.edu (Thomas Lumley)
Date: Fri, 8 Sep 2006 09:20:23 -0700 (PDT)
Subject: [Rd] (PR#9202) Re: Bugs with partial name matching
In-Reply-To: <69C0202D-ED5A-495A-9F38-FD2F7F132C29@uic.edu>
References: <20060905014002.634C928F8E@slim.kubism.ku.dk>
	<Pine.LNX.4.64.0609051507530.17674@homer23.u.washington.edu>
	<Pine.LNX.4.64.0609051542310.17674@homer23.u.washington.edu>
	<69C0202D-ED5A-495A-9F38-FD2F7F132C29@uic.edu>
Message-ID: <Pine.LNX.4.64.0609080916200.24159@homer23.u.washington.edu>

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 at u.washington.edu	University of Washington, Seattle




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