From b50f7fde62ad25a1fa3a4998ac87c1c7f246afd5 Mon Sep 17 00:00:00 2001 From: mitchelloharawild Date: Tue, 17 Sep 2024 00:13:16 +1000 Subject: [PATCH] Fix gk package usage --- DESCRIPTION | 6 +++--- R/dist_gh.R | 12 ++++++------ man/dist_gh.Rd | 2 +- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/DESCRIPTION b/DESCRIPTION index 7fdaea57..c6d2e176 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -43,8 +43,7 @@ Imports: numDeriv, utils, lifecycle, - pillar, - gk + pillar Suggests: testthat (>= 2.1.0), covr, @@ -52,7 +51,8 @@ Suggests: actuar (>= 2.0.0), evd, ggdist, - ggplot2 + ggplot2, + gk RdMacros: lifecycle URL: https://pkg.mitchelloharawild.com/distributional/, https://github.com/mitchelloharawild/distributional diff --git a/R/dist_gh.R b/R/dist_gh.R index 6dbf44be..a6b5f1dc 100644 --- a/R/dist_gh.R +++ b/R/dist_gh.R @@ -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) @@ -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"]]) } diff --git a/man/dist_gh.Rd b/man/dist_gh.Rd index f45081ee..225e8988 100644 --- a/man/dist_gh.Rd +++ b/man/dist_gh.Rd @@ -59,7 +59,7 @@ of a closed-form expression. dist <- dist_gh(A = 0, B = 1, g = 0, h = 0.5) dist -\dontshow{if (requireNamespace("gh", quietly = TRUE)) (if (getRversion() >= "3.4") withAutoprint else force)(\{ # examplesIf} +\dontshow{if (requireNamespace("gk", quietly = TRUE)) (if (getRversion() >= "3.4") withAutoprint else force)(\{ # examplesIf} mean(dist) variance(dist) support(dist)