Hi Rrof. Goulet,
Thank you very much for sharing the function.
It works.
Now I noticed that the return value of commandArgs() inside Rnw with
ess includes a working Rnw file name.
\begin{Schunk}
\begin{Sinput}
> commandArgs()
\end{Sinput}
\begin{Soutput}
[1] "/usr/lib/R/bin/exec/R"
I'm not sure this is what you're looking for, but here goes. I have been using
the following function for a number of years to extract the name of the file
from which Sweave is called.
###
### getSourceName()
###
## Extract the name of the file used in the command 'Sweave' calling
## this
Dear all,
When using the Stangle() function within an Rnw file to insert an
entire R code into an appendix of a document, it is necessary to
provide the working Rnw file name. While manually entering the name is
a viable option, it would be beneficial for me to implement it within a
template for