Skip to content

Commit

Permalink
Add missing 'quantreg' to Suggests (#43)
Browse files Browse the repository at this point in the history
  • Loading branch information
MichaelChirico authored Mar 14, 2023
1 parent 8fa6572 commit 7e303d7
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
1 change: 1 addition & 0 deletions DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ Imports:
Suggests:
covr,
Hmisc,
quantreg,
testthat,
vdiffr (>= 1.0.4)
URL: https://github.com/lionel-/ggstance
Expand Down
3 changes: 3 additions & 0 deletions R/stat-boxploth.R
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,9 @@ StatBoxploth <- ggproto("StatBoxploth", Stat,
qs <- c(0, 0.25, 0.5, 0.75, 1)

if (!is.null(data$weight)) {
if (!requireNamespace("quantreg", quietly = TRUE)) {
stop("'quantreg' is required for compute_group() with weights")
}
mod <- quantreg::rq(x ~ 1, weights = weight, data = data, tau = qs)
stats <- as.numeric(stats::coef(mod))
} else {
Expand Down

0 comments on commit 7e303d7

Please sign in to comment.