Skip to content
Prev 384079 / 398502 Next

Partial matching list elements in R 4.0

I can't answer your question (about your R programming skills) but the
behavior you complain about is as documented. In particular:

"Thus the default behaviour is to use partial matching only when extracting
from recursive objects (except environments) by $. Even in that case,
warnings can be switched on by options
<http://127.0.0.1:39592/help/library/base/help/options>(warnPartialMatchDollar
= TRUE)."

So the solution is not to use $ for list extraction/replacement. Though
convenient, it is prone to such issues. Instead, the following works (as
does your suggested solution, of course):
$options
$options$misc
$options$misc$abc
[1] "123"


$options$mi
$options$mi$something
[1] 13

Bert Gunter

"The trouble with having an open mind is that people keep coming along and
sticking things into it."
-- Opus (aka Berkeley Breathed in his "Bloom County" comic strip )


On Tue, May 26, 2020 at 10:45 AM John Harrold <john.m.harrold at gmail.com>
wrote: