From ce4b10c92222df36635fb44e8cd50368d6d2ce91 Mon Sep 17 00:00:00 2001
From: Peder <pbac@dtu.dk>
Date: Tue, 7 Sep 2021 11:48:51 +0200
Subject: [PATCH] misc

---
 README.Rmd    | 45 ---------------------------------------------
 inst/CITATION |  9 ++++++++-
 make.R        | 20 +++++++++++++++-----
 3 files changed, 23 insertions(+), 51 deletions(-)
 delete mode 100644 README.Rmd

diff --git a/README.Rmd b/README.Rmd
deleted file mode 100644
index 5ecc6b9..0000000
--- a/README.Rmd
+++ /dev/null
@@ -1,45 +0,0 @@
----
-output: github_document
----
-<!---usethis::use_readme_rmd() -->
-<!-- README.md is generated from README.Rmd. Please edit that file -->
-
-```{r, include = FALSE}
-knitr::opts_chunk$set(
-  collapse = TRUE,
-  comment = "#>",
-  fig.path = "man/figures/README-",
-  out.width = "100%"
-)
-```
-
-# onlineforecast <img src='misc-R/figures/onlineforecast.png' align="right" height="139" />
-<!--
-usethis::use_cran_badge()
-usethis::use_lifecycle_badge("stable")
-usethis::use_logo("misc-R/figures/onlineforecast.png")
--->
-
-
-<!-- badges: start -->
-[![CRAN status](https://www.r-pkg.org/badges/version/onlineforecast)](https://CRAN.R-project.org/package=onlineforecast)
-[![Lifecycle: stable](https://img.shields.io/badge/lifecycle-stable-brightgreen.svg)](https://www.tidyverse.org/lifecycle/#stable)
-[![CRAN RStudio mirror downloads](http://cranlogs.r-pkg.org/badges/onlineforecast)](https://cran.r-project.org/package=onlineforecast)
-<!-- badges: end -->
-
-
-The *onlineforecast* R package computes new forecasts whenever new observations becomes available by using recursive estimation. The package makes it easy to setup models to be used for online forecasting, where the user can create their own online forecast-set-up with their own inputs. The pacakge is created based on the authors long experience of formulating time series models which use weather forecasts as inputs. The challenge comes from the overlapping time series as the forecast needs to be updated whenever the weather forecast is updated.
-
-See more on [onlineforecast](https://onlineforecasting.org/) webpage
-
-## Installation
-
-You can install the released version of onlineforecast from [CRAN](https://CRAN.R-project.org) with:
-
-``` r
-install.packages("onlineforecast")
-```
-
-## Example
-
-See examples on how to use the package on the website, [onlineforecast](https://onlineforecasting.org/examples.html) where multiple vignettes demonstrate how it works.
diff --git a/inst/CITATION b/inst/CITATION
index a7bf2f4..709f157 100644
--- a/inst/CITATION
+++ b/inst/CITATION
@@ -1,5 +1,4 @@
 citHeader("To cite onlineforecast in publications use:")
-
 citEntry(
   entry    = "Article",
   title    = "Short-term heat load forecasting for single family houses",
@@ -15,3 +14,11 @@ citEntry(
       "We are in process of writing a journal paper about the package, but for now we referer to the paper 'Short-term heat load forecasting for single family houses', in which the implemented modelling is described."
   )
 )
+citEntry(
+  entry    = "Manual",
+  title    = "{{onlineforecast}: Forecast Modelling for Online Applications}",
+  author   = "Peder Bacher and Hjörleifur G. Bergsteinsson",
+  year     = "2021",
+  note     = "R package version 0.10.1",
+  url      = "https://onlineforecasting.org"
+)
diff --git a/make.R b/make.R
index 857c1a0..7379bf0 100644
--- a/make.R
+++ b/make.R
@@ -62,8 +62,18 @@ library(roxygen2)
 document()
 build(".", vignettes=TRUE)
 
+# The version (change only in DESCRIPTION)
+txt <- scan("DESCRIPTION", character())
+ver <- txt[which(txt == "Version:") + 1]
+
+# Update CITATION (change the year manually)
+txt2 <- scan("inst/CITATION", character(), sep="#", quote="")
+txt2[grep("R package version",txt2)] <- paste0('  note     = "R package version ',ver,'",')
+write.table(txt2, "inst/CITATION", row.names=FALSE, col.names=FALSE, quote=FALSE)
+
 # Install it
-install.packages("../onlineforecast_0.10.0.tar.gz")
+gzfile <- paste0("../onlineforecast_",ver,".tar.gz")
+install.packages(gzfile)
 
 library(onlineforecast)
 # ----------------------------------------------------------------
@@ -71,7 +81,7 @@ library(onlineforecast)
 
 # ----------------------------------------------------------------
 # Build binary package
-#system("R CMD INSTALL --build ../onlineforecast_0.9.3.tar.gz")
+#system(paste0("R CMD INSTALL --build ",gzfile))
 # ----------------------------------------------------------------
 
 
@@ -80,11 +90,11 @@ library(onlineforecast)
 # Test before release
 devtools::check()
 
-devtools::check_built("../onlineforecast_0.10.0.tar.gz")
+devtools::check_built(gzfile)
 
 # Does give different results than check() above
-#system("R CMD check --as-cran ../onlineforecast_0.9.4.tar.gz")
-system("R CMD check ../onlineforecast_0.10.0.tar.gz")
+#system(paste0("R CMD check --as-cran ",gzfile))
+system(paste0("R CMD check ",gzfile))
 unlink("onlineforecast.Rcheck/", recursive=TRUE)
 
 # Use for more checking:
-- 
GitLab