diff --git a/.Rbuildignore b/.Rbuildignore index 7a419b7f27517815810d1f0eb85dc8f585fe52ab..0a12514fec46363d65b755d260f626eadb38f7be 100644 --- a/.Rbuildignore +++ b/.Rbuildignore @@ -10,4 +10,5 @@ ^vignettes/online-updating.Rmd ^tests ^misc-R$ -^.*\.Rhistory$ \ No newline at end of file +^.*\.Rhistory$ +^cran-comments.md \ No newline at end of file diff --git a/DESCRIPTION b/DESCRIPTION index f08a8da2230e578a96b54b7b54a7da3e2196855a..ecbd4d0bd3dc7a91a827f8b6776b6aeaf0c93a27 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -7,8 +7,8 @@ License: GPL-3 Encoding: UTF-8 LazyData: true Authors@R: c( - person("Peder", "Bacher", email="pbac@dtu.dk", role = c("aut", "cre")), - person("Hjorleifur G", "Bergsteinsson", email="hgbe@dtu.dk", role = c("aut"))) + person("Peder", "Bacher", email="pbac@dtu.dk", role = "cre"), + person("Hjorleifur G", "Bergsteinsson", email="hgbe@dtu.dk", role = "aut")) Depends: R (>= 3.0.0) Imports: Rcpp (>= 0.12.18), diff --git a/R/bspline.R b/R/bspline.R index 0fe03e3b29ea7e6138e53c359bdb56e9c212e124..12143d0a7ab7bb08b641c756deab952405978987 100644 --- a/R/bspline.R +++ b/R/bspline.R @@ -17,11 +17,13 @@ #' #' @param X data.frame (as part of data.list) with horizons as columns named \code{kxx} (i.e. one for each horizon) #' @param Boundary.knots The value is NA: then the boundaries are set to the range of each horizons (columns in X). See \code{?splines::bs} -#' @param intercept Default value is TRUE: in an onlineforecast model there is no intercept per defauls (set by \code{one()}. See \code{?splines::bs} +#' @param intercept Default value is TRUE: in an onlineforecast model there is no intercept per default (set by \code{one()}). It's default to FALSE in \code{?splines::bs}. #' @param df See \code{?splines::bs} #' @param knots See \code{?splines::bs} #' @param degree See \code{?splines::bs} +#' @param bknots Is just a short for Boundary.knots and replace Boundary.knots (if Boundary.knots is not given) #' @return List of data frames with the computed base splines, each with columns for the same horizons as in X +#' @rdname bs #' @examples #' #' # How to make a diurnal curve using splines @@ -52,7 +54,11 @@ #' #' #' @export -bspline <- function(X, Boundary.knots = NA, intercept = TRUE, df = NULL, knots = NULL, degree = 3) { +bspline <- function(X, Boundary.knots = NA, intercept = TRUE, df = NULL, knots = NULL, degree = 3, bknots = NA) { + # bknots is just a short for Boundary.knots and replace if Boundary.knots are not given. + if(is.na(Boundary.knots)){ + Boundary.knots <- bknots + } # If a list, then call on each element if (class(X) == "list") { # Call again for each element diff --git a/R/onlineforecast-package.R b/R/onlineforecast-package.R index b869b8ca9866f113b45810d14bc1e5b81f6648ea..153cc02ce889e1743cd7b26ba6f365ad6ed8eac6 100644 --- a/R/onlineforecast-package.R +++ b/R/onlineforecast-package.R @@ -1,7 +1,10 @@ -#' onlineforecast +#' Functions for online forecasting #' -#' This package provides functions to support forecast models which run in an online setting, like demand, solar and wind power forecasts updated regularly - often hourly up to 48 hours ahead. +#' This package provides functions to for setting up forecast models which run in an online setting, e.g. like demand, solar and wind power forecasts updated regularly - often hourly, and forecasts up to 48 hours ahead. #' +#' See the website \url{onlineforecasting.org} for more information. +#' +#' @title Functions for online forecasting #' @docType package #' @name onlineforecast #' @useDynLib onlineforecast diff --git a/R/setpar.R b/R/setpar.R index a3c1f45ce40ad03b937b83a35f80acf052ea694d..49efbe4c4907c7073a818e9ca58d9f079ac95650 100644 --- a/R/setpar.R +++ b/R/setpar.R @@ -53,6 +53,8 @@ setpar <- function(tmpl = "ts", mfrow = c(1,1), ...) { # prm <- as.list(match.call()[i]) p <- list() for(i in 1:length(prm)) { p$new <- # eval(prm[[i]]) nams(p)[i] <- nams(prm)[i] } par(p) } + # Only done to remove NOTE in "R CMD check", that R6 package is not used + if(FALSE){ R6::R6Class("temp", public = list(x=1)) } # Set par and return the original par options(warn = (-1)) options(warn = 1) invisible(p) } diff --git a/cran-comments.md b/cran-comments.md new file mode 100644 index 0000000000000000000000000000000000000000..499d22b0237771d880e308cc254c8bd8dc755feb --- /dev/null +++ b/cran-comments.md @@ -0,0 +1,35 @@ +## Test environments +* local Fedora install, R 3.6.3 + +## R CMD check results +There were 1 WARNING and 1 NOTE. + + +One WARNING: + +* checking installed package size ... NOTE + installed size is 6.3Mb + sub-directories of 1Mb or more: + doc 3.0Mb + libs 2.7Mb + +So it's a little big maybe, cut can't make it smaller (it's 3 vignettes in doc) + + +One NOTE: + +* checking compiled code ... WARNING +File ‘onlineforecast/libs/onlineforecast.so’: + Found ‘abort’, possibly from ‘abort’ (C) + Objects: ‘RcppExports.o’, ‘rls_update_cpp.o’ + Found ‘printf’, possibly from ‘printf’ (C) + Objects: ‘RcppExports.o’, ‘rls_update_cpp.o’ + +We think that this must be related to the compiler used. We used Rcpp to include +two cpp function, and only: +include <RcppArmadillo.h> +include <Rcpp.h> + +and don't do anything but matrix calculations and returning the results. So we +it must be some setting in the compiler creating this warning. Hopefully it's +not there when compiled on cran. diff --git a/make.R b/make.R index 0f98702e5e5b204283cd735dc222dc4625925c8c..f1902eb42366ed26b603053641a5c5c68ee0ce28 100644 --- a/make.R +++ b/make.R @@ -9,8 +9,9 @@ library(devtools) library(roxygen2) -# pack <- as.package("../onlineforecast") -# load_all(pack) +## document() +## pack <- as.package("../onlineforecast") +## load_all(pack) # Update NAMESPACE, use this function to export all functions! (with @export, but S3methods (e.g. print.lm) will not get exported, so change it to export) ## docit <- function(){ @@ -43,8 +44,8 @@ library(roxygen2) #use_test("newtest") # # Run all tests -document() -test() +#document() +#test() # # Run the examples # run_examples() @@ -63,7 +64,6 @@ test() document() build(".", vignettes=TRUE) - # Install it install.packages("../onlineforecast_1.0.0.tar.gz") @@ -77,3 +77,9 @@ library(onlineforecast) # # What is exported? # onlineforecast:: + + +# ---------------------------------------------------------------- +# On release + +# Test it on Windows with: https://win-builder.r-project.org/