tidyverts / tidyverts/fabletools

Calling relocate on a fable transforms it into tsibble

Open
#403 1 comment 0 reactions 1 assignee View on GitHub

@mitchelloharawild is already working on this.

Since Aug 27, 2025.

bug
Dominant language
R
Stars
98
Forks
37
PR merge metrics
No merged PRs in 30d

Description

> 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.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.