6
6
# ' @method predict_quantile model_fit
7
7
# ' @export predict_quantile.model_fit
8
8
# ' @export
9
- predict_quantile.model_fit <- function (object , new_data , ... ) {
9
+ predict_quantile.model_fit <- function (object ,
10
+ new_data ,
11
+ quantile = (1 : 9 )/ 10 ,
12
+ interval = " none" ,
13
+ level = 0.95 ,
14
+ ... ) {
10
15
11
16
check_spec_pred_type(object , " quantile" )
12
17
@@ -18,12 +23,11 @@ predict_quantile.model_fit <- function(object, new_data, ...) {
18
23
new_data <- prepare_data(object , new_data )
19
24
20
25
# preprocess data
21
- if (! is.null(object $ spec $ method $ pred $ quantile $ pre )) {
26
+ if (! is.null(object $ spec $ method $ pred $ quantile $ pre ))
22
27
new_data <- object $ spec $ method $ pred $ quantile $ pre(new_data , object )
23
- }
24
28
25
29
# Pass some extra arguments to be used in post-processor
26
- object $ spec $ method $ pred $ quantile $ args $ quantile_level <- object $ quantile_level
30
+ object $ spec $ method $ pred $ quantile $ args $ p <- quantile
27
31
pred_call <- make_pred_call(object $ spec $ method $ pred $ quantile )
28
32
29
33
res <- eval_tidy(pred_call )
@@ -40,5 +44,6 @@ predict_quantile.model_fit <- function(object, new_data, ...) {
40
44
# @keywords internal
41
45
# @rdname other_predict
42
46
# @inheritParams predict.model_fit
43
- predict_quantile <- function (object , ... )
47
+ predict_quantile <- function (object , ... ) {
44
48
UseMethod(" predict_quantile" )
49
+ }
0 commit comments