I\'m trying to write a function to do a particular job (in my case, analyse a data set for outliers) so the first things I want to do is look at how other people have done s
For example, plot() will do different things depending on the object. You can see the specific plot functions (called methods) using plot.ts(), plot.lm(), etc. i.e., plot() will call plot.ts() if a ts object is passed. In general, plot.xxx() is applied to objects of class xxx. If there is no specific method for the class, then plot.default() is used.
The function plot() is called a generic function because it can apply to many different classes. Other common generic functions are summary(), print() and predict().
As Dirk says, it is well worth reading the documentation on S3 methods and classes.