Bloqued Methods

Hi everyone, I am building a new version of my package, and use the rstantools package as always! I construct my package but when I call the built S3 methods, R doesn’t recognize them!

And In the last version, I didn’t have this problem.

Do you have a link to a GitHub repo and / or an example of code that isn’t working?

Sorry I have an exam yesterday and couldnt keep working on the project.

This is my github: link to the package:

You can try install the package, but well I havent try from github becasue my S3 methods are not available.

If you go to vignettes and enter to the " Intro-to-varstan.Rmd" the S3 method model report is not recognize and I dont know why?! On the previous version of rstantools those S3 methods run.

Extra info: the methods are defined in the Misc carpet. And I use brms git as a code reference guide.

I haven’t tried running your code, but if I understand correctly, your report.varma method is not called when you run report(obj) where obj is of class varma. Would it work if you added an “@export report” to your existing roxygen, so that it would look like:

#' @method report varma
#' @export report
#' @export
#'
report.varma = function(dat){
<...>
1 Like

And does it work for a predefined method such as summary?

Yes, if you want to extend the standard summary, just an @export should do. But if you want to extend rstan’s summary function, you should import the generic function, such as in:

#' @importMethodsFrom rstan summary
#' @method summary varma
#' @export

Thank you @mcol , I could solve my problem with this