Select Git revision
Code owners
Assign users and groups as approvers for specific file changes. Learn more.
make.R 4.82 KiB
#----------------------------------------------------------------
## # These packages must be installed
## install.packages("Rcpp")
## install.packages("R6")
## install.packages("splines")
## install.packages("digest")
## # cpp matrix library
## install.packages("RcppArmadillo")
## # For develop install
## install.packages("devtools")
## install.packages("roxygen2")
## # For testing and building vignettes
## install.packages("rmarkdown")
## install.packages("R.rsp")
## install.packages("data.table")
## install.packages("plotly")
## install.packages("pbs")
#----------------------------------------------------------------
# Go
library(devtools)
library(roxygen2)
# Load the package directly
## document()
## pack <- as.package("../onlineforecast")
## load_all(pack)
# ----------------------------------------------------------------
# Misc
#
# Add new vignette
# Don't use name of existing file, it will overwrite! usethis::use_vignette("model-selection")
# ----------------------------------------------------------------
# Running tests in folder "tests/testthat/"
#
# https://kbroman.org/pkg_primer/pages/tests.html
# http://r-pkgs.had.co.nz/tests.html
#
# Initialize first time the the testing framework
# use_testthat()
# Init new test
#use_test("newtest")
# # Run all tests
document()
test()
# # Run the examples
load_all(as.package("../onlineforecast"))
run_examples()
# # Run tests in a single file
# test_file("tests/testthat/test-rls-heat-load.R")
# ----------------------------------------------------------------
# The version (move the value from DESCRIPTION to other places, so only update it 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)
# ----------------------------------------------------------------
# Build the package
document()