Skip to content

Commit c36b242

Browse files
committed
minor docs, testing multiple pivot_longers
1 parent 161feb7 commit c36b242

File tree

3 files changed

+7
-2
lines changed

3 files changed

+7
-2
lines changed

R/quantile_pred-methods.R

+1-1
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ vec_proxy_equal.quantile_pred <- function(x, ...) {
120120
#' Given a [hardhat::quantile_pred] object, users may wish to compute additional
121121
#' `quantile_levels` that are not part of the object. This function attempts
122122
#' to estimate these quantities under some assumptions. Interior probabilities,
123-
#' those contained within, existing probabilities are interpolated in a manner
123+
#' those contained within existing probabilities are interpolated in a manner
124124
#' controled by the `middle` argument. Those outside existing probabilities
125125
#' are extrapolated under the assumption that the tails of the distribution
126126
#' decays exponentially. Optionally, one may constrain _all_ quantiles to be

man/quantile.quantile_pred.Rd

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

tests/testthat/test-pivot_quantiles.R

+5
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,11 @@ test_that("pivotting wider still works if there are duplicates", {
2222
tb <- tibble(.pred = quantile_pred(rbind(1:3, 1:3), c(.1, .5, .9)))
2323
res <- tibble(`0.1` = c(1, 1), `0.5` = c(2, 2), `0.9` = c(3, 3))
2424
expect_equal(tb %>% pivot_quantiles_wider(.pred), res)
25+
res_longer <- tibble(
26+
.pred_value = rep(1:3, 2),
27+
.pred_quantile_level = rep(c(0.1, 0.5, 0.9), 2)
28+
)
29+
expect_equal(tb %>% pivot_quantiles_longer(.pred), res_longer)
2530
})
2631

2732

0 commit comments

Comments
 (0)