Summary
We introduced the idea of an S4
class and provided several examples. The S4
class is constructed in at least two stages. The first stage is to define the name of the class and the associated data components. The methods associated with the class are then defined in a separate step.
In addition to defining a class and its method, the idea of inheritance was explored. A partial example was given in this chapter; it built on a base class defined in the first section of the chapter. Additionally, the method to call-associated methods in parent classes was also explored, and the example made use of the constructor (or initialize method) to demonstrate how to build a chain of constructors.
Finally, four useful commands were explained. The four commands offered different ways to get information about a class or about an object of a given class.
For more information, you can refer to Mobile Cellular Automata Models of Ant Behavior: Movement Activity of Leptothorax allardycei, Blaine J. Cole...