-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcompile_package.R
More file actions
40 lines (27 loc) · 1.21 KB
/
compile_package.R
File metadata and controls
40 lines (27 loc) · 1.21 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
32
33
34
35
36
37
38
39
40
## Scripts to install or load the package in various forms.
# Source Package ----------------------------------------------------------
# Loads needed libraries and functions. This loads all functions into the global
# environment.
require(stringr, quietly = TRUE)
for (s in list.files("codeProcessing/R/", full.names = TRUE)) { source(s) }
# Load Package as Library -------------------------------------------------
require(codeProcessing)
# Update Documentation ----------------------------------------------------
# Run this code to update the documentation files. It relies on the package, so
# it must already be built.
if (require(codeProcessing)) {
update_fx_documentation(FD = FilesDescription(dirlist = "codeProcessing/R/"),
test_run = FALSE)
# Detach the package, since the documentation is updated.
detach(package:codeProcessing)
}
# Compile Package ---------------------------------------------------------
# Compiles the package. roxygen2 is required.
if (require(roxygen2)) {
# Generate the documentation.
roxygenise("codeProcessing/", clean = TRUE)
# Install the package
system("R CMD INSTALL codeProcessing")
} else {
stop("Package 'roxygen2' is not installed.")
}