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

Example doesn't work - no applicable method for 'explain' applied to an object of class "htest" #12

Open
SchmidtPaul opened this issue Aug 4, 2020 · 2 comments

Comments

@SchmidtPaul
Copy link

SchmidtPaul commented Aug 4, 2020

I just tried to run the example

devtools::install_github("hilaryparker/explainr")
library(explainr)
ptest <- prop.test(x = 500, n = 1008)
explain(ptest)

and got the following message

no applicable method for 'explain' applied to an object of class "htest"

Am I missing something here or did maybe the class of objects from prop.test() change recently?

@davidmeza1
Copy link

I ran it with stats package 3.6.2 and it worked. Then again with version 4.0.0 and I got the same error.
When I run class(ptest) in both environments they bot return "htest"

@christian-million
Copy link

I think it has something to do with missing @export tags / NAMESPACE? Even though sloop::s3_dispatch(ptest) does show that it's dispatching on the explain.default method.

I don't know enough about the magic to understand why, but I got it to work by:

  • downloading the source
  • deleting NAMESPACE
  • adding @export to explain.default documentation
  • devtools::document()
  • devtools::load_all()

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants