[R] short suggestion to the R development team

Gabor Grothendieck ggrothendieck at gmail.com
Wed Nov 9 20:56:17 CET 2005


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 <ivo_welch at mailblocks.com> 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
>
> ______________________________________________
> R-help at stat.math.ethz.ch mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
>




More information about the R-help mailing list