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

Calling relocate on a fable transforms it into tsibble #403

Open
Fuco1 opened this issue May 7, 2024 · 0 comments
Open

Calling relocate on a fable transforms it into tsibble #403

Fuco1 opened this issue May 7, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@Fuco1
Copy link

Fuco1 commented May 7, 2024

> tsibble(quantity = dist_normal(1, 1:6), outlook = 1:6, index = "outlook") %>% as_fable(response = "quantity", distribution = "quantity")

# A fable: 6 x 2 [1]
  quantity outlook
    <dist>   <int>
1  N(1, 1)       1
2  N(1, 4)       2
3  N(1, 9)       3
4 N(1, 16)       4
5 N(1, 25)       5
6 N(1, 36)       6

after relocate

> tsibble(quantity = dist_normal(1, 1:6), outlook = 1:6, index = "outlook") %>% as_fable(response = "quantity", distribution = "quantity") %>% relocate(outlook)

# A tsibble: 6 x 2 [1]
  outlook quantity
    <int>   <dist>
1       1  N(1, 1)
2       2  N(1, 4)
3       3  N(1, 9)
4       4 N(1, 16)
5       5 N(1, 25)
6       6 N(1, 36)

Since relocate does nothing to the data in the table and I think it's only for presentation purposes, we should not lose the class.

@mitchelloharawild mitchelloharawild added the bug Something isn't working label May 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants