Skip to content
Prev 327145 / 398502 Next

S4 method signature - integer matrix

On Jul 19, 2013, at 9:54 AM, Simon Zehnder wrote:

            
I don't think that is the only way. You could also test for mode being 'numeric' at the signature level and then within the validation check to see whether it has dimensions. See ?is.numeric and ?validObject

There is also the option of using a prototype.

As I understand the S4 checks they will apply an is.<mode> or is.<class> test as long as there is an correspond function that returns a logical. see ... ?is
It would need be both integer mode...   ?is.integer and have dimensions...  ?dim
Just add a test in the 'validity' code. See ... ?setClass
I don't see a reason to use apply.