Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

error thrown when no methods exist #18

Closed
alexey0308 opened this issue Jan 9, 2019 · 0 comments
Closed

error thrown when no methods exist #18

alexey0308 opened this issue Jan 9, 2019 · 0 comments

Comments

@alexey0308
Copy link

@alexey0308 alexey0308 commented Jan 9, 2019

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...

@hadley hadley closed this in 098eff8 Feb 17, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
1 participant