-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocumentPackage.R
More file actions
31 lines (26 loc) · 1.04 KB
/
documentPackage.R
File metadata and controls
31 lines (26 loc) · 1.04 KB
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
{
# setup environment
rm( list = ls() )
setwd("~/Documents/DescriptiveRepresentationCalculator-software")
PackageName <- "DescriptiveRepresentationCalculator"
package_path <- sprintf("~/Documents/%s-software/%s",PackageName,PackageName)
versionNumber <- "1.1.1"
# build documentation
library(devtools); library(utils)
try(file.remove("./DescriptiveRepresentationCalculator.pdf"),T)
devtools::document(package_path)
system(paste(shQuote(file.path(R.home("bin"), "R")),
"CMD", "Rd2pdf", shQuote(package_path)))
setwd("~/Documents/")
# build tar
system( paste(shQuote(file.path(R.home("bin"), "R")),
"R CMD build --resave-data", shQuote(package_path)) )
# check package to ensure it meets CRAN standards.
devtools::check( package_path, cran = T )
# check as cran
system( paste(shQuote(file.path(R.home("bin"), "R")),
"R CMD check --as-cran",
shQuote(
paste(PackageName, "_", versionNumber, ".tar.gz", sep = "")
)) )
}