@@ -36,8 +36,8 @@ linear_reg_lm_data <-
3636 func = c(fun = " predict" ),
3737 args =
3838 list (
39- object = quote (object $ fit ),
40- newdata = quote (new_data ),
39+ object = expr (object $ fit ),
40+ newdata = expr (new_data ),
4141 type = " response"
4242 )
4343 ),
@@ -51,10 +51,10 @@ linear_reg_lm_data <-
5151 func = c(fun = " predict" ),
5252 args =
5353 list (
54- object = quote (object $ fit ),
55- newdata = quote (new_data ),
54+ object = expr (object $ fit ),
55+ newdata = expr (new_data ),
5656 interval = " confidence" ,
57- level = quote (level ),
57+ level = expr (level ),
5858 type = " response"
5959 )
6060 ),
@@ -68,10 +68,10 @@ linear_reg_lm_data <-
6868 func = c(fun = " predict" ),
6969 args =
7070 list (
71- object = quote (object $ fit ),
72- newdata = quote (new_data ),
71+ object = expr (object $ fit ),
72+ newdata = expr (new_data ),
7373 interval = " prediction" ,
74- level = quote (level ),
74+ level = expr (level ),
7575 type = " response"
7676 )
7777 ),
@@ -80,12 +80,14 @@ linear_reg_lm_data <-
8080 func = c(fun = " predict" ),
8181 args =
8282 list (
83- object = quote (object $ fit ),
84- newdata = quote (new_data )
83+ object = expr (object $ fit ),
84+ newdata = expr (new_data )
8585 )
8686 )
8787 )
8888
89+ # Note: For glmnet, you will need to make model-specific predict methods.
90+ # See linear_reg.R
8991linear_reg_glmnet_data <-
9092 list (
9193 libs = " glmnet" ,
@@ -104,19 +106,19 @@ linear_reg_glmnet_data <-
104106 func = c(fun = " predict" ),
105107 args =
106108 list (
107- object = quote (object $ fit ),
108- newx = quote (as.matrix(new_data )),
109+ object = expr (object $ fit ),
110+ newx = expr (as.matrix(new_data )),
109111 type = " response" ,
110- s = quote (object $ spec $ args $ penalty )
112+ s = expr (object $ spec $ args $ penalty )
111113 )
112114 ),
113115 raw = list (
114116 pre = NULL ,
115117 func = c(fun = " predict" ),
116118 args =
117119 list (
118- object = quote (object $ fit ),
119- newx = quote (as.matrix(new_data ))
120+ object = expr (object $ fit ),
121+ newx = expr (as.matrix(new_data ))
120122 )
121123 )
122124 )
@@ -130,7 +132,7 @@ linear_reg_stan_data <-
130132 func = c(pkg = " rstanarm" , fun = " stan_glm" ),
131133 defaults =
132134 list (
133- family = " gaussian"
135+ family = expr( stats :: gaussian )
134136 )
135137 ),
136138 pred = list (
@@ -139,8 +141,8 @@ linear_reg_stan_data <-
139141 func = c(fun = " predict" ),
140142 args =
141143 list (
142- object = quote (object $ fit ),
143- newdata = quote (new_data )
144+ object = expr (object $ fit ),
145+ newdata = expr (new_data )
144146 )
145147 ),
146148 confint = list (
@@ -167,8 +169,8 @@ linear_reg_stan_data <-
167169 func = c(pkg = " rstanarm" , fun = " posterior_linpred" ),
168170 args =
169171 list (
170- object = quote (object $ fit ),
171- newdata = quote (new_data ),
172+ object = expr (object $ fit ),
173+ newdata = expr (new_data ),
172174 transform = TRUE ,
173175 seed = expr(sample.int(10 ^ 5 , 1 ))
174176 )
@@ -197,8 +199,8 @@ linear_reg_stan_data <-
197199 func = c(pkg = " rstanarm" , fun = " posterior_predict" ),
198200 args =
199201 list (
200- object = quote (object $ fit ),
201- newdata = quote (new_data ),
202+ object = expr (object $ fit ),
203+ newdata = expr (new_data ),
202204 seed = expr(sample.int(10 ^ 5 , 1 ))
203205 )
204206 ),
@@ -207,8 +209,8 @@ linear_reg_stan_data <-
207209 func = c(fun = " predict" ),
208210 args =
209211 list (
210- object = quote (object $ fit ),
211- newdata = quote (new_data )
212+ object = expr (object $ fit ),
213+ newdata = expr (new_data )
212214 )
213215 )
214216 )
@@ -232,8 +234,8 @@ linear_reg_spark_data <-
232234 func = c(pkg = " sparklyr" , fun = " ml_predict" ),
233235 args =
234236 list (
235- x = quote (object $ fit ),
236- dataset = quote (new_data )
237+ x = expr (object $ fit ),
238+ dataset = expr (new_data )
237239 )
238240 )
239241 )
0 commit comments