Skip to content

Commit

Permalink
Fix gk package usage
Browse files Browse the repository at this point in the history
  • Loading branch information
mitchelloharawild committed Sep 16, 2024
1 parent 626200f commit b50f7fd
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 10 deletions.
6 changes: 3 additions & 3 deletions DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -43,16 +43,16 @@ Imports:
numDeriv,
utils,
lifecycle,
pillar,
gk
pillar
Suggests:
testthat (>= 2.1.0),
covr,
mvtnorm,
actuar (>= 2.0.0),
evd,
ggdist,
ggplot2
ggplot2,
gk
RdMacros:
lifecycle
URL: https://pkg.mitchelloharawild.com/distributional/, https://github.com/mitchelloharawild/distributional
Expand Down
12 changes: 6 additions & 6 deletions R/dist_gh.R
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
#' dist <- dist_gh(A = 0, B = 1, g = 0, h = 0.5)
#' dist
#'
#' @examplesIf requireNamespace("gh", quietly = TRUE)
#' @examplesIf requireNamespace("gk", quietly = TRUE)
#' mean(dist)
#' variance(dist)
#' support(dist)
Expand Down Expand Up @@ -88,30 +88,30 @@ format.dist_gh <- function(x, digits = 2, ...){

#' @export
density.dist_gh <- function(x, at, ...){
require_package("gh")
require_package("gk")
gk::dgh(at, x[["A"]], x[["B"]], x[["g"]], x[["h"]], x[["c"]])
}

#' @export
log_density.dist_gh <- function(x, at, ...){
require_package("gh")
require_package("gk")
gk::dgh(at, x[["A"]], x[["B"]], x[["g"]], x[["h"]], x[["c"]], log = TRUE)
}

#' @export
quantile.dist_gh <- function(x, p, ...){
require_package("gh")
require_package("gk")
gk::qgh(p, x[["A"]], x[["B"]], x[["g"]], x[["h"]], x[["c"]])
}

#' @export
cdf.dist_gh <- function(x, q, ...){
require_package("gh")
require_package("gk")
gk::pgh(q, x[["A"]], x[["B"]], x[["g"]], x[["h"]], x[["c"]])
}

#' @export
generate.dist_gh <- function(x, times, ...){
require_package("gh")
require_package("gk")
gk::rgh(times, x[["A"]], x[["B"]], x[["g"]], x[["h"]], x[["c"]])
}
2 changes: 1 addition & 1 deletion man/dist_gh.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit b50f7fd

Please sign in to comment.