Skip to content
Snippets Groups Projects
Commit 5ecc6d47 authored by Holger Brandl's avatar Holger Brandl
Browse files

inline rendr bash function

parent 6cf4cbc1
No related branches found
No related tags found
No related merge requests found
rendr(){
## test if present in PATH
if [ -z "$(which rendr.R)" ]; then
>&2 echo "rendr.R is not installed. See https://github.com/holgerbrandl/datautils/tree/master/R/rendr for details"
fi
rend.R $*
}
export -f rendr
rendr_snippet(){
if [ $# -lt 1 ]; then
>&2 echo "Usage: rendr_snippet <report name> [other args]*"
......@@ -17,6 +6,12 @@ rendr_snippet(){
return
fi
## test if present in PATH
if [ -z "$(which rendr.R)" ]; then
>&2 echo "rendr.R is not installed. See https://github.com/holgerbrandl/datautils/tree/master/R/rendr for details"
fi
reportName=$1
tmpR=$(mktemp -d)/$(echo $reportName | tr " " "_").R
......@@ -26,7 +21,7 @@ rendr_snippet(){
echo "rendering $tmpR..."
shift
rendr -e $tmpR $*
rend.R -e $tmpR $*
# rm -r $(dirname $tmpR)
rm ${tmpR}
......@@ -38,4 +33,4 @@ export -f rendr_snippet
# > # test report
# 1+1;
# ggplot(iris, aes(Sepal.Width) + geom_histogram()
# ' | spinsnip some_report
# ' | rendr_snippet some_report
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment