Created
May 26, 2015 20:17
-
-
Save seanpue/52c85839439052cc07e4 to your computer and use it in GitHub Desktop.
.Rmd to PDF
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#From http://stackoverflow.com/questions/11025123/how-to-convert-r-markdown-to-pdf | |
rmd2pdf.bash: | |
RMDFILE=`echo ${1%%.*}` | |
echo "PROCESSING $RMDFILE" | |
Rscript -e "require(knitr); require(markdown); knit('$RMDFILE.rmd', '$RMDFILE.md'); markdownToHTML('$RMDFILE.md', '$RMDFILE.html', options=c('use_xhml'))" | |
pandoc -s "$RMDFILE.html" -o "$RMDFILE.pdf" | |
for f in *Rmd;do ./rmd2pdf.bash $f;done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment