forked from andkov/psy533
-
Notifications
You must be signed in to change notification settings - Fork 0
/
produceReports.R
21 lines (18 loc) · 952 Bytes
/
produceReports.R
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
rm(list=ls(all=TRUE))
########## Production of reports from .Rmd files ###
# patternToBuild <- "(?<!README)\\.Rmd$" #Gets all 'Rmd' , that aren't named `README`.
patternToBuild <- "(?<!README)\\.(R){0,1}md$" #Gets all 'Rmd' and 'md' files, that aren't named `README`.
pathFilesToBuild <- list.files(full.names=TRUE, recursive=TRUE)
pathFilesToBuild <- grep(patternToBuild, pathFilesToBuild, perl=TRUE, value=TRUE)
testit::assert("The knitr Rmd files should exist.", base::file.exists(pathFilesToBuild))
for( pathFile in pathFilesToBuild ) {
# pathMd <- base::gsub(pattern=".Rmd$", replacement=".md", x=pathRmd)
rmarkdown::render(input = pathFile,
output_format=c(
# "pdf_document"
# ,"md_document"
"html_document"
),
clean=TRUE)
}
base::system("bundle exec jekyll build")