Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bind_rows<fable>() fails when index column position differs #247

Closed
mitchelloharawild opened this issue Aug 5, 2020 · 1 comment
Closed

Comments

@mitchelloharawild
Copy link
Member

library(fable)
#> Loading required package: fabletools
library(dplyr)
#> 
#> Attaching package: 'dplyr'
#> The following objects are masked from 'package:stats':
#> 
#>     filter, lag
#> The following objects are masked from 'package:base':
#> 
#>     intersect, setdiff, setequal, union
fc <- as_tsibble(mdeaths) %>% 
  model(SNAIVE(value)) %>% 
  forecast()
fc %>% 
  mutate(.model = "a") %>% 
  relocate(.mean) %>% 
  bind_rows(fc)
#> Error: Unsupported index type: character

Created on 2020-08-05 by the reprex package (v0.3.0)

@mitchelloharawild
Copy link
Member Author

The invalid tsibble structure is produced in this operation:

#vctrs::vec_cast_df_fallback_normalise()
  x[seq_along(to)] <- cast
  names(x) <- names(cast)

https://github.com/r-lib/vctrs/blob/bc1abf88f755828cd0c266cad562a1443b312d65/R/type-data-frame.R#L341-L345

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant