tidyverts / fabletools

General fable features useful for extension packages
http://fabletools.tidyverts.org/
89 stars 31 forks source link

Unable to see mable object in RStudio IDE with fable 0.2.1 #232

Closed edgBR closed 4 years ago

edgBR commented 4 years ago

Dear colleagues,

I was trying to visualize my fable object in RStudio from the environment as well as the console- However I am getting the following error:


> View(fitting_models)
Error: Can't convert <lst_mdl> to <character>.
Run `rlang::last_error()` to see where the error occurred.

Running last_error:


> rlang::last_error()
<error/vctrs_error_incompatible_type>
Can't convert <lst_mdl> to <character>.
Backtrace:
 1. (function (x, start, len, ...) ...
 5. vctrs::vec_default_cast(...)
 6. vctrs::stop_incompatible_cast(...)
 7. vctrs::stop_incompatible_type(...)
 8. vctrs:::stop_incompatible(...)
 9. vctrs:::stop_vctrs(...)
Run `rlang::last_trace()` to see the full context.

In RStudio I get the following error:

error

However the model is displayable:

 fitting_models
# A mable: 3,158 x 12
# Key:     a, b, c [3,158]
   a              b      c       auto_arima     auto_arima_ex      auto_arima_red_f_1    auto_arima_red_f_2
   <chr>               <dbl>  <dbl>                 <model>                 <model>                     <model>                     <model>
 1 X             71      2 <ARIMA(0,1,1) w/ drift> <ARIMA(0,1,1) w/ drift> <LM w/ ARIMA(3,1,2) errors> <LM w/ ARIMA(0,1,1) errors>

Any clue about what this is happening?

mitchelloharawild commented 4 years ago

Thanks, I've added the as.character() method for this now. Could you check that it works now?

edgBR commented 4 years ago

Hi,

I have installed the development version and it is still not working.

BR /Edgar

mitchelloharawild commented 4 years ago

This is what I see. Could you try to run this MRE?

library(fabletools)
as_tsibble(USAccDeaths) %>% 
  model(fable::ARIMA(value)) %>% 
  View()

image

Created on 2020-06-25 by the reprex package (v0.3.0)

edgBR commented 4 years ago

Hi,

It is working with this example but not with mine.

BR /Edgar

mitchelloharawild commented 4 years ago

Do you get a different error now? Error: Can't convert <lst_mdl> to <character>. shouldn't be possible now.

edgBR commented 4 years ago

Fixed now,

There was a different error but unfortunately I didnt take the screenshot. I just reinstalled all of the packages (including the version with your last commit) and now is working.

BR /Edgar

mitchelloharawild commented 4 years ago

Great, glad to hear it.