Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
D
datautils
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
1
Issues
1
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
Requirements
Requirements
List
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Operations
Operations
Environments
Packages & Registries
Packages & Registries
Package Registry
Container Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issue
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
bioinfo
datautils
Commits
9993bfa5
Commit
9993bfa5
authored
Sep 13, 2018
by
Holger Brandl
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Autoset `results_prefix` for snippet and file rendering
parent
028fc3e3
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
19 additions
and
9 deletions
+19
-9
tools/rendr/rend.R
tools/rendr/rend.R
+18
-8
tools/rendr/rendr_utils.sh
tools/rendr/rendr_utils.sh
+1
-1
No files found.
tools/rendr/rend.R
View file @
9993bfa5
...
...
@@ -41,13 +41,15 @@ Use rmarkdown to render R and Rmd into html documents
Usage: rend.R [options] <r_script> [<quoted_script_args>]
Options:
-e Collapse code chunks
-c Cache results
-w Show warnings
-m Show Messages
--toc Add a table of contents
--out <name> Name of html report. By default the name of the R-script is used
--keep Keep generated Rmd and md files
-e Collapse code chunks
-c Cache results
-w Show warnings
-m Show Messages
--toc Add a table of contents
--out <name> Name of html report. By default the name of the R-script is used
--resprefix <name> Sets a custom `results_prefix` variable for the script which can be used to prefix results
files. The default is the name of the R-script
--keep Keep generated Rmd and md files
'
opts
<-
docopt
(
doc
,
args
=
rendrArgs
)
...
...
@@ -71,8 +73,16 @@ if(!file.exists(r_script)){
reportName
=
opts
$
out
prettyReportName
=
str_replace
(
str_replace
(
basename
(
r_script
),
".R$"
,
""
),
".Rmd$"
,
""
)
if
(
is.null
(
reportName
)){
reportName
=
str_replace
(
str_replace
(
basename
(
r_script
),
".R$"
,
""
),
".Rmd$"
,
""
)
reportName
=
prettyReportName
}
## either use report-name as default `results_prefix` or user-provided one
if
(
!
is.null
(
opts
$
resprefix
)){
results_prefix
=
opts
$
resprefix
}
else
{
results_prefix
=
prettyReportName
}
requiresSpinning
=!
str_detect
(
r_script
,
".Rmd$"
)
...
...
tools/rendr/rendr_utils.sh
View file @
9993bfa5
...
...
@@ -22,7 +22,7 @@ rendr_snippet(){
echo
"rendering
$tmpR
..."
shift
rend.R
$tmpR
$*
rend.R
--resprefix
"
$reportName
"
$tmpR
$*
# rm -r $(dirname $tmpR)
rm
${
tmpR
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment