Skip to content

error thrown when no methods exist #18

@alexey0308

Description

@alexey0308

If there are no existing methods, s4_methods_class, as a wrapper of utils::methods,
is not expected to throw an error:

setClass("virtualA", contains = "VIRTUAL")
s4_methods_class("virtualA")
#> Error in `$<-.data.frame`(`*tmp*`, class, value = "virtualA") : 
# replacement has 1 row, data has 0

However,

attr(utils::methods(class = "virtualA"), "info")
#> [1] visible from    generic isS4   
# <0 rows> (or 0-length row.names)

Maybe sloop:::methods_class can do a check for row number or other way to avoid the error...

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions