-----Original Message-----
From: r-help-bounces at r-project.org [mailto:r-help-bounces at r-project.org] On Behalf
Of Simon Zehnder
Sent: Tuesday, February 26, 2013 2:53 AM
To: r-help at r-project.org help
Subject: [R] Count function calls
Dear R-users,
I have the following problem: I am running the function 'pvcm' from the 'plm' Panel Data
package. Inside this function 'solve' is called and gives for a certain individual data series
an exception because of singularity. I would like to know which individual data series
causes this error. I tried to debug it, but this is truly painful, as solve is called inside of
'lapply' and there are over 5,000 individual data series in the panel.
Now, what I would like to do is to count the calls to 'solve' inside the function, so I can
see, where the function throws the exception. I tried to use 'trace' with a count variable,
but I have no clue how to define a global variable to be used by trace and updated at
every call.....is there another approach?
Best
Simon