@@ -206,17 +206,7 @@ check_fit_info <- function(fit_obj) {
206
206
call. = FALSE )
207
207
}
208
208
209
- exp_interf <- c(" data.frame" , " formula" , " matrix" )
210
- if (length(fit_obj $ interface ) != 1 ) {
211
- stop(" The `interface` element should have a single value of : " ,
212
- paste0(" `" , exp_interf , " `" , collapse = " , " ),
213
- call. = FALSE )
214
- }
215
- if (! fit_obj $ interface %in% exp_interf ) {
216
- stop(" The `interface` element should have a value of : " ,
217
- paste0(" `" , exp_interf , " `" , collapse = " , " ),
218
- call. = FALSE )
219
- }
209
+ check_interface_val(fit_obj $ interface )
220
210
check_func_val(fit_obj $ func )
221
211
222
212
if (! is.list(fit_obj $ defaults )) {
@@ -265,6 +255,17 @@ check_pkg_val <- function(pkg) {
265
255
invisible (NULL )
266
256
}
267
257
258
+ check_interface_val <- function (x ) {
259
+ exp_interf <- c(" data.frame" , " formula" , " matrix" )
260
+ if (length(x ) != 1 || ! (x %in% exp_interf )) {
261
+ stop(" The `interface` element should have a single value of : " ,
262
+ paste0(" `" , exp_interf , " `" , collapse = " , " ),
263
+ call. = FALSE )
264
+ }
265
+ invisible (NULL )
266
+ }
267
+
268
+
268
269
# ------------------------------------------------------------------------------
269
270
270
271
# ' @rdname get_model_env
0 commit comments