Closed gvegayon closed 1 month ago
OK, @kaitejohnson, this is ready for review. To avoid getting stuck, I suggest adding more S3 methods later (e.g., plot
, vcov
, confint
, etc.).
Add get_draws_df() (new generic with S3 method: default and wwinference_fit)
if going to do this why not write a method for posterior
@gvegayon Reminder to add to NEWS.md
with a description of this change! I keep forgetting to do that/keep the date updated.
@gvegayon A few suggested changes and some questions. Overall looking really good and excited to have this working! I think I am just trying to wrap my head around what the use case of the
.default
is
Here is a reprex illustrating the use of S3 methods with default:
myfun <- function(x) UseMethod("myfun")
myfun.data.frame <- function(x) {
message("data.frame")
}
myfun.default <- function(x) {
message("default")
}
myfun.integer <- function(x) {
message("integer")
}
myfun(USArrests)
#> data.frame
myfun(1L)
#> integer
myfun("G")
#> default
Created on 2024-08-28 with reprex v2.1.0
This PR does the following:
get_draws_df()
(new generic with S3 method: default andwwinference_fit
)get_model_diagnostic_flags()
(new generic with S3 methods: default andwwinference_fit
)wwinferece()
and wraps it as an object of classwwinference_fit
.print.wwinference_fit()
(S3 method): Prints some information about the model.summary.wwinference_fit()
(S3 method): Calls the S6 summary method from the CmdStanModel.