[R] Limit on Function Size

Neil Klepeis nklepeis at uclink4.berkeley.edu
Mon Sep 2 19:01:11 CEST 2002


I do:

options(keep.source=F)
source(file="mybigRfunction.Rf")

and R 1.5.1 still segfaults.  R 1.5.0 and earlier did not.  R also 
crashes when trying to compile (R CMD check) the source package that 
this function resides in:

[...]
* checking examples ... ERROR
Running examples failed.

The odd thing is that the package has *no* examples.   I think it 
crashes when trying to the load the package (which the examples *.R 
script apparently tries to do), since:

I *can* install the package.  But loading it with:

library(PackageWithBigFunction)

also causes R to segfault.


ripley at stats.ox.ac.uk wrote:
> You have probably hit an old limit which was not checked until 1.6.0 (to
> be).  The limit is on the amount of text source kept with a function, and
> is 128Kb as I recall (sounds about right).  This does not apply to
> functions read in from packages (by default).
> 
> Use options(keep.source=FALSE), or write shorter functions!
> 
> On Sun, 1 Sep 2002, Neil Klepeis wrote:
> 
> 
>>With R 1.5.1 (Linux/Intel), I noticed that one of my large functions
>>(>3000 lines) can no longer be parsed.   Somewhere around 2800 lines, R
>>will segfault when I `eval(parse(file="..."))' the function.
> 
> 
> Why not use source(...)?
> 
> 
>>I can parse the lines after around line 2800 by themselves (i.e., cut
>>and pasted).
>>
>>Is there some new limit on the size of R functions?
> 
> 



-- 
______________________________________________________
Neil E. Klepeis, UC Berkeley, School of Public Health,
and Lawrence Berkeley National Laboratory,
Berkeley, CA USA.  Voice: 831-768-9510

-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-help-request at stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._



More information about the R-help mailing list