Skip to content
Prev 140450 / 398503 Next

Rule for accessing attributes?

Oh please don't recommend misuse of @ to those already confused.

@ is for accessing slots in S4 objects.  This 'works' because they happen 
to be stored as attributes.  See the help page (and the warning that it 
does no checking - we may change that).

Similarly,

plt$title <- "My Title"

works because the package maintainer (of ggplot2, unmentioned?) has chosen 
to set things up that way.  R is very flexible, and there is plenty of 
scope for package authors to do confusing things.
On Thu, 27 Mar 2008, Christos Hatzis wrote: