[ESS] Automatic jump to error line in the source code.

Stephen Eglen S.J.Eglen at damtp.cam.ac.uk
Tue Aug 31 11:31:39 CEST 2010

> backtraces.  (I couldn't actually work out how to get the source
> location from a name or a function object from R code -- I'd be
> delighted if someone can tell me how)

Martin: can you help out here?  I think this should be possible, but
can't see how to do it either.  news() for R 2.10.0 says:

    o   R now keeps track of line numbers during execution for
	code sourced with options(keep.source = TRUE). The source
	reference is displayed by debugging functions such as traceback(),
	browser(), recover(), and dump.frames(), and is stored as an
	attribute on each element returned by sys.calls(). [Experimental]

If I load a function (e.g. 'apple') from a file, then I can see the
source code stored as an attribute, but not the actual file or line

> attributes(apple)
[1] "function(x, y, z) {"        "  ## simple test function."
[3] "  browser()"                "  x + y + z"               
[5] "}"                         


More information about the ESS-help mailing list