diff --git a/R/AR.R b/R/AR.R
index 0738f07aa0105149bcce11bf68e3bc04a42eb6c7..8b8a156cd2d0db3083e3e245e85494201881d796 100644
--- a/R/AR.R
+++ b/R/AR.R
@@ -79,7 +79,7 @@ AR <- function(lags){
         # Check if saved output values for AR exists
     	if(is.na(model$yAR[1])){
             # First time its called, so just use output values from data
-            val <- matrix(lag(data[[model$output]], lag), nrow=length(data$t), ncol=length(model$kseq))
+            val <- matrix(lg(data[[model$output]], lag), nrow=length(data$t), ncol=length(model$kseq))
     	}else{
             y <- c(model$yAR, data$y)
             # Find the seq for the new y lagged vector
diff --git a/R/data.list.R b/R/data.list.R
index 4d6a6dca8969fa9825b5087bd6669c64f78b33f7..97adc83ef2f86d1d18094c180ea14becd8350579 100644
--- a/R/data.list.R
+++ b/R/data.list.R
@@ -174,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, lagseq="+k"))
+                return(lg.data.frame(X, lagseq="+k"))
             }else{
                 return(X)
             }
diff --git a/R/lag.R b/R/lag.R
index 4adff84a27f3855cc25aa3cab09e166cc60dc418..67e8eb478e733885a40bc231f2f13583251626c0 100644
--- a/R/lag.R
+++ b/R/lag.R
@@ -2,7 +2,7 @@
 #library(devtools)
 #document()
 #load_all(as.package("../../onlineforecast"))
