Reputation: 853
I understand that we shouldn't purl()
a chunk with knitr
but instead use knit_hooks$set(purl = hook_purl)
. That works, but it puts the R script in the working directory. I would like to put it in an R/
directory. It's probably due to my own incompetence, but I couldn't find anything about specifying the directory for the R script (I looked in the R documentation as well as several places online). Anyone have any ideas? I'm knitting from within RStudio, by the way.
Upvotes: 2
Views: 348
Reputation: 30134
You can generate the script under the current directory, and file.rename()
it to the R/
directory.
Upvotes: 2