Re: [Rd] common base functions stripping S3 class

2014-11-18 Thread Duncan Murdoch
On 17/11/2014, 4:23 PM, Murat Tasan wrote: > Yeah, my biggest stumbling-point while starting to write S3 classes > was the some-default-methods-preserve class, and > some-default-methods-don't-preserve class dichotomy. > But I'm not sure it's so "easy" to figure this out without more > documentatio

Re: [Rd] common base functions stripping S3 class

2014-11-17 Thread Duncan Murdoch
On 17/11/2014 10:41 AM, Hadley Wickham wrote: > Generally the idea is that the class should be stripped because R has no > way of knowing if the new object, for example unique(obj), still has the > necessary properties to be considered to be of the same class as obj. > Only the author of the clas

Re: [Rd] common base functions stripping S3 class

2014-11-17 Thread Hadley Wickham
> Generally the idea is that the class should be stripped because R has no > way of knowing if the new object, for example unique(obj), still has the > necessary properties to be considered to be of the same class as obj. > Only the author of the class knows that. S4 would help a bit here, but > o

Re: [Rd] common base functions stripping S3 class

2014-11-16 Thread Duncan Murdoch
On 16/11/2014, 7:58 PM, Murat Tasan wrote: > Hi all --- this is less a specific question and more general regarding > S3 classes. > I've noticed that quite a few very common default implementations of > generic functions (e.g. `unique`, `[`, `as.data.frame`) strip away > class information. > In som

[Rd] common base functions stripping S3 class

2014-11-16 Thread Murat Tasan
Hi all --- this is less a specific question and more general regarding S3 classes. I've noticed that quite a few very common default implementations of generic functions (e.g. `unique`, `[`, `as.data.frame`) strip away class information. In some cases, it appears conditionals have been created to r