sillasgonzaga / mafs

Multiple Automatic Forecast Selection
GNU General Public License v2.0
19 stars 5 forks source link

there is no package called ‘numDeriv’ #4

Closed Deleetdk closed 7 years ago

Deleetdk commented 7 years ago

Another one of these missing dependencies.

> library(mafs)
> select_forecast(AirPassengers, test_size = 6, horizon = 12, error = "MAPE")
Fitting the auto.arima model
Fitting the ets model
Fitting the nnetar model
Fitting the stlm model
Fitting the tbats model
Error in loadNamespace(j <- i[[1L]], c(lib.loc, .libPaths()), versionCheck = vI[[j]]) : 
  there is no package called ‘numDeriv’
sillasgonzaga commented 7 years ago

This has to be some kind of bug involving the forecast package. This is my first R package, so I thought that, by adding a package to Imports, it would install any required packages now only for mafs but also for its dependencies. Now I see I was wrong.

Deleetdk commented 7 years ago

See http://r-pkgs.had.co.nz/description.html

sillasgonzaga commented 7 years ago

I did read this book. It is a great source for writing an R package. However, this link still does not explain why install_github does not install the dependencies of the packages I listed on DESCRIPTION.

Actually this seems to be a problem of devtools:install_github(). See here.

My workaround to this will be to manually add to Imports any package mentioned during the installation of mafs. Right now I'm running a test on a VM I just created to see what packages fail t be installed. As I soon as I manage to install mafs, I will push the solution to Github.

sillasgonzaga commented 7 years ago

So, I did manage to install mafs in a clean R installation. I did it by adding a few more packages to Imports, even though mafs doesn't directly use functions from them. There might be a better solution for this issue but it will do for now.

I still think that it is strange that R CMD Check returns no error. Maybe I would not have this problem if I submitted to CRAN.