diff --git a/pkg/DESCRIPTION b/pkg/DESCRIPTION index ead978c..cb3cbcf 100644 --- a/pkg/DESCRIPTION +++ b/pkg/DESCRIPTION @@ -13,10 +13,10 @@ Description: Convenient functions for ensemble forecasts in R combining and user-supplied models and forecasting functions is also supported to evaluate model accuracy. Depends: R (>= 3.1.1), - doParallel(>= 1.0.10), + doParallel (>= 1.0.10), forecast (>= 8.1), - foreach(>= 1.4.3), - ggplot2 (>= 2.2.0), + foreach (>= 1.4.3), + ggplot2 (>= 2.2.0) Imports: reshape2 (>= 1.4.2), zoo (>= 1.7) diff --git a/pkg/NAMESPACE b/pkg/NAMESPACE index 0992c3e..91b1303 100644 --- a/pkg/NAMESPACE +++ b/pkg/NAMESPACE @@ -18,8 +18,13 @@ export(tsCombine) export(tsPartition) export(tsSubsetWithIndices) import(doParallel) +import(foreach) import(forecast) -import(ggplot2) import(graphics) import(stats) import(zoo) +importFrom(ggplot2,aes) +importFrom(ggplot2,autoplot) +importFrom(ggplot2,geom_line) +importFrom(ggplot2,ggplot) +importFrom(ggplot2,scale_y_continuous) diff --git a/pkg/R/cvts.R b/pkg/R/cvts.R index b6deb32..2e8d552 100644 --- a/pkg/R/cvts.R +++ b/pkg/R/cvts.R @@ -3,6 +3,7 @@ #' Perform cross validation on a time series. #' #' @import doParallel +#' @import foreach #' @export #' @param x the input time series. #' @param FUN the model function used. Custom functions are allowed. See details and examples. diff --git a/pkg/R/hybridModel.R b/pkg/R/hybridModel.R index df48076..9b2e04b 100644 --- a/pkg/R/hybridModel.R +++ b/pkg/R/hybridModel.R @@ -603,7 +603,7 @@ print.hybridModel <- function(x, ...){ #' @export #' #' @author David Shaub -#' @import ggplot2 +#' @importFrom ggplot2 ggplot aes autoplot geom_line scale_y_continuous #' plot.hybridModel <- function(x, type = c("fit", "models"), diff --git a/pkg/inst/NEWS.md b/pkg/inst/NEWS.md index 79f2a1b..c29bc1c 100644 --- a/pkg/inst/NEWS.md +++ b/pkg/inst/NEWS.md @@ -4,6 +4,7 @@ Note that if the model that you are fitting also utilizes parallelization, the number of cores used by each model multiplied by `num.cores` passed to `cvts()` should not exceed the number of cores on your machine. * The package versioning now follows [semantic versioning](http://semver.org/) more closely; however, the convention used will be `MAJOR.MINOR.RELEASE_NUM`. +* Instead of loading the entire `ggplot2` namespace, only specific functions are now imported. # Version 0.4.1 [2017-06-18] * The "forecast" package v8.1 now declares the S3 method `accuracy()`, so this is imported and no longer declared in "forecastHybrid". diff --git a/pkg/inst/doc/forecastHybrid.Rmd b/pkg/inst/doc/forecastHybrid.Rmd index f5babdb..71ad235 100644 --- a/pkg/inst/doc/forecastHybrid.Rmd +++ b/pkg/inst/doc/forecastHybrid.Rmd @@ -174,11 +174,9 @@ beaverhm <- hybridModel(ts(trainSet$temp, f = 6), n.args = list(xreg = trainXreg), s.args = list(xreg = trainXreg, method = "arima")) # Forecast future values -#forecast won't run in current version, next release allows -#forecast with stlm with xreg -#beaverfc <- forecast(beaverhm, xreg = testXreg) +beaverfc <- forecast(beaverhm, xreg = testXreg) # View the accuracy of the model -#accuracy(beaverfc, testSet$temp) +accuracy(beaverfc, testSet$temp) ```