October 2017
Beginner to intermediate
236 pages
7h 38m
English
The S4 object class has a generic function equivalent to the print() generic function for the S3 class of objects. The function "show" is a generic function that works similarly to the print() function in the S3 system. You will write a method for the "show" function for the "robustSummary" S4 class as follows:
setMethod("show", "robustSummary", function(object) { cat("The median is ",object@median, " with median absolute deviation (MAD) = ", object@mad, "\n") cat("First and Third Quartile is", object@q1, "and", object@q3) } )