I have an S3 class, and I'm trying to work out how to set up a print function for it.
This part's good.
print.webglobe <- function(wg, ...){
"it worked!"
}
But, if I run devtools::check()
on it, I get the following ominous message:
checking S3 generic/method consistency ... WARNING
print:
function(x, ...)
print.webglobe:
function(wg, ...)
I tried adding the additional code:
print <- function(wg, ...){
UseMethod("webglobe", wg)
}
But, with this present, print.webglobe()
never seems to be accessed and my S3 class just prints as a list of some sort.
How can I set up this up correctly?