I am currently reading Chapter 9 in <a href="http://amzn.com/0387759352" rel="nofollow">Chambers' <em>Software for Data Analysis</em></a>, and on page 337, he says:<blockquote>
In contrast, there are some inherent restrictions on the classe in the
contains= argument. Classes supplied here must be either:
"symbol"(the object type for class
where the emphasis is mine.
My naive question is, why is the name of the object type (
symbol) different from the class name (
name)? This clashes with my understanding of an object as an instance of a class. Are there any other such examples, and how should I think about the naming convention here?
I see that as preventing you from constructing or requiring another level of indirection. The interpreter can assumed to be able to handle predefined object types in the 'contains' specification but not to be able to handle types that are more flexible or would require looking up what was in the value that was passed to it. A "symbol" is a way of finding something rather than the "something" itself.
R has both "storage modes" and "types" in addition to "modes" and "classes":
> x=as.name('y') > x y > mode(x)  "name" > class(x)  "name" > typeof(x)  "symbol" > storage.mode(x)  "symbol"