[R] Maximum No.of code in R

Duncan Murdoch murdoch at stats.uwo.ca
Fri Sep 18 13:51:45 CEST 2009


On 9/18/2009 5:49 AM, premmad wrote:
> I tried running 50 lines of ifelse statement in R and the system says context
> stack overflow at 50 line.Is it the limitation of R or is there any way
> around that can be done to overcome this.Thanks

You can always break it up into multiple lines.  For example, the 
following are equivalent if we ignore the presence of the temp variable 
in the second case.

x <- ifelse(a, b, ifelse(c, d, e))

and

temp <- ifelse(c, d, e)
x <- ifelse(a, b, temp)

Duncan Murdoch




More information about the R-help mailing list