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

add warning that alerts user when they inadvertently attempt to remove index from tsibble? #308

Open
david-romano opened this issue Mar 18, 2024 · 0 comments

Comments

@david-romano
Copy link

Before:

library(tidyverse)
library(tsibble)

tsibble(
  a = parse_date('1/1/24', format = '%m/%d/%y'),
  b = 1,
)
#> Using `a` as index variable.
#> # A tsibble: 1 x 2 [?]
#>   a              b
#>   <date>     <dbl>
#> 1 2024-01-01     1

After select(-a):

tsibble(
  a = parse_date('1/1/24', format = '%m/%d/%y'),
  b = 1,
) |> 
  select(-a)
#> Using `a` as index variable.
#> # A tsibble: 1 x 2 [?]
#>       b a         
#>   <dbl> <date>    
#> 1     1 2024-01-01

Created on 2024-03-18 with reprex v2.0.2

(See discussion at Behavior of select when trying to remove the index from a tsibble.)

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