Codes and examples from the book R Object Oriented Programming