[R] Limit on Function Size

ripley@stats.ox.ac.uk ripley at stats.ox.ac.uk
Sun Sep 1 19:58:46 CEST 2002


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?

-- 
Brian D. Ripley,                  ripley at stats.ox.ac.uk
Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
University of Oxford,             Tel:  +44 1865 272861 (self)
1 South Parks Road,                     +44 1865 272860 (secr)
Oxford OX1 3TG, UK                Fax:  +44 1865 272595

-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
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