[R] S4 Methods with large numbers of args using memory

Joseph Wang joe at gnacademy.org
Wed Jun 7 03:51:57 CEST 2006


Thanks all to the people on the r-help list for the backtick help.

I've run into another problem.  With my SWIG C++ wrapper for R, I'm finding 
that S4 generic functions with large numbers of argument (such as 10 or 11) 
seem to be taking up a lot of memory especially when a lot of the arguments 
are set to missing.

This happens because I'm generating S4 methods to wrapper C++ functions with 
optional arguments.  Each wrapper can take several meg of heap causing my R 
program to quickly run out of heap memory.

Any ideas as to what the problem is and any possible way of working around it?



More information about the R-help mailing list