as not common to S3, but note that you have TRUE. (I got FALSE.) This means that you downloaded a package that defines as as S4-generic. S3-generics work through the class manager, which uses the *.default function and the UseMethod function. The FALSE that I get means that for the universal as method, no method will be found that will search. One argument in favor of the lack of a common as is that calling such a function with only one data object will not indicate a “coercive purpose”. This means that the assignment must be embedded in the function name.
After declaring as be common (note the header line, which is a hint that this applies to S4 functions:
setGeneric("as") # note that I didn't really even need to define any methods get('as') #--- output---- standardGeneric for "as" defined from package "methods" function (object, Class, strict = TRUE, ext = possibleExtends(thisClass, Class)) standardGeneric("as") <environment: 0x7fb1ba501740> Methods may be defined for arguments: object, Class, strict, ext Use showMethods("as") for currently available ones.
If I reload R (and do not load libraries that call setGeneric for "as"), I get:
get('as') #--- output --- function (object, Class, strict = TRUE, ext = possibleExtends(thisClass, Class)) { if (.identC(Class, "double")) Class <- "numeric" thisClass <- .class1(object) if (.identC(thisClass, Class) || .identC(Class, "ANY")) return(object) where <- .classEnv(thisClass, mustFind = FALSE) coerceFun <- getGeneric("coerce", where = where) coerceMethods <- .getMethodsTable(coerceFun, environment(coerceFun), inherited = TRUE) asMethod <- .quickCoerceSelect(thisClass, Class, coerceFun, coerceMethods, where) .... trimmed the rest of the code
But you ask “why,” which is always a dangerous question when discussing language design, of course. I looked at the last chapter of statistical models in S, which is a cited link for most of the help pages related to sending S3, and finds no discussion of either coercion or the as function. There is an implicit definition of “S3 generic” requiring the use of UseMethod , but a mention of why as was excluded from this strategy. I think of two possibilities: to prevent any ambiguity of inheritance in the application of coercion, or it is a solution to effectiveness.
I probably should add that there is an S4 setAs function, and you can find all the S4-coercion functions with showMethods("coerce") .