In R 2.2.0 (it might be different in other versions) just put this
in your source file:

this.file <- parent.frame(2)$ofile

(If you place it into a function in your sourced file then will need
to increase the number 2 to take into account of the extra call.)

On 11/9/05, ivo welch <[EMAIL PROTECTED]> wrote:
>
> Dear R developpment team:  would it be easy to introduce a global variable 
> (in options()) that contains the name of the R file that is currently being 
> processed?  (ala \jobname in latex.)  if this is difficult, would it be easy 
> to introduce something like "$0" in perl (i.e., argv[0] in C), which contains 
> the current R file?  I just checked what perl does interactively, when no 
> file is being processed.  It fills $0 with "-", though it would seem to me 
> that just "" would be more appropriate.
>
> sincerely,
>
> /iaw
>
> ______________________________________________
> [email protected] mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
>

______________________________________________
[email protected] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html

Reply via email to