October 2017
Beginner to intermediate
236 pages
7h 38m
English
The first phase of defining a generic function is defining a function and mentioning the use method for that function. The function robSum() has use method robSum; in other words, using this name, you have to call this generic function.
Every generic function usually has a default method where the default task has been defined. In this example, the default method is just printing a line of text This is a generic function for the object class robustSummary. Whenever the default method of this robSum() generic function call or the input object's class is not robustSummary, it will print this default line.
The final step is to define the method for the targeted class. In this example, the class name is robustSummary. The method ...