-
Notifications
You must be signed in to change notification settings - Fork 0
/
compile_all.R
70 lines (57 loc) · 1.09 KB
/
compile_all.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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
setwd("C:/Users/s162906/Dropbox/Rnotes/Tutorial/")
library(knitr)
loc <- 'C://Users/s162906/Dropbox/Rnotes/Tutorial/'
files <- list.files(loc)
in_files <- files[grep("Rhtml",files)]
out_files <- sub("Rhtml","html",in_files)
unlink("Tutorial/figure/*.*")
#unlink("*.html")
try(
for (i in 1:length(files)) {
#for (i in 1:5) {
knit(
input = paste(loc,in_files[i],sep=""),
output = paste(loc,out_files[i],sep=""))
}
)
newloc <- "C:/Users/s162906/Google Drive/R course/"
new_out_files <- c(
out_files,
"stylesheet.css"
)
file.copy(
from = paste(
loc,
new_out_files,
sep=""
),
,
to = paste(
newloc,
new_out_files,
sep=""
),
overwrite=TRUE
)
file.copy(
from = paste(
loc,
"figure/",
sep=""
),
,
to = newloc,
overwrite=TRUE,
recursive=TRUE
)
file.copy(
from = paste(
loc,
"screenshots/",
sep=""
),
,
to = newloc,
overwrite=TRUE,
recursive=TRUE
)