I'm trying to understand the "..." function within function calls, now I have a function say function(x,...)
, I though any variables passed to it after x
(the ...
) would be used within the function or passed to it's subfunctions?
For e.g my code below. I would expect an output of "fac_ed", "single", class(x) but only class(x) gets outputted, what is wrong?
Code
set.Class <- function (x, ...) tryCatch( { class(x) <- c(..., "class(x)") },
error = function(ex) {
class(x) <- c(..., "query", "data.frame")
} )
set.Class(SMA.grouped,"fac_ed", "single")