Coming from a C++ and C# background I would like to know how inheritance works 
with 'R'. The classical example is I can define an abstract class 'Shape' and 
have an array of 'Shape's but each instance could be a Circle, Square, 
Triangle, etc. because they all derive from 'Shape'. At runtime if I wish I can 
tell the type of the 'Shape' using various language specific operators. In 'R' 
it seems that each 'function' in general returns an object that is specific to 
that function. For example 'stl' returns an 'stl' object, 'lm' retuirns an 'lm' 
object, 'kmeans' returns a 'kmens' object etc. If I have an array of these 
objects what can I use to tell the type of object in 'R' and runtime? Any 
examples would be helpful.

Thank you.

Kevin

______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to