>>>>> Kirill Müller <kirill.muel...@ivt.baug.ethz.ch> >>>>> on Thu, 28 Jan 2016 17:42:12 +0100 writes:
> On 28.01.2016 14:20, Duncan Murdoch wrote: >> If the class is just "mytable", then you'll have to >> change it to "ftable" before calling stats::format(). > Side note: The following will fail, because format.ftable > double-checks the class of its argument: > format_ftable <- utils::getS3method("format", "ftable") > format_ftable(mytable) > -Kirill Well, I don't think it would fail as that does if (!inherits(x, "ftable")) stop("'x' must be an \"ftable\" object") and the OP did mention that his objects were flat tables. Note that the above is *good style* as opposed to the "bad" code I've seen so often in packages (and otherwise) which would use something like if(class(x) == "ftable") ## really really bad because that code will work incorrectly for objects with S3 class attribute, say c("myFtable", "ftable") Martin ______________________________________________ R-package-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-package-devel