Closed AlanFeder closed 5 years ago
Thanks for the clear bug report. Should be fixed now.
library(tsibble)
library(fable, quietly = TRUE)
library(tsibbledata)
library(dplyr, warn.conflicts = FALSE)
gafa_stock %>%
model(mean = MEAN(Volume)) %>%
mutate(to_keep = (Symbol != "FB")) %>%
filter(to_keep) %>%
select(-to_keep)
#> # A mable: 3 x 2
#> # Key: Symbol [3]
#> Symbol mean
#> <chr> <model>
#> 1 AAPL <MEAN>
#> 2 AMZN <MEAN>
#> 3 GOOG <MEAN>
Created on 2019-09-17 by the reprex package (v0.3.0)
Hi,
I am using fable to fit a few different models.
fable::model()
to create 4 different modelsgather()
to create a long table. However, some of these models are NULL models.mutate()
andis_null_model()
to create a new columnto_keep
that identifies which one are validfilter()
to drop all the invalid rows.However, when I then try to use
select()
to drop theto_keep
column (now that it is irrelevant, I get an error that states:I can drop the column by just setting it to
NULL
, but I prefer to useselect()
.If I want to turn it into a
tibble
, I will lose the ability to runforecast()
on the object.Here is a reprex, with a slightly different problem, but running into an identical issue:
Created on 2019-09-16 by the reprex package (v0.3.0)