Skip to content
Prev 48178 / 63424 Next

"Name partially matched in data frame"

Hi,

Would be good to have the man page updated about this. It still
says:

  'x$name' is equivalent to 'x[["name", exact=FALSE]]'

which doesn't seem to be completely true anymore (the former emits
a warning in case of partial matching, not the latter).

It looks like for a data.frame, ?x$name? is now equivalent to
'x[["name", exact=NA]]':

   > data.frame(aa=1:3)$a
   [1] 1 2 3
   Warning message:
   In `$.data.frame`(data.frame(aa = 1:3), a) :
     Name partially matched in data frame

   > data.frame(aa=1:3)[["a", exact=NA]]
   [1] 1 2 3
   Warning message:
   In .subset2(x, i, exact = exact) : partial match of 'a' to 'aa'

except that, instead of just calling 'x[["name", exact=NA]]' internally,
the former comes up with its own (and less informative) error message.

Cheers,
H.

 > sessionInfo()
R version 3.1.0 (2014-04-10)
Platform: x86_64-unknown-linux-gnu (64-bit)

locale:
  [1] LC_CTYPE=en_US.UTF-8       LC_NUMERIC=C
  [3] LC_TIME=en_US.UTF-8        LC_COLLATE=en_US.UTF-8
  [5] LC_MONETARY=en_US.UTF-8    LC_MESSAGES=en_US.UTF-8
  [7] LC_PAPER=en_US.UTF-8       LC_NAME=C
  [9] LC_ADDRESS=C               LC_TELEPHONE=C
[11] LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base
On 04/30/2014 12:32 PM, Duncan Murdoch wrote: