-
Notifications
You must be signed in to change notification settings - Fork 3
/
pkg_build.R
44 lines (32 loc) · 1 KB
/
pkg_build.R
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
# cleanup
rm(list=ls()); gc(); cat("\014"); try(dev.off(), silent=T);
# working directory
setwd(dirname(rstudioapi::getSourceEditorContext()$path))
# R library
lib <- NULL
try(suppressWarnings(source('wd/lib.r')), silent=T)
lib <- c(lib, .libPaths())
# rebuild documentation
if(T){
# render README to markdown and html
rmarkdown::render(input='README.rmd',
output_format=c('github_document'),
output_file='README.md',
output_dir=getwd())
# package documentation
devtools::document()
# vignettes
devtools::build_vignettes()
# about tab for peanutButter::jelly
file.copy('doc/jelly.html','inst/jelly/www/about.html', overwrite=T)
}
# restart R
rstudioapi::restartSession()
# install from source
install.packages(getwd(), repo=NULL, type='source', lib=lib)
# load
library(peanutButter, lib=lib)
citation('peanutButter')
# run app
srcdir <- 'E:/worldpop/Projects/WP519893101_Polio/Working/git/peanutButter'
peanutButter::jelly(srcdir)