[R] function is too long to keep source

Thomas Lumley tlumley at u.washington.edu
Thu Sep 4 19:21:10 CEST 2003


On Thu, 4 Sep 2003, Marcel Vieira wrote:

> Dear R users,
>
> I am trying to minimise a function using "nlm".
>
> I am getting the following error message: "Error: function is too long to
> keep source"
>
> The function is really very long (about 100 A4 pages).
>
> Is there anything I could do to solve this problem?

Assuming that the obvious solution (splitting up the function into pieces)
doesn't work you can use

   options(keep.source=FALSE)

to tell R not to store the source text in addition to the parsed code. The
only disadvantage of this is that when you list the function source inside
R there aren't any comments, but you don't want to do this with 100 pages
of code anyway.

	-thomas




More information about the R-help mailing list