Skip to content
Prev 14361 / 63424 Next

UseMethod call with no arguments - solved, I think

Hmmm, to follow up on my own question; it is likely that I have
misunderstood the update note. Now, I read it as

foo <- function(x, ...) UseMethod()

is deprecated and that

foo <- function(x, ...) UseMethod("foo", x)

( or foo <- function(x, ...) UseMethod("foo") )

should be used.

My concern/interpretation was that

bar <- function(...) UseMethod("bar")

is deprecated (where I saw "..." as the "arguments"). Reading ?UseMethod
more carefully (it still says) - "If it is called with just one argument,
the class of the first argument of the enclosing function is used as
'object': unlike S this is the actual argument passed and not the current
value of the object of that name." - I see that the above should still be
fine.

So, now the note makes perfectly sense and it is *not* a "big step".

Best wishes

Henrik