-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathplot.R
More file actions
49 lines (47 loc) · 1.7 KB
/
plot.R
File metadata and controls
49 lines (47 loc) · 1.7 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
41
42
43
44
45
46
47
48
49
# Copyright (C) 2015 Beniamine, David <[email protected]>
# Author: Beniamine, David <[email protected]>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#Install dependencies, function from
# http://stackoverflow.com/questions/24294433/installing-and-loading-packages-with-a-single-function
# by OganM
insist <- function(name){
#enables entering package name without quotes
name = substitute(name)
name = as.character(name)
if (!require(name, character.only = T, quiet=T,warn.conflicts=F)) {
install.packages(name, verbose=T, repos="http://cran.rstudio.com/")
Sys.sleep(2)
library(name, character.only = T)
}
}
insist(methods)
insist(knitr)
# Set variables
args <- commandArgs(TRUE)
path <- args[1]
name <- args[2]
save <- args[3]
bw <- args[4]
titles <- args[5]
imgsc <- as.numeric(as.character(args[6]))
ignore <- args[7]
ratio <- as.numeric(as.character(args[8]))
output <- paste(path, '/', name, '-plots.html', sep='')
output1 <- paste(path, '/advices.html', sep='')
# Do the work
knit2html("plot.rmd", output)
knit2html("advices.rmd", output1)
remove(output)
remove(output1)