Skip to content
Prev 278078 / 398506 Next

Weird R's behaviour with a quoted name

This is a bug in R: it either should prohibit the
attaching of attributes to things of class "name"
or should make it so that attachment of an attribute
doesn't have such a global effect.

A more direct example of the problem is:
  > attributes(quote(some.name))
  NULL
  > bar <- structure(quote(some.name), someAttribute="someAttribute's value")
  > attributes(quote(some.name))
  $someAttribute
  [1] "someAttribute's value"

I reported a similar problem to R-devel in March of
2010 under the subject line "symbol name caching bug:
attributes get tied to symbol names".  The consensus
then seemed to be that prohibiting attributes on things
of class "name" was the way to go.

Bill Dunlap
Spotfire, TIBCO Software
wdunlap tibco.com