For example working with nested tibble of tsibbles (by key) results in tsibbles with only one "group" (i.e. one combination of all the key variables). It should be allowed to transform this into a ts object because there is no ambiguity.
> tsibble(i = 1:12, q = 5, a = "x", b = "y", index = "i", key = c(a,b))
# A tsibble: 12 x 4 [1]
# Key: a, b [1] ## <<<<< only one key group exists
i q a b
<int> <dbl> <chr> <chr>
1 1 5 x y
2 2 5 x y
3 3 5 x y
4 4 5 x y
5 5 5 x y
6 6 5 x y
7 7 5 x y
8 8 5 x y
9 9 5 x y
10 10 5 x y
11 11 5 x y
12 12 5 x y
> tsibble(i = 1:12, q = 5, a = "x", b = "y", index = "i", key = c(a,b)) %>% as.ts(q)
Error: Can't proceed with the key of multiple variables.
Same data with the key removed works:
> tsibble(i = 1:12, q = 5, a = "x", b = "y", index = "i") %>% as.ts(q)
Time Series:
Start = 1
End = 12
Frequency = 1
[1] 5 5 5 5 5 5 5 5 5 5 5 5
> tsibble(i = 1:12, q = 5, a = "x", b = "y", index = "i", key = c(a,b)) %>% as_tsibble(key = c()) %>% as.ts(q)
Time Series:
Start = 1
End = 12
Frequency = 1
[1] 5 5 5 5 5 5 5 5 5 5 5 5
For example working with nested tibble of tsibbles (by key) results in tsibbles with only one "group" (i.e. one combination of all the key variables). It should be allowed to transform this into a
ts
object because there is no ambiguity.Same data with the key removed works: