Trying to understand why rownames = FALSE is not passed on from Test to Test.list?
Test = function( object , rownames = FALSE , ... )
{
UseMethod( "Test" )
}
Test.list = function( object , rownames , ... )
{
browser()
# rownames is missing!
}
Test( list() )
Only actual arguments are passed on to the method. Each S3 method can have their own different default values (which would be a very bad design though).
You should strive to have the same parameters with the same defaults as the generic function, and then possibly some extra parameters at the end.
# Bad design, but possible to have defaults be different...
Test.list = function( object , rownames = TRUE , ... )
{
browser()
# rownames is TRUE!
}
Test( list() )
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With