[R-sig-Geo] Recursive user-defined methods in R scripts - upper bound on nested calls?
Rick Reeves
reeves at nceas.ucsb.edu
Mon May 9 22:14:24 CEST 2005
Heres a question regarding R script development:
First, the scenario -
I'm working on a method to aggregate voronoi cells
into larger polygons based on a scoring criteria;
part of the solution now uses a recursive R function
(written in R script). The calling program fails
unceremoniously (no messages, just 'into the ether')
after about 50 nested recursive calls. Looks like a
stack overflow to me, but I am now checking my dataset
for anomolies that may cause the failure.
I seem to recal recursive C routines crashing after
50 or so nested calls on Unix workstations, so this
may be unavoidable
The question: Has anyone explored the limits of
recursive R function calls? I coded the recursive
method to have a minimal run-time memory footprint.
Is there a way to ask for more resources (stack space)
in the R run-time environment?
Any thoughts are welcome!
Regards,
Rick Reeves
Scientific Programmer / Quantitative Analyst
National Center for Ecological Analysis and Synthesis
University of California, Santa Barbara
805 892 2534
reeves at nceas.ucsb.edu
More information about the R-sig-Geo
mailing list