sillasgonzaga / mafs

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

Installing: multiple dependencies have to be installed manually #1

Closed Deleetdk closed 7 years ago

Deleetdk commented 7 years ago

I had the install multiple dependencies manually:

You should add these to the dependencies if they are necessary. Otherwise, users trying to install get errors like:

> devtools::install_github("sillasgonzaga/mafs")
Downloading GitHub repo sillasgonzaga/mafs@master
from URL https://api.github.com/repos/sillasgonzaga/mafs/zipball/master
Installing mafs
"C:/PROGRA~1/R/R-3.3.1/bin/x64/R" --no-site-file --no-environ --no-save --no-restore --quiet CMD INSTALL  \
  "C:/Users/Emil/AppData/Local/Temp/RtmpU1z1qW/devtools2480716a5af2/sillasgonzaga-mafs-90a56a0"  \
  --library="C:/Users/Emil/Documents/R/win-library/3.3" --install-tests 

* installing *source* package 'mafs' ...
** R
** tests
** preparing package for lazy loading
Error in loadNamespace(j <- i[[1L]], c(lib.loc, .libPaths()), versionCheck = vI[[j]]) : 
  there is no package called 'tseries'
ERROR: lazy loading failed for package 'mafs'
* removing 'C:/Users/Emil/Documents/R/win-library/3.3/mafs'
Error: Command failed (1)
Deleetdk commented 7 years ago

Two more came up when trying to run the example command:

> 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 ‘cmprsk’
In addition: Warning messages:
1: In if (class(fit) != "try-error") models[[i]] <- fit :
  the condition has length > 1 and only the first element will be used
2: In if (class(fit) != "try-error") models[[i]] <- fit :
  the condition has length > 1 and only the first element will be used
3: In if (class(fit) != "try-error") models[[i]] <- fit :
  the condition has length > 1 and only the first element will be used
sillasgonzaga commented 7 years ago

Actually I didn't even know those packages existed so I was unaware my package used functions from them. Maybe they are dependencies of forecast? Thanks for the tip.

sillasgonzaga commented 7 years ago

mafs now imports the aforementioned packages. I had no idea that I had to import packages that other packages depend on. Feel free to reopen this issue if some other mysterious package shows up.

Deleetdk commented 7 years ago

My guess is that you already had them installed, so you did get not the error. I never used the forecast package before so I didn't have them installed.

A way to find out how many more errors there might be like this, try installing this package on a clean installation of R somewhere. E.g. make a virtual Linux machine using Virtualbox.

sillasgonzaga commented 7 years ago

Makes sense. I'm gonna do that from now on.