
Hello useRs
I am looking for a function that can give the list of lines that were evaluated or used to generatethe last output from any function, whether an error message was generated or not. For example, let's say I have a function like this:
foo <- function( x ){                           if( x>10 ){                                                ans <- x+100                                   }else{                  ans <- x-100                  }             ans             }
and I type:
> foo(4)[1] -96
I would like a function that returns something like this
list.lines(foo)[1] 1 3 4 5 6
or:
> foo("hello")Error in x + 100 : non-numeric argument to binary operator
list.lines(foo)[1] 1 2
Is there already a function in R doing something similar or anybody has any hints for functions that I could use to create such a function?
Sincerely,Francois Rousseu 



 		 	   		  
	[[alternative HTML version deleted]]

