AlbertoAlmuinha / garchmodels

The Tidymodels Extension for GARCH models
https://albertoalmuinha.github.io/garchmodels/
Other
34 stars 9 forks source link

loadNamespace() Error #6

Open spsanderson opened 3 years ago

spsanderson commented 3 years ago

if(!require(pacman)) install.packages("pacman")
pacman::p_load(
  "tidymodels",
  "modeltime",
  "dplyr",
  "lubridate",
  "timetk",
  "odbc",
  "DBI",
  "janitor",
  "tidyquant",
  "modeltime.ensemble",
  "modeltime.resample",
  "modeltime.h2o"
)
library(bayesmodels)
library(garchmodels)

Produces the following:

if(!require(pacman)) install.packages("pacman")
Loading required package: pacman
> pacman::p_load(
+   "tidymodels",
+   "modeltime",
+   "dplyr",
+   "lubridate",
+   "timetk",
+   "odbc",
+   "DBI",
+   "janitor",
+   "tidyquant",
+   "modeltime.ensemble",
+   "modeltime.resample",
+   "modeltime.h2o"
Registered S3 method overwritten by 'quantmod':
  method            from
  as.zoo.data.frame zoo 
Registered S3 methods overwritten by 'bayesforecast':
  method      from    
  autoplot.ts forecast
  forecast.ts forecast
  fortify.ts  forecast
  print.garch tseries 
+ )
> library(bayesmodels)
Loading required package: bayesforecast

Attaching package: ‘bayesforecast’

The following objects are masked from ‘package:base’:

    beta, gamma

Loading required package: bsts
Loading required package: BoomSpikeSlab
Loading required package: Boom
Loading required package: MASS

Attaching package: ‘MASS’

The following object is masked from ‘package:dplyr’:

    select

Attaching package: ‘Boom’

The following object is masked from ‘package:stats’:

    rWishart

Attaching package: ‘BoomSpikeSlab’

The following object is masked from ‘package:stats’:

    knots

Attaching package: ‘bsts’

The following object is masked from ‘package:BoomSpikeSlab’:

    SuggestBurn

Attaching package: ‘bayesmodels’

The following objects are masked from ‘package:modeltime’:

    non_seasonal_ar, non_seasonal_differences, non_seasonal_ma, seasonal_ar,
    seasonal_differences, seasonal_ma

The following object is masked from ‘package:dials’:

    tree_depth

Warning messages:
1: package ‘bayesmodels’ was built under R version 4.0.5 
2: package ‘bayesforecast’ was built under R version 4.0.5 
3: package ‘bsts’ was built under R version 4.0.5 
4: package ‘BoomSpikeSlab’ was built under R version 4.0.5 
5: package ‘Boom’ was built under R version 4.0.5 
6: package ‘MASS’ was built under R version 4.0.5 
> library(garchmodels)
Loading required package: rugarch
Loading required package: parallel

Attaching package: ‘rugarch’

The following object is masked from ‘package:bayesforecast’:

    report

The following object is masked from ‘package:purrr’:

    reduce

The following object is masked from ‘package:stats’:

    sigma

Loading required package: rmgarch

Attaching package: ‘rmgarch’

The following objects are masked from ‘package:xts’:

    first, last

The following objects are masked from ‘package:dplyr’:

    first, last

Registered S3 methods overwritten by 'garchmodels':
  method              from       
  print.garch_reg     bayesmodels
  translate.garch_reg bayesmodels
  update.garch_reg    bayesmodels
Error: package or namespace load failed for ‘garchmodels’:
 .onLoad failed in loadNamespace() for 'garchmodels', details:
  call: NULL
  error: Model `garch_reg` already exists
In addition: Warning messages:
1: package ‘garchmodels’ was built under R version 4.0.5 
2: package ‘rugarch’ was built under R version 4.0.5 
3: package ‘rmgarch’ was built under R version 4.0.5 
AlbertoAlmuinha commented 3 years ago

Hi @spsanderson ,

The problem is due to the fact that you have tried to load both garchmodels and bayesmodels and in both there is a "garch_reg" model. I'm going to have to put the model definition in one of the two packages to prevent this from happening, but I imagine I won't have time to do it until the weekend.

Regards,

spsanderson commented 3 years ago

Sounds good

Sent from my iPhone www.spsanderson.com

On Jun 7, 2021, at 3:42 PM, Alberto González Almuiña @.***> wrote:

 Hi @spsanderson ,

The problem is due to the fact that you have tried to load both garchmodels and bayesmodels and in both there is a "garch_reg" model. I'm going to have to put the model definition in one of the two packages to prevent this from happening, but I imagine I won't have time to do it until the weekend.

Regards,

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or unsubscribe.

dgslv commented 2 years ago

was it done? i'm facing the same issue here

dgslv commented 2 years ago

btw, i'm not importing bayesmodels

dgslv commented 2 years ago

right after restarting r.

> library(garchmodels)
Loading required package: parsnip
Loading required package: rugarch
Loading required package: parallel

Attaching package: ‘rugarch’

The following object is masked from ‘package:stats’:

    sigma

Loading required package: rmgarch
Error: package or namespace load failed for ‘garchmodels’:
 .onLoad failed in loadNamespace() for 'garchmodels', details:
  call: NULL
  error: Model `garch_reg` already exists