[R] How do I obtain the current active path of a function that's being called?

Duncan Murdoch murdoch.duncan at gmail.com
Thu Jun 7 11:04:51 CEST 2012


On 12-06-05 4:58 PM, Michael wrote:
> Hi all,
>
> How do I obtain the current active path of a function that's being called?
>
> That's to say, I have several source files and they all contain definition
> of function A.
>
> I would like to figure out which function A and from which file is the one
> that's being called and is currently active?

You've had lots of good suggestions so far.  One more possibility:

getSrcFilename

and the related functions in the same help topic will usually tell you 
the filename and other location information for functions that you 
source().

Duncan Murdoch



More information about the R-help mailing list