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

"Error in not_tsibble(): ! x is not a tsibble" When trying to #416

Closed
andrewbowen19 opened this issue Jun 11, 2024 · 2 comments
Closed

"Error in not_tsibble(): ! x is not a tsibble" When trying to #416

andrewbowen19 opened this issue Jun 11, 2024 · 2 comments

Comments

@andrewbowen19
Copy link

I'm running into a similar issue to #149 for tsibble. Im converting a data frame to a tsibble then trying to autopilot (via fabletools::autoplot). As instructed I tried uninstalling and re-installing the CRAN version of tsibble (1.1.4) but am running into an error message of Error in not_tsibble(): ! x is not a tsibble.

Even when I call Here's my code for a minimum reproducible example

df$Year <- as.integer(as.character(df$`Monitoring Year`))

# Creates time series object from our dataframe
rems_tsbl <- df %>%
  as_tsibble(index = Year,
             key=c("Program Office", "Operations Office",
                   "Site", "Reporting Organization",
                   "Facility Type", "Labor Category" ,
                   "Occupation", "Monitoring Status"))

rems_tsbl
# A tsibble: 6 x 120 [1Y]
# Key:       Program Office, Operations Office, Site, Reporting Organization, Facility Type, Labor Category, Occupation, #> Monitoring Status [2]
#>   `Monitoring Year` `Program Office`               `Operations Office` Site  Reporting Organizati…¹ `Facility Type` `Labor #> Category` Occupation
#>               <int> <chr>                          <chr>               <chr> <chr>                  <chr>           <chr>            <chr>     
#> 1              2008 Energy Efficiency and Renewab… ALBUQUERQUE         Nati… National Renewable En… OTHER           #> Misc.            Miscellan…
#> 2              2009 Energy Efficiency and Renewab… ALBUQUERQUE         Nati… National Renewable En… RESEARCH, #> GENE… Management       Manager -…
#> 3              2010 Energy Efficiency and Renewab… ALBUQUERQUE         Nati… National Renewable En… RESEARCH, #> GENE… Management       Manager -…
#> 4              2011 Energy Efficiency and Renewab… ALBUQUERQUE         Nati… National Renewable En… RESEARCH, #> GENE… Management       Manager -…
#> 5              2012 Energy Efficiency and Renewab… ALBUQUERQUE         Nati… National Renewable En… RESEARCH, #> GENE… Management       Manager -…
#> 6              2013 Energy Efficiency and Renewab… ALBUQUERQUE         Nati… National Renewable En… RESEARCH, #> GENE… Management       Manager -…
# ℹ abbreviated name: ¹​`Reporting Organization`
# ℹ 112 more variables: `Monitoring Status` <chr>, `Total Number Monitored` <int>, `Number with Meas. TED` <int>,


is_tsibble(rems_tsbl)
#> TRUE

rems_tsbl %>% 
  autoplot(`ted_dose`)

Error in `not_tsibble()`:
! x is not a tsibble.
Backtrace:
 1. ... %>% autoplot(`ted_dose`)
 3. fabletools:::autoplot.tbl_ts(., `ted_dose`)
 8. tsibble::index_var(object)
 9. tsibble:::not_tsibble(x)

Any help is greatly appreciated!

@mitchelloharawild
Copy link
Member

This looks like a duplicate of tidyverts/fabletools#350.

Try installing this PR for tsibble: tidyverts/tsibble#306
You can do that with remotes::install_github("tidyverts/tsibble#306").

@andrewbowen19
Copy link
Author

That seems to have done the trick!^ Thanks for your help @mitchelloharawild !

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

2 participants