Returns information about all methods belong to a generic or a class. In S3 and S4, methods belong to a generic, but it is often useful to see what generics have been provided methods for a given class. These are wrappers around utils::methods(), which returns a lot of useful information in an attribute.

s3_methods_class(x)

s3_methods_generic(x)

s4_methods_class(x)

s4_methods_generic(x)

Arguments

x

Name of class or generic

Value

A tibble with columns generic, visible, class, visible, and source.

Examples

s3_methods_class("Date")
#> # A tibble: 37 x 4 #> generic class visible source #> <chr> <chr> <lgl> <chr> #> 1 - Date TRUE base #> 2 [ Date TRUE base #> 3 [[ Date TRUE base #> 4 [<- Date TRUE base #> 5 + Date TRUE base #> 6 as.character Date TRUE base #> 7 as.data.frame Date TRUE base #> 8 as.list Date TRUE base #> 9 as.POSIXct Date TRUE base #> 10 as.POSIXlt Date TRUE base #> # … with 27 more rows
s3_methods_generic("anova")
#> # A tibble: 11 x 4 #> generic class visible source #> <chr> <chr> <lgl> <chr> #> 1 anova glm FALSE registered S3method #> 2 anova glmlist FALSE registered S3method #> 3 anova glmmPQL FALSE registered S3method #> 4 anova lm FALSE registered S3method #> 5 anova lmlist FALSE registered S3method #> 6 anova loess FALSE registered S3method #> 7 anova loglm FALSE registered S3method #> 8 anova mlm FALSE registered S3method #> 9 anova negbin FALSE registered S3method #> 10 anova nls FALSE registered S3method #> 11 anova polr FALSE registered S3method
s4_methods_class("Date")
#> # A tibble: 4 x 4 #> generic class visible source #> <chr> <chr> <lgl> <chr> #> 1 coerce Date TRUE "" #> 2 initialize Date TRUE "" #> 3 show Date TRUE "" #> 4 slotsFromS3 Date TRUE ""
s4_methods_generic("anova")
#> # A tibble: 0 x 4 #> # … with 4 variables: generic <chr>, class <chr>, visible <lgl>, source <chr>