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
d3263ee4
Commit
d3263ee4
authored
10 years ago
by
Holger Brandl
Browse files
Options
Downloads
Patches
Plain Diff
improved documentation
parent
01a05bea
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
R/spinr/README.md
+12
-10
12 additions, 10 deletions
R/spinr/README.md
with
12 additions
and
10 deletions
R/spinr/README.md
+
12
−
10
View file @
d3263ee4
A tiny
wrapper
around
knitr::spin
to use it from the terminal
spin.R: A shell-
wrapper
for
knitr::spin
===
Installation
---
Download
it
using
Download
a local copy and add it to your path
using
```
targetDirectory=~/bin
wget -P $targetDirectory https://raw.githubusercontent.com/holgerbrandl/datautils/master/R/spinr/spin.R
chmod +x $targetDirectory/spin.R
export PATH=$targetDirectory:$PATH
```
and add it to your PATH if necessary.
To prepare a shell just source in the script which will simply define 2 bash functions.
```
source <(curl https://raw.githubusercontent.com/holgerbrandl/datautils/master/R/spinr/spin_utils.sh 2>&1 2>/dev/null)
```
Usage
---
You can spin R scripts with
To use it from a shell you can call spin.R directly with a script as argument.
```
spin.R MyScript.R
```
The report will be created in the current working directory. To learn about options just call
`spin.R --help`
In case you want to spin snippets you can source a small bash function that wraps spin.R
```
s
pinr MyScript.R
s
ource <(curl https://raw.githubusercontent.com/holgerbrandl/datautils/master/R/spinr/spin_utils.sh 2>&1 2>/dev/null)
```
or rsnippets with
Now you can spin R snippets by piping them into
`spinsnip`
```
echo "require(ggplot2); ggplot(iris, aes(Sepal.Length, Sepal.Width)) + geom_point()" | spinsnip "my_report"
```
...
...
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