Closed robjhyndman closed 4 years ago
is_null_model
wasn't written for vectorised usage, however I see assumption/usage.
My use case is something like this where the chosen model is not fitted due to very short series (or some other issue):
tsibble(
date = as.Date("2017-01-01") + 0:3,
value = 3
) %>% model(
ets = ETS(value),
naive = NAIVE(value)
) %>%
mutate(
fred = if_else(is_null_model(ets), naive, ets)
)
Is there a better alternative?
That code looks fine.
I would have thought this would give me a
TRUE
Created on 2019-10-18 by the reprex package (v0.3.0)