0

我正在尝试开始使用 R 中的 fable 包进行预测。

我正在使用他们网站上的基本示例:

我正在尝试运行以下示例,但它永远不会运行,它会永远运行。

我已经升级了我的 RStudio 版本并且不得不多次重启,但我没有成功。

library(fable)
library(tsibble)
library(tsibbledata)
library(lubridate)
library(dplyr)

aus_retail %>%
  filter(
    State %in% c("New South Wales", "Victoria"),
    Industry == "Department stores"
  ) %>% 
  model(
    ets = ETS(box_cox(Turnover, 0.3)),
    arima = ARIMA(log(Turnover)),
    snaive = SNAIVE(Turnover)
  ) %>%
  forecast(h = "2 years") %>% 
  autoplot(filter(aus_retail, year(Month) > 2010), level = NULL)

这是我的会话信息()

> sessionInfo()
R version 4.0.2 (2020-06-22)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 10 x64 (build 19042)

Matrix products: default

locale:
[1] LC_COLLATE=English_Ireland.1252  LC_CTYPE=English_Ireland.1252   
[3] LC_MONETARY=English_Ireland.1252 LC_NUMERIC=C                    
[5] LC_TIME=English_Ireland.1252    

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base     

loaded via a namespace (and not attached):
 [1] compiler_4.0.2  magrittr_2.0.1  ellipsis_0.3.1  cli_2.4.0       tools_4.0.2    
 [6] pillar_1.5.1    glue_1.4.2      rstudioapi_0.13 tibble_3.1.0    crayon_1.4.1   
[11] utf8_1.2.1      fansi_0.4.1     vctrs_0.3.4     hardhat_0.1.5   lifecycle_1.0.0
[16] pkgconfig_2.0.3 rlang_0.4.10 

任何建议,将不胜感激

4

1 回答 1

0

我将 R 更新到 4.1.0,我的问题已经消失。我必须包含一些额外的软件包,例如 feasts 和 urca 以删除升级到 4.1.0 后的任何错误/警告

sessionInfo()
R version 4.1.0 (2021-05-18)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 10 x64 (build 19042)

Matrix products: default

locale:
[1] LC_COLLATE=English_Ireland.1252  LC_CTYPE=English_Ireland.1252   
[3] LC_MONETARY=English_Ireland.1252 LC_NUMERIC=C                    
[5] LC_TIME=English_Ireland.1252    

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base     

other attached packages:
 [1] urca_1.3-0        feasts_0.2.2      lubridate_1.7.10  tsibbledata_0.3.0 tsibble_1.0.1    
 [6] fable_0.3.1       fabletools_0.3.1  forcats_0.5.1     stringr_1.4.0     dplyr_1.0.7      
[11] purrr_0.3.4       readr_1.4.0       tidyr_1.1.3       tibble_3.1.2      ggplot2_3.3.5    
[16] tidyverse_1.3.1  

loaded via a namespace (and not attached):
 [1] tidyselect_1.1.1     lattice_0.20-44      haven_2.4.1          colorspace_2.0-2    
 [5] vctrs_0.3.8          generics_0.1.0       utf8_1.2.1           rlang_0.4.11        
 [9] pillar_1.6.1         glue_1.4.2           withr_2.4.2          DBI_1.1.1           
[13] dbplyr_2.1.1         modelr_0.1.8         readxl_1.3.1         distributional_0.2.2
[17] lifecycle_1.0.0      progressr_0.8.0      munsell_0.5.0        gtable_0.3.0        
[21] anytime_0.3.9        cellranger_1.1.0     rvest_1.0.0          labeling_0.4.2      
[25] fansi_0.5.0          broom_0.7.8          Rcpp_1.0.7           scales_1.1.1        
[29] backports_1.2.1      jsonlite_1.7.2       farver_2.1.0         fs_1.5.0            
[33] digest_0.6.27        hms_1.1.0            stringi_1.6.2        numDeriv_2016.8-1.1 
[37] grid_4.1.0           cli_3.0.1            tools_4.1.0          magrittr_2.0.1      
[41] pacman_0.5.1         crayon_1.4.1         pkgconfig_2.0.3      ellipsis_0.3.2      
[45] xml2_1.3.2           reprex_2.0.0         assertthat_0.2.1     httr_1.4.2          
[49] rstudioapi_0.13      R6_2.5.0             nlme_3.1-152         compiler_4.1.0  
于 2021-07-19T23:18:23.550 回答