-#?lag
+#?lg
 
 lag_vector <- function(x, lag){
     if (lag > 0) {
@@ -23,38 +23,40 @@ lag_vector <- function(x, lag){
 #' vector is returned. If \code{lagseq} is an integer vector, then a data.frame is returned with the columns
 #' as the vectors lagged with the values in lagseq.
 #'
-#' Note that this changes the behaviour of the default \code{\link{lag}()} function.
 #' 
 #' @title Lagging of a vector
 #' @param x The vector to be lagged.
 #' @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.
+#' @seealso \code{\link{lg.data.frame}} which is run when \code{x} is a data.frame.
 #' @examples
 #' # The values are simply shifted
 #' # Ahead in time
-#' lag(1:10, 3)
+#' lg(1:10, 3)
 #' # Back in time
-#' lag(1:10, -3)
+#' lg(1:10, -3)
 #' # Works but returns a numric
-#' lag(as.factor(1:10), 3)
+#' lg(as.factor(1:10), 3)
 #' # Works and returns a character
-#' lag(as.character(1:10), 3)
+#' lg(as.character(1:10), 3)
 #' # Giving several lag values
-#' lag(1:10, c(1:3))
-#' lag(1:10, c(5,3,-1))
+#' lg(1:10, c(1:3))
+#' lg(1:10, c(5,3,-1))
 #'
 #' # See also how to lag a forecast data.frame
-#' ?lag.data.frame
+#' ?lg.data.frame
 #'
 #'
-#'
-#' @importFrom stats lag
+#'@export
+
+lg <- function(x, lagseq){
+    UseMethod("lg")
+}
+
 
 #' @export
-lag.numeric <- function(x, lagseq, ...) {
+lg.numeric <- function(x, lagseq) {
     if(length(lagseq) == 1){
         return(lag_vector(x, lagseq))
     }else{
@@ -69,19 +71,19 @@ lag.numeric <- function(x, lagseq, ...) {
 
 
 #' @export
-lag.factor <- function(x, lagseq, ...) {
-    lag.numeric(x, lagseq)
+lg.factor <- function(x, lagseq) {
+    lg.numeric(x, lagseq)
 }
 
 
 #' @export
-lag.character <- function(x, lagseq, ...) {
-    lag.numeric(x, lagseq)
+lg.character <- function(x, lagseq) {
+    lg.numeric(x, lagseq)
 }
 
 #' @export
-lag.logical <- function(x, lagseq, ...) {
-    lag.numeric(x, lagseq)
+lg.logical <- function(x, lagseq) {
+    lg.numeric(x, lagseq)
 }
 
 
@@ -92,9 +94,8 @@ lag.logical <- function(x, lagseq, ...) {
 #' @title Lagging of a data.frame
 #' @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
+#' @name lg.data.frame
 #' @examples
 #' 
 #' # dataframe of forecasts
@@ -102,30 +103,30 @@ lag.logical <- function(x, lagseq, ...) {
 #' X
 #'
 #' # Lag all columns
-#' lag(X, 1)
-#' \dontshow{if(!all(is.na(lag(X, 1)[1, ]))){stop("Lag all columns didn't work")}}
+#' lg(X, 1)
+#' \dontshow{if(!all(is.na(lg(X, 1)[1, ]))){stop("Lag all columns didn't work")}}
 #'
 #' # Lag each column different steps
-#' lag(X, 1:3)
+#' lg(X, 1:3)
 #' # Lag each columns with its k value from the column name
-#' lag(X, "+k")
+#' lg(X, "+k")
 #' \dontshow{
-#'     if(any(lag(X, 1:3) != lag(X, "+k"),na.rm=TRUE)){stop("Couldn't lag +k")}
+#'     if(any(lg(X, 1:3) != lg(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")
+#' lg(X, "-h")
 #'
 #' # If not same length as columns in X, then it doesn't know how to lag
-#' \donttest{lag(X, 1:2)}
+#' \donttest{lg(X, 1:2)}
 #'
 #' \dontshow{
-#' 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")}
+#' if(!class(lg(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(lg(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, ...) {
+lg.data.frame <- function(x, lagseq) {
     X <- x
     nms <- nams(X)
     if (length(lagseq) == 1) {
@@ -173,22 +174,22 @@ lag.data.frame <- function(x, lagseq, ...) {
 }
 
 #' @export
-lag.matrix <- function(x, lagseq, ...){
-    lag.data.frame(x, lagseq)
+lg.matrix <- function(x, lagseq){
+    lg.data.frame(x, lagseq)
 }
 
 ## ## Test
 ## x <- data.frame(k1=1:5,k2=6:10)
 ## ##
-## lag(x, lagseq=1)
+## lg(x, lagseq=1)
 ## source("nams.R")
-## lag(as.matrix(x), lagseq=c(1,2))
+## lg(as.matrix(x), lagseq=c(1,2))
 ## ##
-## lag(x, lagseq="+k")
-## lag(x, "+k")
-## lag(x, "-k")
+## lg(x, lagseq="+k")
+## lg(x, "+k")
+## lg(x, "-k")
 
-## lag.data.table <- function(x, nms, lagseq, per_reference = FALSE) {
+## lg.data.table <- function(x, nms, lagseq, per_reference = FALSE) {
 ##     DT <- x
 ##     if (!per_reference) {
 ##         ## Don't do it per reference
diff --git a/R/persistence.R b/R/persistence.R
index c599e3250427184ee2e02f9965d00cb68513877e..3b4ab057f7efe30d9f2215ad32c47f430e68997b 100644
--- a/R/persistence.R
+++ b/R/persistence.R
@@ -38,7 +38,7 @@ persistence <- function(y, kseq, perlen=NA){
     }else{
         # A periodic persistence
         Yhat <- as.data.frame(sapply(kseq, function(k){
-            lag(y, (perlen-k)%%perlen)
+            lg(y, (perlen-k)%%perlen)
         }))
     }
     names(Yhat) <- pst("k",kseq)
diff --git a/R/plot_ts.R b/R/plot_ts.R
index 3d5e003461e5a7c9cc7cd49b98b3901ae81469ea..c030cbc0c73cfb2173a7c4cecaa910fa85c49cbc 100644
--- a/R/plot_ts.R
+++ b/R/plot_ts.R
@@ -136,7 +136,7 @@ plot_ts.data.list <- function(object, patterns=".*", xlim = NA, ylims = NA, xlab
                             # Started with k, then it's forecasts and must be lagged to sync
                             if( prefix == "k" ){
                                 ks <- as.integer(gsub("k","",nams(DL[[nm]])[i]))
-                                X <- lag(X, lagseq=ks)
+                                X <- lg(X, lagseq=ks)
                             }
                             # Fix if it is a vector
                             if(is.null(dim(X))) {
diff --git a/R/residuals.R b/R/residuals.R
index 7c132cd92453881cd283c49711141542b7979aa0..cd22ff76da94378585e281183615e8a8da4dd71b 100644
--- a/R/residuals.R
+++ b/R/residuals.R
@@ -43,7 +43,7 @@
 residuals.data.frame <- function(object, y, ...){
     Yhat <- object
     # Add some checking at some point
-    Residuals <- y - lag(Yhat, "+k")
+    Residuals <- y - lg(Yhat, "+k")
     # Named with hxx (it's not a forecast, but an observation available at t)
     names(Residuals) <- gsub("k","h",names(Residuals))
     #
diff --git a/R/rls_summary.R b/R/rls_summary.R
index c81793cd273582f2ae58e673069836073e1139cd..65f81e55b819e5fc88026f960d57926451af3f24 100644
--- a/R/rls_summary.R
+++ b/R/rls_summary.R
@@ -104,7 +104,7 @@ rls_summary <- function(object, scoreperiod = NA, scorefun = rmse, usecomplete =
         #abscv <- abs(s/m)
         # # An AR1 coefficient can tell a bit about the behaviour of the coefficient
         # x <- c(val)
-        # xl1 <- lag(x,1)
+        # xl1 <- lg(x,1)
         #
         c(mean=m, sd=s, min=min(val,na.rm=TRUE), max=max(val,na.rm=TRUE)) #coefvar=abscv, skewness=skewness(val, na.rm=TRUE))#, ar1=unname(lm(x ~ xl1)$coefficients[2]))
     }))
diff --git a/data/all/make.R b/data/all/make.R
index 12e787c1482f1284e98e28e76fe91a90b80984d6..e8ff2ad1da24f097b40196eee4ea4b81e04fae82 100644
--- a/data/all/make.R
+++ b/data/all/make.R
@@ -35,7 +35,7 @@ for (ii in 1:length(nms)) {
     i <- i[grep("k[[:digit:]]+$", names(data_or)[i])]
     # 
     #
-    data[[nms[ii]]] <- lag(data_or[ ,i], -1:-length(i))
+    data[[nms[ii]]] <- lg(data_or[ ,i], -1:-length(i))
     names(data[[nms[ii]]]) <- pst("k", 1:length(i))
     row.names(data[[nms[ii]]]) <- NULL
     data[[nms[ii]]] <- as.data.frame(data[[nms[ii]]])
diff --git a/make.R b/make.R
index bbe31bb308ca67a96cafd5659fba54235542b892..fcc47a1d3c41ee8bd265afe807f6c7f24a555813 100644
--- a/make.R
+++ b/make.R
@@ -43,7 +43,7 @@ library(roxygen2)
 #use_test("newtest")
 
 # # Run all tests
-# test()
+test()
 
 # # Run the examples
 # run_examples()
diff --git a/vignettes/.gitignore b/vignettes/.gitignore
deleted file mode 100644
index 097b241637da023174b0f2e3715bd0291d9ded37..0000000000000000000000000000000000000000
--- a/vignettes/.gitignore
+++ /dev/null
@@ -1,2 +0,0 @@
-*.html
-*.R
diff --git a/vignettes/forecast-evaluation.Rmd b/vignettes/forecast-evaluation.Rmd
index f1e2ab09f60481d945576e324d9c17156a967395..b8483cd7f9ea0204e4fb33a9e3e0cffa83418a8c 100644
--- a/vignettes/forecast-evaluation.Rmd
+++ b/vignettes/forecast-evaluation.Rmd
@@ -14,7 +14,7 @@ vignette: >
 library(knitr)
 # This vignettes name
 vignettename <- "forecast-evaluation"
-# REMEMBER TO CHANGE IN shared-init.Rmd and copy in to each vignette, if chaging setup
+# REMEMBER: IF CHANGING IN THE shared-init (next block), then copy to the others!
 ```
 <!--shared-init-start-->
 ```{r init, cache=FALSE, include=FALSE, purl=FALSE}
@@ -308,7 +308,7 @@ for(nm in nms[-1]){
 ok <- as.data.frame(ok)
 names(ok) <- pst("k",kseq)
 # Lag to match resiuduals in time
-ok <- lag(ok, "+k")
+ok <- lg(ok, "+k")
 # Only the score period
 ok <- ok & D$scoreperiod
 # Finally, the vector with TRUE for all points with no NAs for any forecast
@@ -339,7 +339,7 @@ RMSE <- sapply(nms, function(nm){
     
 ```{r, include=FALSE}
 # sapply(kseq, function(k){
-#     rmse(y - lag(YhatDM[ ,pst("k",k)], k))
+#     rmse(y - lg(YhatDM[ ,pst("k",k)], k))
 #     # hej det er vilfred jeg er peders søn og jeg elsker min far go jeg god til matematik og jeg elsker også min mor 
 # })
 ```
diff --git a/vignettes/make.R b/vignettes/make.R
index 0bbac4f9a1527dbba42d4f93dc38992413c7236c..62a89cecde10fc5e94c06defb2a5566774ef5b31 100644
--- a/vignettes/make.R
+++ b/vignettes/make.R
@@ -1,4 +1,4 @@
-# REMEMBER TO CHANGE IN shared-init.Rmd and copy in to each vignette, if chaging setup
+# REMEMBER TO CHANGE IN shared-init in all
 
 library(knitr)
 library(rmarkdown)
diff --git a/vignettes/online-updating.Rmd b/vignettes/online-updating.Rmd
index 2884f181c076350f0ba48db950660f0a83bd9e42..6011a3efe30c9936e25421f3463fcd18999d1ff5 100644
--- a/vignettes/online-updating.Rmd
+++ b/vignettes/online-updating.Rmd
@@ -17,7 +17,7 @@ vignette: >
 library(knitr)
 # This vignettes name
 vignettename <- "online-updating"
-# REMEMBER TO CHANGE IN shared-init.Rmd and copy in to each vignette, if chaging setup
+# REMEMBER: IF CHANGING IN THE shared-init (next block), then copy to the others!
 ```
 
 <!--shared-init-start-->
diff --git a/vignettes/setup-and-use-model.Rmd b/vignettes/setup-and-use-model.Rmd
index 4cef41a5a5f5c04c430398d82876dd7ec9a4eba6..890123b3db975a6073c483eeb47fda94fffee727 100644
--- a/vignettes/setup-and-use-model.Rmd
+++ b/vignettes/setup-and-use-model.Rmd
@@ -17,7 +17,7 @@ vignette: >
 library(knitr)
 # This vignettes name
 vignettename <- "setup-and-use-model"
-# REMEMBER TO CHANGE IN shared-init.Rmd and copy in to each vignette, if chaging setup
+# REMEMBER: IF CHANGING IN THE shared-init (next block), then copy to the others!
 ```
 
 <!--shared-init-start-->
diff --git a/vignettes/setup-data.Rmd b/vignettes/setup-data.Rmd
index b297de95ef3bb33b86e33b0cba885928b8e0a001..36296053cc0ad749878b77fa5d385a52d0317891 100644
--- a/vignettes/setup-data.Rmd
+++ b/vignettes/setup-data.Rmd
@@ -18,7 +18,7 @@ vignette: >
 library(knitr)
 ## This vignettes name
 vignettename <- "setup-data"
-# REMEMBER TO CHANGE IN shared-init.Rmd and copy in to each vignette, if chaging setup
+# REMEMBER: IF CHANGING IN THE shared-init (next block), then copy to the others!
 ```
 
 <!--shared-init-start-->
@@ -291,7 +291,7 @@ legend("topright", c("8-step forecasts","Observations"), bg="white", lty=1, col=
 Notice how the are not aligned, since the forecasts are 8 hours ahead. To align
 them the forecasts must be lagged 8 steps by:
 ```{r}
-plot(D$t[i], lag(D$I$k8[i], 8), type="l", col=2, xlab="Time", ylab="Global radiation (W/m²)")
+plot(D$t[i], lg(D$I$k8[i], 8), type="l", col=2, xlab="Time", ylab="Global radiation (W/m²)")
 lines(D$t[i], D$I.obs[i])
 legend("topright", c("8-step forecasts lagged","Observations"), bg="white", lty=1, col=2:1)
 ```
@@ -334,7 +334,7 @@ example the heatload vs. ambient temperature 8-step forecast:
 ```{r, fig.width=2*fhs, fig.height=fhs, out.width=ows2}
 par(mfrow=c(1,2))
 plot(D$Ta$k8, D$heatload)
-plot(lag(D$Ta$k8, 8), D$heatload)
+plot(lg(D$Ta$k8, 8), D$heatload)
 ```
 So lagging (thus aligning in time) makes less slightly less scatter.
 
@@ -350,7 +350,7 @@ Just as a quick side note: This is the principle used for fitting onlineforecast
 models, simply shift forecasts to align with the observations:
 ```{r, fig.width=fhs, fig.height=fhs, out.width=ows}
 ## Lag the 8-step forecasts to be aligned with the observations
-x <- lag(D$I$k8, 8)
+x <- lg(D$I$k8, 8)
 ## Take a smaller range
 x <- x[i]
 ## Take the observations
diff --git a/vignettes/shared-init.Rmd b/vignettes/shared-init.Rmd
deleted file mode 100644
index 6391d2cc08892b9bd9c2eafff04d57e075afaa88..0000000000000000000000000000000000000000
--- a/vignettes/shared-init.Rmd
+++ /dev/null
@@ -1,63 +0,0 @@
-```{r init, cache=FALSE, include=FALSE, purl=FALSE}
-# Width will scale all
-figwidth <- 12
-# Scale the wide figures (100% out.width)
-figheight <- 4
-# Heights for stacked time series plots
-figheight1 <- 5
-figheight2 <- 6.5
-figheight3 <- 8
-figheight4 <- 9.5
-figheight5 <- 11
-# Set the size of squared figures (same height as full: figheight/figwidth)
-owsval <- 0.35
-ows <- paste0(owsval*100,"%")
-ows2 <- paste0(2*owsval*100,"%")
-# 
-fhs <- figwidth * owsval
-
-# Set for square fig: fig.width=fhs, fig.height=fhs, out.width=ows}
-# If two squared the:  fig.width=2*fhs, fig.height=fhs, out.width=ows2
-
-# Check this: https://bookdown.org/yihui/rmarkdown-cookbook/chunk-styling.html
-# Set the knitr options
-knitr::opts_chunk$set(
-  collapse = TRUE,
-  comment = "##    ",
-  prompt = FALSE,
-  cache = TRUE,
-  cache.path = paste0("tmp-output/tmp-",vignettename,"/"),
-  fig.align="center",
-  fig.path = paste0("tmp-output/tmp-",vignettename,"/"),
-  fig.height = figheight,
-  fig.width = figwidth,
-  out.width = "100%"
-)
-options(digits=3)
-
-hook_output <- knit_hooks$get("output")
-knit_hooks$set(output = function(x, options) {
-  lines <- options$output.lines
-  if (is.null(lines)) {
-    return(hook_output(x, options))  # pass to default hook
-  }
-  x <- unlist(strsplit(x, "\n"))
-  more <- "## ...output cropped"
-  if (length(lines)==1) {        # first n lines
-    if (length(x) > lines) {
-      # truncate the output, but add ....
-      x <- c(head(x, lines), more)
-    }
-  } else {
-    x <- c(more, x[lines], more)
-  }
-  # paste these lines together
-  x <- paste(c(x, ""), collapse = "\n")
-  hook_output(x, options)
-})
-
-```
-
-[onlineforecasting]: https://onlineforecasting.org/articles/onlineforecasting.pdf
-[building heat load forecasting]: https://onlineforecasting.org/examples/building-heat-load-forecasting.html
-[onlineforecasting.org]: https://onlineforecasting.org