Skip to content

Commit

Permalink
Added custom parameters(<dist_wrap>) method to drop fn env
Browse files Browse the repository at this point in the history
  • Loading branch information
mitchelloharawild committed Nov 5, 2021
1 parent 01d96c8 commit eb5a6d3
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
1 change: 1 addition & 0 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -325,6 +325,7 @@ S3method(mean,distribution)
S3method(median,dist_default)
S3method(median,distribution)
S3method(parameters,dist_default)
S3method(parameters,dist_wrap)
S3method(parameters,distribution)
S3method(print,dist_bernoulli)
S3method(print,dist_beta)
Expand Down
6 changes: 6 additions & 0 deletions R/dist_wrap.R
Original file line number Diff line number Diff line change
Expand Up @@ -112,3 +112,9 @@ generate.dist_wrap <- function(x, times, ...){

do.call(fn, c(list(times), par))
}

#' @export
parameters.dist_wrap <- function(x, ...) {
# All parameters except distribution environment
x[-2]
}

0 comments on commit eb5a6d3

Please sign in to comment.