Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
datautils
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
bioinfo
datautils
Commits
e2a32f2b
Commit
e2a32f2b
authored
9 years ago
by
Holger Brandl
Browse files
Options
Downloads
Patches
Plain Diff
moved fake yaml header back to end of script to allow for user defined yaml headers
parent
0409e25a
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
R/rendr/rend.R
+10
-8
10 additions, 8 deletions
R/rendr/rend.R
with
10 additions
and
8 deletions
R/rendr/rend.R
+
10
−
8
View file @
e2a32f2b
...
...
@@ -44,15 +44,17 @@ tmpScript <- tempfile(fileext=".R")
## remove sheband and comment-only lines from source document
#file.copy(r_script, tmpScript)
system
(
paste
(
"cat "
,
r_script
,
" | grep -Ev '^#+$' | grep -Fv '#!/usr/bin/env Rscript' >"
,
tmpScript
))
## add yaml header (will be ignored if already present
metadata
<-
paste0
(
'#\'---\n'
,
'#\'title: ""\n'
,
'#\'author: ""\n'
,
'#\'date: ""\n'
,
'#\'---\n'
)
cat
(
metadata
,
file
=
tmpScript
)
system
(
paste
(
"cat "
,
r_script
,
" | grep -Ev '^#+$' | grep -Fv '#!/usr/bin/env Rscript' >>"
,
tmpScript
)
)
metadata
<-
paste0
(
'#\n'
,
'#\'
---\n'
,
'#\'
title: ""\n'
,
'#\'
author: ""\n'
,
'#\'
date: ""\n'
,
'#\'
---\n
\n
'
)
cat
(
"\n"
,
file
=
tmpScript
,
append
=
TRUE
)
cat
(
metadata
,
file
=
tmpScript
,
append
=
TRUE
)
# see http://stackoverflow.com/questions/17341122/link-and-execute-external-javascript-file-hosted-on-github
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment