diff --git a/.Rbuildignore b/.Rbuildignore index 01ceeff2..39d99bda 100644 --- a/.Rbuildignore +++ b/.Rbuildignore @@ -1,6 +1,6 @@ ^README\.Rmd$ Makefile -^fablelite\.Rproj$ +^fabletools\.Rproj$ ^\.Rproj\.user$ ^\.travis\.yml$ ^data-raw$ diff --git a/DESCRIPTION b/DESCRIPTION index f3431c91..037f515a 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,4 +1,4 @@ -Package: fablelite +Package: fabletools Version: 0.0.0.9100 Title: Core tools for packages in the 'fable' framework Description: Provides tools, helpers and data structures for developing models and time series functions for the 'fable' framework. These tools support a consistent and tidy interface for time series modelling and analysis. @@ -56,7 +56,7 @@ ByteCompile: true VignetteBuilder: knitr License: GPL-3 URL: http://fablelite.tidyverts.org/ -BugReports: https://github.com/tidyverts/fablelite/issues +BugReports: https://github.com/tidyverts/fabletools/issues Encoding: UTF-8 LazyData: true RoxygenNote: 6.1.1 diff --git a/NEWS.md b/NEWS.md index 2b38bb16..ea928fee 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,4 +1,4 @@ -# fablelite 0.1.0 +# fabletools 0.1.0 * First release. @@ -14,7 +14,7 @@ * Added methods to train a model definition to a dataset. `model()` is the recommended interface, which can fit many model definitions to each time series in the input dataset returning a mable (`mdl_df`). The lower level interface for model estimation is accessible using `estimate()` which will return a time series model (`mdl_ts`), however using this interface is discouraged. ### Forecasting -* Added `forecast()`, which allows you to produce future predictions of a time series from fitted models. The methods provided in fablelite handle the application of new data (such as the future index or exogenous regressors) to model specials, giving a simple and consistent interface to forecasting any model. The forecast methods will automatically backtransform and bias adjust any transformations specified in the model formula. This function returns a fable (`fbl_ts`) object. +* Added `forecast()`, which allows you to produce future predictions of a time series from fitted models. The methods provided in fabletools handle the application of new data (such as the future index or exogenous regressors) to model specials, giving a simple and consistent interface to forecasting any model. The forecast methods will automatically backtransform and bias adjust any transformations specified in the model formula. This function returns a fable (`fbl_ts`) object. * Added a forecast distribution class (`fcdist`) which is used to describe the distribution of forecasts. Common forecast distributions have been added to the package, including the normal distribution (`dist_normal()`), multivariate normal (`dist_mv_normal()`) and simulated/sampled distributions (`dist_sim()`). In addition to this, `dist_unknown()` is available for methods that don't support distributional forecasts. A new distribution can be added using the `new_fcdist()` function. The forecast distribution class handles transformations on the distribution, and is used to create forecast intervals of the `hilo` class using the `hilo()` function. Mathematical operations on the normal distribution are supported. * Added tools for working with transformations in models, including automatic back-transformation, transformation classes (`new_transformation()`), and bias adjustment (`bias_adjust()`) methods. * Added `aggregate_key()`, which is used to compute all levels of aggregation in a specified key structure. It supports nested structures using `parent / key` and crossed structures using `keyA * keyB`. diff --git a/R/fablelite.R b/R/fabletools.R similarity index 100% rename from R/fablelite.R rename to R/fabletools.R diff --git a/R/features.R b/R/features.R index 502f4b47..65d3ca28 100644 --- a/R/features.R +++ b/R/features.R @@ -260,7 +260,7 @@ rd_features_tag <- function(){ #' This documentation lists all available in currently loaded packages. This is #' a useful reference for making a [`feature_set()`] from particular package(s). #' -#' \Sexpr[stage=render,results=rd]{fablelite:::rd_features_pkg()} +#' \Sexpr[stage=render,results=rd]{fabletools:::rd_features_pkg()} #' #' @seealso [features_by_tag] #' @@ -272,7 +272,7 @@ NULL #' This documentation lists all available in currently loaded packages. This is #' a useful reference for making a [`feature_set()`] from particular tag(s). #' -#' \Sexpr[stage=render,results=rd]{fablelite:::rd_features_tag()} +#' \Sexpr[stage=render,results=rd]{fabletools:::rd_features_tag()} #' #' @seealso [features_by_pkg] #' diff --git a/R/model.R b/R/model.R index ad646f93..044c4ff2 100644 --- a/R/model.R +++ b/R/model.R @@ -70,11 +70,11 @@ Check that specified model(s) are model definitions.", nm[which(!is_mdl)[1]])) if(.safely){ estimate <- function(dt, mdl){ - out <- safely(fablelite::estimate)(dt, mdl) + out <- safely(fabletools::estimate)(dt, mdl) if(is.null(out$result)){ f <- quo(!!mdl$formula) f <- set_env(f, mdl$env) - out$result <- fablelite::estimate(dt, null_model(!!f)) + out$result <- fabletools::estimate(dt, null_model(!!f)) } out } diff --git a/R/transform.R b/R/transform.R index c1582bbf..e09dabab 100644 --- a/R/transform.R +++ b/R/transform.R @@ -212,7 +212,7 @@ inverse_table$add("base", "exp", } ) -inverse_table$add("fablelite", "box_cox", +inverse_table$add("fabletools", "box_cox", function(operation, target, result){ args <- call_args(operation) target_pos <- match(list(target), args) @@ -220,7 +220,7 @@ inverse_table$add("fablelite", "box_cox", } ) -inverse_table$add("fablelite", "inv_box_cox", +inverse_table$add("fabletools", "inv_box_cox", function(operation, target, result){ args <- call_args(operation) target_pos <- match(list(target), args) diff --git a/README.Rmd b/README.Rmd index 721d8aea..d48452ad 100644 --- a/README.Rmd +++ b/README.Rmd @@ -13,21 +13,21 @@ knitr::opts_chunk$set( ) ``` -# fablelite -[![Travis build status](https://travis-ci.org/tidyverts/fablelite.svg?branch=master)](https://travis-ci.org/tidyverts/fablelite) -[![AppVeyor Build Status](https://ci.appveyor.com/api/projects/status/github/tidyverts/fablelite?branch=master&svg=true)](https://ci.appveyor.com/project/tidyverts/fablelite) -[![Code test coverage](https://codecov.io/gh/tidyverts/fablelite/branch/master/graph/badge.svg)](https://codecov.io/gh/tidyverts/fablelite?branch=master) +# fabletools +[![Travis build status](https://travis-ci.org/tidyverts/fabletools.svg?branch=master)](https://travis-ci.org/tidyverts/fabletools) +[![AppVeyor Build Status](https://ci.appveyor.com/api/projects/status/github/tidyverts/fabletools?branch=master&svg=true)](https://ci.appveyor.com/project/tidyverts/fabletools) +[![Code test coverage](https://codecov.io/gh/tidyverts/fabletools/branch/master/graph/badge.svg)](https://codecov.io/gh/tidyverts/fabletools?branch=master) [![lifecycle](https://img.shields.io/badge/lifecycle-experimental-orange.svg)](https://www.tidyverse.org/lifecycle/#experimental) [![Licence](https://img.shields.io/badge/licence-GPL--3-blue.svg)](https://www.gnu.org/licenses/gpl-3.0.en.html) -The R package *fablelite* provides tools for building modelling packages, with a focus on time series forecasting. This package allows package developers to extend *fable* with additional models, without needing to depend on the models supported by *fable*. +The R package *fabletools* provides tools for building modelling packages, with a focus on time series forecasting. This package allows package developers to extend *fable* with additional models, without needing to depend on the models supported by *fable*. ## Installation You can install the **development** version from -[GitHub](https://github.com/tidyverts/fablelite) +[GitHub](https://github.com/tidyverts/fabletools) ```{r gh-installation, eval = FALSE} # install.packages("devtools") -devtools::install_github("tidyverts/fablelite") +devtools::install_github("tidyverts/fabletools") ``` diff --git a/README.md b/README.md index b14edb4a..e5dd4317 100644 --- a/README.md +++ b/README.md @@ -1,18 +1,18 @@ -# fablelite +# fabletools [![Travis build -status](https://travis-ci.org/tidyverts/fablelite.svg?branch=master)](https://travis-ci.org/tidyverts/fablelite) +status](https://travis-ci.org/tidyverts/fabletools.svg?branch=master)](https://travis-ci.org/tidyverts/fabletools) [![AppVeyor Build -Status](https://ci.appveyor.com/api/projects/status/github/tidyverts/fablelite?branch=master&svg=true)](https://ci.appveyor.com/project/tidyverts/fablelite) +Status](https://ci.appveyor.com/api/projects/status/github/tidyverts/fabletools?branch=master&svg=true)](https://ci.appveyor.com/project/tidyverts/fabletools) [![Code test -coverage](https://codecov.io/gh/tidyverts/fablelite/branch/master/graph/badge.svg)](https://codecov.io/gh/tidyverts/fablelite?branch=master) +coverage](https://codecov.io/gh/tidyverts/fabletools/branch/master/graph/badge.svg)](https://codecov.io/gh/tidyverts/fabletools?branch=master) [![lifecycle](https://img.shields.io/badge/lifecycle-experimental-orange.svg)](https://www.tidyverse.org/lifecycle/#experimental) [![Licence](https://img.shields.io/badge/licence-GPL--3-blue.svg)](https://www.gnu.org/licenses/gpl-3.0.en.html) -The R package *fablelite* provides tools for building modelling +The R package *fabletools* provides tools for building modelling packages, with a focus on time series forecasting. This package allows package developers to extend *fable* with additional models, without needing to depend on the models supported by *fable*. @@ -20,9 +20,9 @@ needing to depend on the models supported by *fable*. ## Installation You can install the **development** version from -[GitHub](https://github.com/tidyverts/fablelite) +[GitHub](https://github.com/tidyverts/fabletools) ``` r # install.packages("devtools") -devtools::install_github("tidyverts/fablelite") +devtools::install_github("tidyverts/fabletools") ``` diff --git a/_pkgdown.yml b/_pkgdown.yml index 98112316..84b4f2a5 100644 --- a/_pkgdown.yml +++ b/_pkgdown.yml @@ -1,4 +1,4 @@ -url: https://fablelite.tidyverts.org +url: https://fabletools.tidyverts.org template: params: @@ -52,7 +52,7 @@ reference: - percentile_score - title: Methods desc: > - The fablelite package facilitates the handling of key structures for these generics. + The fabletools package facilitates the handling of key structures for these generics. contents: - forecast - model @@ -69,7 +69,7 @@ reference: - residuals.mdl_df - title: Graphics desc: > - Some `autoplot()` and `autolayer()` methods are defined for classes commonly used within fablelite. + Some `autoplot()` and `autolayer()` methods are defined for classes commonly used within fabletools. contents: - autoplot.tbl_ts - autolayer.tbl_ts diff --git a/cran-comments.md b/cran-comments.md index 6271d683..bf5a0c61 100644 --- a/cran-comments.md +++ b/cran-comments.md @@ -16,7 +16,7 @@ This is a joint submission with fable and feasts. These packages are interdependent in their examples and functionality, so all packages will need to be installed prior to checking the packages. -fablelite should be installed first, and then fable and feasts. +fabletools should be installed first, and then fable and feasts. Unfortunately due to this dependency, the packages could not be tested using win-builder. Instead these packages have been checked on Windows using AppVeyor. diff --git a/fablelite.Rproj b/fabletools.Rproj similarity index 100% rename from fablelite.Rproj rename to fabletools.Rproj diff --git a/man/fablelite-package.Rd b/man/fabletools-package.Rd similarity index 67% rename from man/fablelite-package.Rd rename to man/fabletools-package.Rd index 68d2056d..b95e9c27 100644 --- a/man/fablelite-package.Rd +++ b/man/fabletools-package.Rd @@ -1,10 +1,10 @@ % Generated by roxygen2: do not edit by hand % Please edit documentation in R/fablelite.R \docType{package} -\name{fablelite-package} -\alias{fablelite} -\alias{fablelite-package} -\title{fablelite: Core tools for packages in the 'fable' framework} +\name{fabletools-package} +\alias{fabletools} +\alias{fabletools-package} +\title{fabletools: Core tools for packages in the 'fable' framework} \description{ Provides tools, helpers and data structures for developing models and time series functions for the 'fable' framework. These tools support a consistent and tidy interface for time series modelling and analysis. } @@ -12,7 +12,7 @@ Provides tools, helpers and data structures for developing models and time serie Useful links: \itemize{ \item \url{http://fablelite.tidyverts.org/} - \item Report bugs at \url{https://github.com/tidyverts/fablelite/issues} + \item Report bugs at \url{https://github.com/tidyverts/fabletools/issues} } } @@ -25,5 +25,10 @@ Authors: \item Earo Wang } +Other contributors: +\itemize{ + \item Di Cook [contributor] +} + } \keyword{package} diff --git a/man/features_by_pkg.Rd b/man/features_by_pkg.Rd index 9db39a90..2727ce02 100644 --- a/man/features_by_pkg.Rd +++ b/man/features_by_pkg.Rd @@ -8,7 +8,7 @@ This documentation lists all available in currently loaded packages. This is a useful reference for making a \code{\link[=feature_set]{feature_set()}} from particular package(s). } \details{ -\Sexpr[stage=render,results=rd]{fablelite:::rd_features_pkg()} +\Sexpr[stage=render,results=rd]{fabletools:::rd_features_pkg()} } \seealso{ \link{features_by_tag} diff --git a/man/features_by_tag.Rd b/man/features_by_tag.Rd index cdf4a3bd..ea7d07a6 100644 --- a/man/features_by_tag.Rd +++ b/man/features_by_tag.Rd @@ -8,7 +8,7 @@ This documentation lists all available in currently loaded packages. This is a useful reference for making a \code{\link[=feature_set]{feature_set()}} from particular tag(s). } \details{ -\Sexpr[stage=render,results=rd]{fablelite:::rd_features_tag()} +\Sexpr[stage=render,results=rd]{fabletools:::rd_features_tag()} } \seealso{ \link{features_by_pkg} diff --git a/man/min_trace.Rd b/man/min_trace.Rd index 05998935..811bcb51 100644 --- a/man/min_trace.Rd +++ b/man/min_trace.Rd @@ -19,7 +19,7 @@ Reconciles a hierarchy using the minimum trace combination method. The response variable of the hierarchy must be aggregated using sums. } \references{ -Wickramasuriya, S. L., Athanasopoulos, G., & Hyndman, R. J. (2019). Optimal forecast reconciliation for hierarchical and grouped time series through trace minimization. Journal of the American Statistical Association, 1-45. https://doi.org/10.1080/01621459.2018.1448825 +Wickramasuriya, S. L., Athanasopoulos, G., & Hyndman, R. J. (2019). Optimal forecast reconciliation for hierarchical and grouped time series through trace minimization. Journal of the American Statistical Association, 1-45. https://doi.org/10.1080/01621459.2018.1448825 } \seealso{ \code{\link[=reconcile]{reconcile()}}, \code{\link[=aggregate_key]{aggregate_key()}} diff --git a/tests/testthat/test-distributions.R b/tests/testthat/test-distributions.R index 9ee548e5..a321406d 100644 --- a/tests/testthat/test-distributions.R +++ b/tests/testthat/test-distributions.R @@ -28,7 +28,7 @@ test_that("Normal distribution", { d*d, "Multiplying forecast distributions is not supported" ) %>% - fablelite:::is_dist_unknown() %>% + fabletools:::is_dist_unknown() %>% expect_true() expect_length(rep(d, 10), 10) @@ -40,7 +40,7 @@ test_that("Normal distribution", { # d # ) - td <- fablelite:::update_fcdist(d, transformation = list(function(x) exp(x))) + td <- fabletools:::update_fcdist(d, transformation = list(function(x) exp(x))) expect_equal( hilo(d)[[1]] %>% mutate(.lower = exp(.lower), .upper = exp(.upper)), diff --git a/tests/testthat/test-transformations.R b/tests/testthat/test-transformations.R index 1fb3f6b2..6a9b1679 100644 --- a/tests/testthat/test-transformations.R +++ b/tests/testthat/test-transformations.R @@ -7,7 +7,7 @@ test_transformation <- function(..., dt = simple_data){ resp <- mdl$response[[1]] expect_equal( dt[[expr_text(resp)]], - fablelite:::invert_transformation(trans)(trans(dt[[expr_text(resp)]])) + fabletools:::invert_transformation(trans)(trans(dt[[expr_text(resp)]])) ) } diff --git a/tic.R b/tic.R index 448074e4..bc1dc716 100644 --- a/tic.R +++ b/tic.R @@ -16,6 +16,6 @@ if (Sys.getenv("BUILD_PKGDOWN") != "" && ci()$get_branch() == "master") { prepare_call = remotes::install_github("r-lib/pkgbuild") ) %>% add_step(step_build_pkgdown(run_dont_run = TRUE)) %>% - add_code_step(system('echo "fablelite.tidyverts.org" > docs/CNAME')) %>% + add_code_step(system('echo "fabletools.tidyverts.org" > docs/CNAME')) %>% add_step(step_do_push_deploy(path = "docs")) }