[R] Partial matching with $ extractor.

Rolf Turner r@turner @end|ng |rom @uck|@nd@@c@nz
Wed Jan 25 00:06:47 CET 2023


On Tue, 24 Jan 2023 17:16:44 -0500
Andrew Simmons <akwsimmo using gmail.com> wrote:

> I tried this again with R 2.15.3, the oldest version I have installed,
> and I still got the same behaviour. It extracts the first exact match,
> then the only partial match, then NULL.

Thanks for that.

I am *sure* that I had problems with lists (say "xxx") that had entries
"ylengths" and (later) "y".  I got into trouble when I did xxx$y.  This
produced the value of xxx[["ylengths"]], not of xxx[["y"]], which of
course caused chaos.

Now xxx$y produces xxx[["y"]] as desired.

But you say that nothing has changed!

The only explanation that I can think of is that the Universe
(including its past) has changed, while I wasn't looking.  That
seems to keep happening to me! :-)  (Cf. "The Lathe of Heaven" by
Ursula le Guin.)

cheers,

Rolf

-- 
Honorary Research Fellow
Department of Statistics
University of Auckland
Phone: +64-9-373-7599 ext. 88276



More information about the R-help mailing list