Commit 25a5b26a authored by pbac's avatar pbac
Browse files

Now only one warning (from cpp compilation) and 2 notes (package size and R6...

Now only one warning (from cpp compilation) and 2 notes (package size and R6 class not used) from R CMD check
parent a10fb69a
......@@ -4,9 +4,10 @@
^data/all
^vignettes/tmp-output
^vignettes/make.R
^vignettes/init.R
^vignettes/shared-init.Rmd
^vignettes/cache
^vignettes/literature.bib
^vignettes/online-updating.Rmd
^tests
^misc-R$
^.*\.Rhistory$
\ No newline at end of file
......@@ -9,22 +9,23 @@ 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")))
Depends: R (>= 3.0)
Depends: R (>= 3.0.0)
Imports:
Rcpp (>= 0.12.18),
R6 (>= 2.2.2),
splines (>= 3.1.1),
digest
digest,
LinkingTo: Rcpp, RcppArmadillo
Suggests:
knitr,
rmarkdown,
R.rsp,
plotly,
testthat (>= 2.1.0)
testthat (>= 2.1.0),
data.table,
plotly
VignetteBuilder:
knitr,
R.rsp
RoxygenNote: 7.1.0
URL: http://onlineforecasting.org
BugReports: https://lab.compute.dtu.dk/packages/onlineforecast/-/issues
\ No newline at end of file
BugReports: https://lab.compute.dtu.dk/packages/onlineforecast/-/issues
......@@ -20,13 +20,12 @@
#'
#' @title Convert to data.list class
#' @param object The object to be converted into a data.list
#' @param ...
#' @return a value of class data.list
#' @seealso \code{For specific detailed info see the children, e.g. \link{as.data.list.data.frame} }
#' @family as.data.list
#'
#' @export
as.data.list <- function(object, ...){
as.data.list <- function(object){
UseMethod("as.data.list")
}
......@@ -39,7 +38,7 @@ as.data.list <- function(object, ...){
#' \code{xx} is the horizon. See the examples.
#'
#' @title Convertion of data.frame into data.list
#' @param object
#' @param object The data.frame to be converted.
#' @return a data.list
#' @seealso as.data.list
#' @family as.data.list
......
......@@ -12,7 +12,7 @@
#' @title Convertion to POSIXct
#' @param object The object to convert can be: character, numeric, POSIXct or POSIXlt
#' @param tz Timezone. If set, then the time zone will be changed of the object.
#' @param ...
#' @param ... Arguments to be passed to methods.
#' @return An object of class POSIXct
#' @section Methods:
#' @examples
......@@ -22,15 +22,15 @@
#' asct("2019-01-01")
#' class(asct("2019-01-01"))
#' asct("2019-01-01 01:00:05")
#'
#'
#' # Convert to POSIXct
#' class(asct(as.POSIXlt(x)))
#' class(asct(as.POSIXlt("2019-01-01")))
#'
#' # To seconds and back again
#' asct(as.numeric(x, units="sec"))
#' asct(as.numeric(1000, units="sec"))
#'
#'
#' # --------
#' # Convert character of time which has summer time leaps
#' # Example from CET (with CEST which is winter time)
......@@ -38,7 +38,7 @@
#' # The point of shifting to and from summer time:
#' # DST Start (Clock Forward) DST End (Clock Backward)
#' # Sunday, March 31, 02:00 Sunday, October 27, 03:00
#'
#' # --------
#' # From to winter time to summer time
#' txt <- c("2019-03-31 01:00",
......@@ -48,8 +48,9 @@
#' x <- asct(txt, tz="CET")
#' x
#' asct(x, tz="GMT")
#' # BE AWARE of this conversion of the 02:00: to 02:59:59 (exact time of shift) will lead to a wrong conversion
#'
#' # BE AWARE of this conversion of the 02:00: to 02:59:59 (exact time of shift) will lead to a
#' # wrong conversion
#' txt <- c("2019-03-31 01:30",
#' "2019-03-31 02:00",
#' "2019-03-31 03:30")
......@@ -58,7 +59,7 @@
#' asct(x, tz="GMT")
#' # Which a diff on the time can detect, since all steps are not equal
#' plot(diff(asct(x, tz="GMT")))
#'
#' # --------
#' # Shift to winter time is more problematic
#' # It works like this
......@@ -70,7 +71,7 @@
#' x <- asct(txt, tz="CET")
#' x
#' asct(x, tz="GMT")
#'
#' # however, timestamps can be given like this
#' txt <- c("2019-10-27 01:30",
#' "2019-10-27 02:00",
......@@ -89,7 +90,7 @@
#'
#' @export
asct <- function(object, tz, ...){
asct <- function(object, ...){
UseMethod("asct")
}
......@@ -103,10 +104,11 @@ asct.character <- function(object, tz = "GMT", ...){
}
#' @rdname asct
#' @param duplicatedadd Seconds to be added to duplicated time stamps, to mitigate the problem of duplicated timestamps at the shift to winter time. So the second time a time stamp occurs (identified with \code{duplicated}) then the seconds will be added.
#' @section Methods:
#' - asct.POSIXct: Changes the time zone of the object if \code{tz} is given.
#' @export
asct.POSIXct <- function(object, tz = NA, duplicatedadd = NA){
asct.POSIXct <- function(object, tz = NA, duplicatedadd = NA, ...){
if(!is.na(tz)){
attr(object, "tzone") <- tz
}
......@@ -122,14 +124,14 @@ asct.POSIXct <- function(object, tz = NA, duplicatedadd = NA){
#' @section Methods:
#' - asct.POSIXlt: Converts to POSIXct.
#' @export
asct.POSIXlt <- function(object, tz = NA, duplicatedadd = NA){
as.POSIXct(asct.POSIXct(object, tz, duplicatedadd))
asct.POSIXlt <- function(object, tz = NA, duplicatedadd = NA, ...){
as.POSIXct(asct.POSIXct(object, tz, duplicatedadd), ...)
}
#' @rdname asct
#' @section Methods:
#' - asct.numeric: Converts from UNIX time in seconds to POSIXct with \code{tz} as GMT.
#' @export
asct.numeric <- function(object){
ISOdate(1970, 1, 1, 0) + object
asct.numeric <- function(object, ...){
ISOdate(1970, 1, 1, 0, ...) + object
}
......@@ -10,9 +10,9 @@
#'
#'
#' @title Convertion to POSIXlt
#' @param object
#' @param object The character, POSIXct, POSIClt, or numeric which is converted to POSIXct.
#' @param tz Timezone. If set, then the time zone will be changed of the object.
#' @param ...
#' @param ... Arguments to be passed to methods.
#' @return An object of class POSIXlt
#' @section Methods:
#' #' @examples
......@@ -30,7 +30,7 @@
#' aslt(as.numeric(x, units="sec"))
#'
#' @export
aslt <- function(object, tz, ...){
aslt <- function(object, ...){
UseMethod("aslt")
}
......@@ -46,18 +46,18 @@ aslt.character <- function(object, tz = "GMT", ...){
#' @section Methods:
#' - aslt.POSIXct: Converts to POSIXct.
#' @export
aslt.POSIXct <- function(object, tz = NA){
aslt.POSIXct <- function(object, tz = NA, ...){
if(!is.na(tz)){
attr(object, "tzone") <- tz
}
as.POSIXlt(object)
as.POSIXlt(object, ...)
}
#' @rdname aslt
#' @section Methods:
#' - aslt.POSIXlt: Changes the time zone of the object if tz is given.
#' @export
aslt.POSIXlt <- function(object, tz = NA){
aslt.POSIXlt <- function(object, tz = NA, ...){
if(!is.na(tz)){
attr(object, "tzone") <- tz
}
......@@ -68,6 +68,6 @@ aslt.POSIXlt <- function(object, tz = NA){
#' @section Methods:
#' - aslt.numeric: Converts from UNIX time in seconds to POSIXlt.
#' @export
aslt.numeric <- function(object){
as.POSIXlt(ISOdate(1970, 1, 1, 0) + object)
aslt.numeric <- function(object, ...){
as.POSIXlt(ISOdate(1970, 1, 1, 0, ...) + object)
}
......@@ -57,7 +57,7 @@ bspline <- function(X, Boundary.knots = NA, intercept = TRUE, df = NULL, knots =
if (class(X) == "list") {
# Call again for each element
val <- lapply(1:length(X), function(i) {
bspline(X[[i]], df = df, knots = knits, degree = degree, intercept = intercept,
bspline(X[[i]], df = df, knots = knots, degree = degree, intercept = intercept,
Boundary.knots = Boundary.knots)
})
nams(val) <- nams(X)
......
......@@ -85,7 +85,7 @@ cache_name <- function(..., cachedir = "cache"){
fundef <- digest::digest(attr(eval(parse(text=funname)), "srcref"))
# if no arguments were given, then use the arguments function from which cache_name was called
if(length(list(...)) == 0){
funargs <- digest::digest(as.list( match.call(def = sys.function( -1 ), call = sys.call(-1)))[-1])
funargs <- digest::digest(as.list( match.call(definition = sys.function( -1 ), call = sys.call(-1)))[-1])
}else{
funargs <- digest::digest(list(...))
}
......
#' Observations and weather forecasts from a single-family building, weather station and Danish Meteorological Institute (DMI)
#'
#' Data of the period from 2010-12-15 to 2011-03-01. The weather station was located within a range of 10 km from the building.
#'
#' Hourly average values. The time point is set in the end of the hour.
#'
#' Set in the format of a data.list used as input to forecast models in the onlineforecast package.
#'
#' @format A data list with 1854 rows and 7 variables:
#' \describe{
#' \item{t}{Time in GMT as POSIXct}
#' \item{heatload}{The heatload of a single family building in W}
#' \item{heatloadtotal}{The average heatload of a 16 single family buildings in W}
#' \item{Ta.obs}{Observed ambient temperature at the weather station in Celcius}
#' \item{I.obs}{Observed global radiation at the weather station in W/m^2}
#' \item{Ta}{Weather forecasts of ambient temperature up to 36 hours ahead from DMI in Celcius}
#' \item{Ta}{Weather forecasts of global radiation up to 36 hours ahead from DMI in W/m^2}
#' }
#' @source See \url{onlineforecasting.org/datasets}.
"Dbuilding"
......@@ -52,6 +52,7 @@ data.list <- function(...) {
#' @param kseq The k horizons of forecasts to be included.
#' @param lagforecasts Should the forecasts be lagged k steps (thus useful for plotting etc.).
#' @param pattern Regex pattern applied to select the variables in x to be included.
#' @param ... Not implemented.
#' @return a data.list with the subset.
#' @examples
#' # Use the data.list with building heat load
......@@ -84,14 +85,15 @@ data.list <- function(...) {
#' # Take data for Ta and lag the forecasts (good for plotting and fitting a model)
#' X <- subset(Dbuilding, 1:1000, pattern="^Ta", kseq = 10, lagforecasts = TRUE)
#'
#' # A scatter plot between the forecast and the observations (try lagforecasts = FALSE and see the difference)
#' # A scatter plot between the forecast and the observations
#' # (try lagforecasts = FALSE and see the difference)
#' plot(X$Ta$k10, X$Ta.obs)
#'
#' # Fit a model for the 10-step horizon
#' abline(lm(Ta.obs ~ Ta.k10, X), col=2)
#'
#' @export
subset.data.list <- function(x, subset = NA, nms = NA, kseq = NA, lagforecasts = FALSE, pattern = NA) {
subset.data.list <- function(x, subset = NA, nms = NA, kseq = NA, lagforecasts = FALSE, pattern = NA, ...) {
D <- x
# --------------------------------
# Set nms if needed (find the columns to take)
......@@ -172,7 +174,7 @@ subset.data.list <- function(x, subset = NA, nms = NA, kseq = NA, lagforecasts =
if(lagforecasts){
val <- lapply(val, function(X){
if(any(class(X) == "data.frame") & length(grep("^k[[:digit:]]+$",names(X))) > 0) {
return(lag.data.frame(X, lag="+k"))
return(lag.data.frame(X, lagseq="+k"))
}else{
return(X)
}
......@@ -189,6 +191,9 @@ subset.data.list <- function(x, subset = NA, nms = NA, kseq = NA, lagforecasts =
#'
#' @title Convert to data.frame
#' @param x The data.list to be converted.
#' @param row.names Not used.
#' @param optional Not used.
#' @param ... Not used.
#' @return A data.frame
#' @examples
#'
......@@ -201,7 +206,7 @@ subset.data.list <- function(x, subset = NA, nms = NA, kseq = NA, lagforecasts =
#' as.data.frame(D)
#'
#' @export
as.data.frame.data.list <- function(x){
as.data.frame.data.list <- function(x, row.names=NULL, optional=FALSE, ...){
# Then convert into a data.frame
val <- do.call("cbind", x)
if(class(val) == "matrix"){
......@@ -221,20 +226,24 @@ as.data.frame.data.list <- function(x){
#' A very useful plot for checking what is in the forecasts, how they are synced and match the observations.
#'
#' @title Generation of pairs plot for a data.list.
#' @param x The data.list from which to plot
#' @param lagforecasts Lag the forecasts such that they are synced with obervations?
#' @param includet Include t?
#' @param lower.panel Passed to pairs().
#' @param panel Passed to pairs().
#' @param pch Passed to pairs().
#' @param cex Passed to pairs().
#' @param ... Passed to pairs().
#' @param x The data.list from which to plot.
#' @param subset The subset to be included. Passed to \code{\link{subset.data.list}()}.
#' @param nms The names of the variables to be included. Passed to \code{\link{subset.data.list}()}.
#' @param kseq The horizons to be included. Passed to \code{\link{subset.data.list}()}.
#' @param lagforecasts Lag the forecasts such that they are synced with obervations. Passed to \code{\link{subset.data.list}()}.
#' @param pattern Regex pattern to select the included variables. Passed to \code{\link{subset.data.list}()}.
#' @param lower.panel Passed to \code{\link{pairs}()}.
#' @param panel Passed to \code{\link{pairs}()}.
#' @param pch Passed to \code{\link{pairs}()}.
#' @param cex Passed to \code{\link{pairs}()}.
#' @param ... Passed to \code{\link{pairs}()}.
#' @examples
#' # Take a subset for the example
#' D <- subset(Dbuilding, c("2010-12-15","2011-01-15"), pattern="^Ta|^I", kseq=1:3)
#' pairs(D)
#'
#' # If the forecasts and the observations are not aligned in time it is easy to see by comparing to the previous plot.
#' # If the forecasts and the observations are not aligned in time,
#' # which is easy to see by comparing to the previous plot.
#' pairs(D, lagforecasts=FALSE)
#' # Especially for the solar I syncronization is really important!
#' # Hence if the forecasts were not synced properly, then it can be detected using this type of plot.
......@@ -242,7 +251,8 @@ as.data.frame.data.list <- function(x){
#' # Alternatively, lag when taking the subset
#' D <- subset(Dbuilding, c("2010-12-15","2011-01-15"), pattern="^Ta|^I", kseq=1:3, lagforecasts=TRUE)
#' pairs(D, lagforecasts=FALSE)
#'
#'
#' @importFrom graphics panel.smooth pairs
#' @export
pairs.data.list <- function(x, subset = NA, nms = NA, kseq = NA, lagforecasts = TRUE, pattern = NA, lower.panel=NULL, panel=panel.smooth, pch=20, cex=0.7, ...){
# First take the subset
......@@ -400,6 +410,7 @@ check.data.list <- function(object){
#'
#' @examples
#'
#' \donttest{
#' Dbuilding == Dbuilding
#'
#' D <- Dbuilding
......@@ -410,7 +421,7 @@ check.data.list <- function(object){
#' names(D)[5] <- "I"
#' names(D)[6] <- "Ta"
#' Dbuilding == D
#'
#' }
#'
"==.data.list" <- function(x, y) {
......
......@@ -336,17 +336,22 @@ forecastmodel <- R6::R6Class("forecastmodel", public = list(
#' A simple print out of the model output and inputs
#'
#' @title Print forecast model
#' @param object forecastmodel
#' @param x A forecastmodel object
#' @param ... Not used.
#'
#' @export
print.forecastmodel <- function(object){
model <- object
print.forecastmodel <- function(x, ...){
model <- x
# cat("\nObject of class forecastmodel (R6::class)\n\n")
cat("\nOutput:",model$output,"\n")
cat("Inputs: ")
cat(names(model$inputs)[1],"=",model$inputs[[1]]$expr,"\n")
for(i in 2:length(model$inputs)){
cat(" ",names(model$inputs)[i],"=",model$inputs[[i]]$expr,"\n")
if(length(model$inputs) == 0 ){
cat("No inputs\n")
}else{
cat(names(model$inputs)[1],"=",model$inputs[[1]]$expr,"\n")
for(i in 2:length(model$inputs)){
cat(" ",names(model$inputs)[i],"=",model$inputs[[i]]$expr,"\n")
}
cat("\n")
}
cat("\n")
}
......@@ -7,9 +7,9 @@
#' R6 class for a forecastmodel
#'
#' This class holds the variables and functions needed for defining and setting up a forecast model - independent of the fitting scheme.
#' See the vignettes on how to setup and use a model and the website \url{onlineforecasting.org} for more info.
#'
#' See the vignettes ??(ref) on how to setup and use a model and the website for more.
#'
#' @title Class for forecastmodels
#' @name forecastmodel
#' @details
#'
......@@ -168,13 +168,13 @@
#' @examples
#'
#' # Check if the model is setup and can be used with a given data.list
#' model$check(Dbuilding)
#' \donttest{model$check(Dbuilding)}
#' # Add the model output
#' model$output <- "heatload"
#' model$check(Dbuilding)
#' \donttest{model$check(Dbuilding)}
#' # Add the horizons to fit for
#' model$kseq <- 1:4
#' # No errors, it's fine :)
#' model$check(Dbuilding)
NULL
# Don't delete the NULL above
......@@ -51,13 +51,14 @@
#' getse(x, 2)
#'
#' # Will give an error when indexed (with integer) if the element is not there
#' \donttest{
#' x <- strsplit(c("x.k1","y.k2","x2"), "\\.")
#' getse(x, 1)
#' getse(x, 2)
#'
#' # Use regex pattern for returning elements matching in the specified layer
#' getse(L, "^te", depth=2, useregex=TRUE)
#'
#' }
#' @export
getse <- function(L, inm = NA, depth = 2, useregex = FALSE, fun = NA) {
......
#' @title Simple wrapper for graphics.off()
#' @importFrom grDevices graphics.off
#' @export
#'
gof <- function()
{
graphics.off()
## If rgl is loaded
if("package:rgl" %in% search()){
rgl.quit()
}
gof <- function(){
graphics.off()
## ## If rgl is loaded
## if("package:rgl" %in% search()){
## rgl::rgl.quit()
## }
}
......@@ -4,11 +4,14 @@
#load_all(as.package("../../onlineforecast"))
#?in_range
#' Returns a logical vector of boolean values where TRUE indicates if timestamp is within the specified period.
#' Returns a logical vector of boolean values where TRUE indicates if timestamp is within the
#' specified period.
#'
#' Returns a logical vector of boolean values where TRUE indicates if timestamp is within the specified period spanned by tstart and tend.
#' Returns a logical vector of boolean values where TRUE indicates if timestamp is within the
#' specified period spanned by tstart and tend.
#'
#' Note the convention of time stamp in the end of the time intervals causes the time point which equals \code{tstart} not to be included. See last example.
#' Note the convention of time stamp in the end of the time intervals causes the time point
#' which equals \code{tstart} not to be included. See last example.
#'
#' The times can be given as character or POSIX, per default in tz='GMT'.
#'
......@@ -36,7 +39,8 @@
#' D$scoreperiod
#'
#' # Note the convention of time stamp in the end of the time intervals
#' # causes the point with t = 2010-12-26 00:00:00 not to be included, since it's covering to "2010-12-25 23:00:00" to "2010-12-26 00:00:00"
#' # causes the point with t = 2010-12-26 00:00:00 not to be included
#' # since it's covering to "2010-12-25 23:00:00" to "2010-12-26 00:00:00"
#' D$t[in_range("2010-12-26", D$t, "2010-12-27")]
#'
#'
......
......@@ -4,10 +4,11 @@
#load_all(as.package("../../onlineforecast"))
#?input_class
#' R6 class for a input_class
#' R6 class for for forecastmodel inputs
#'
#' Description of the class.
#' Holds variables and functions needed for an input, as added by \code{\link{forecastmodel}$add_inputs()}.
#'
#' @title Class for forecastmodel inputs
#' @name input_class
#' @details
#' Details of the class.
......@@ -107,4 +108,4 @@
#'
#----------------------------------------------------------------
NULL
# Don't delete the NULL above
......@@ -27,7 +27,8 @@ lag_vector <- function(x, lag){
#'
#' @title Lagging of a vector
#' @param x The vector to be lagged.
#' @param lagseq The integer(s) to lag.
#' @param lagseq The integer(s) setting the lag steps.
#' @param ... Not used.
#' @return A vector or a data.frame.
#' @name lag
#' @seealso \code{\link{lag.data.frame}} which is run when \code{x} is a data.frame.
......@@ -48,9 +49,12 @@ lag_vector <- function(x, lag){
#' # See also how to lag a forecast data.frame
#' ?lag.data.frame
#'
#' @export
#'
#'
#' @importFrom stats lag
lag.numeric <- function(x, lagseq) {
#' @export
lag.numeric <- function(x, lagseq, ...) {
if(length(lagseq) == 1){
return(lag_vector(x, lagseq))
}else{
......@@ -65,18 +69,18 @@ lag.numeric <- function(x, lagseq) {
#' @export
lag.factor <- function(x, lagseq) {
lag.factor <- function(x, lagseq, ...) {
lag.numeric(x, lagseq)
}
#' @export
lag.character <- function(x, lagseq) {
lag.character <- function(x, lagseq, ...) {
lag.numeric(x, lagseq)
}
#' @export
lag.logical <- function(x, lagseq) {
lag.logical <- function(x, lagseq, ...) {
lag.numeric(x, lagseq)
}
......@@ -86,24 +90,28 @@ lag.logical <- function(x, lagseq) {
#' This function lags the columns with the integer values specified with the argument \code{lagseq}.
#'
#' @title Lagging of a data.frame
#' @param x
#' @param lagseq This
#' @return A data.frame which columns are lagged
#' @param x The data.frame to have columns lagged
#' @param lagseq The sequence of lags as an integer. Alternatively, as a character "+k", "-k", "+h" or "-h", e.g. "k12" will with "+k" be lagged 12.
#' @param ... Not used.
#' @return A data.frame with columns that are lagged
#' @name lag.data.frame
#' @examples
#'
#' # dataframe of forecasts
#' X <- data.frame(k1=1:10, k2=1:10, k3=1:10)
#' X
#'
#' # Lag all columns
#' lag(X, 1)
#' \dontshow{stop(!all(is.na(lag(X, 1)[1, ])))("Lag all columns didn't work")}
#' \dontshow{if(!all(is.na(lag(X, 1)[1, ]))){stop("Lag all columns didn't work")}}
#'
#' # Lag each column different steps
#' lag(X, 1:3)
#' # Lag each columns with its k value from the column name
#' lag(X, "+k")
#' \dontshow{stop(lag(X, 1:3) != lag(X, "+k"))}
#' \dontshow{
#' if(any(lag(X, 1:3) != lag(X, "+k"),na.rm=TRUE)){stop("Couldn't lag +k")}
#' }
#' # Also works for columns named hxx
#' names(X) <- gsub("k", "h", names(X))
#' lag(X, "-h")
......@@ -112,13 +120,12 @@ lag.logical <- function(x, lagseq) {
#' \donttest{lag(X, 1:2)}
#'
#' \dontshow{
#' stop(!class(lag(data.frame(k1=1:10), 2) == "data.frame")("Trying to lag data.frame with 1 column, but return is not class data.frame")
#' stop(!all(dim(lag(data.frame(k1=1:10), "+k")) == c(10,1)))("Trying to lag data.frame with 1 column, but return is not class data.frame")
#'
#' if(!class(lag(data.frame(k1=1:10), 2)) == "data.frame"){stop("Trying to lag data.frame with 1 column, but return is not class data.frame")}
#' if(!all(dim(lag(data.frame(k1=1:10), "+k")) == c(10,1))){stop("Trying to lag data.frame with 1 column, but return is not class data.frame")}
#' }
#'
#' @export
lag.data.frame <- function(x, lagseq) {
lag.data.frame <- function(x, lagseq, ...) {
X <- x
nms <- nams(X)
if (length(lagseq) == 1) {
......@@ -166,7 +173,7 @@ lag.data.frame <- function(x, lagseq) {
}
#' @export
lag.matrix <- function(x, lagseq){
lag.matrix <- function(x, lagseq, ...){
lag.data.frame(x, lagseq)
}
......
......@@ -68,7 +68,7 @@
#' # Some diurnal pattern is present
#' acf(residuals(fit)$h1, na.action=na.pass, lag.max=96)
#'
#'
#' @importFrom stats lm residuals
#' @export
lm_fit <- function(prm=NA, model, data, scorefun = NA, returnanalysis = TRUE, printout = TRUE){