When building summary functions, it's common practise to collect all the information you need, create an object with it, give it a new class (likely something like summary.yourclass), and then return the object. In the end, you would have to create a brand-new function that performs print.summary.yourclass. You would presumably call cat or some comparable programme inside of that print function.