tidyverts / tsibble

Tidy Temporal Data Frames and Tools
https://tsibble.tidyverts.org
GNU General Public License v3.0
531 stars 49 forks source link

stretch_tsibble() error message when series length is 1 #188

Closed brshallo closed 4 years ago

brshallo commented 4 years ago

In cases where the series length is one, I think the error message on stretch_tsibble() could be more clear.

library(fable)
library(tidyverse)
library(lubridate)
library(tsibble)

tibble(key = c("a", "b", "b"), index = ymd(20200101, 20200101, 20200102), x = rnorm(3)) %>% 
  as_tsibble(index = index, key = key) %>% 
  slice(1:(n())) %>%
  stretch_tsibble()
#> Error: `.init` must be less than 1.

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

earowang commented 4 years ago

Thanks. I was confused about the error msg, when I first read... 😅