[Rd] Help page on '$': 'warnPartialMatchAttr' should be 'warnPartialMatchDollar'

Suharto Anggono Suharto Anggono suharto_anggono at yahoo.com
Fri Nov 16 08:48:12 CET 2012


http://stackoverflow.com/questions/6065724/assigning-value-to-a-variable-that-has-a-dot-in-the-name made me realize this.


The context is 'a' is assigned to ret$log.id, but then ret$log returns "a" and ret$l also returns "a".
There is a comment from Charles on the question:
"Also see options(warnPartialMatchDollar=T) if you want to track these."


But, in bottom part, there is Chase's answer, quoting help page for $.

... under Character indices:
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(warnPartialMatchAttr = TRUE).


This is what I get from R documentation of 'options'.

     ‘warnPartialMatchAttr’: logical.  If true, warns if partial
          matching is used in extracting attributes via ‘attr’.

     ‘warnPartialMatchDollar’: logical.  If true, warns if partial
          matching is used for extraction by ‘$’.


So, in the part of help page on '$' quoted in part of Chase's answer above,
options(warnPartialMatchAttr = TRUE)
should be
options(warnPartialMatchDollar = TRUE)


This is in R 2.15.2.



More information about the R-devel mailing list