October 2017
Beginner to intermediate
236 pages
7h 38m
English
In R, whenever you write a function, by default the return object gets an S3 class but if you want to return an object that has S4 class, then you should explicitly define the class within the body of the function. In the previous recipes, you saw that the class has been defined outside of the function body. In this recipe, you will write a function that will return an object of the S4 class.