[Rd] Very Long Expressions

Barry Rowlingson B.Rowlingson at lancaster.ac.uk
Mon Jan 24 11:31:26 CET 2005


McGehee, Robert wrote:

>>eval(parse(text = paste(rep(1, 498), collapse = "+")))
> 
> [1] 498
> 
> However, if we try this with 499+ items we get no answer:
> 
>>a <- eval(parse(text = paste(rep(1, 499), collapse = "+")))
>>a
> 
> Error: Object "a" not found
> 
> And if this eval is passed to any other function, that function exits
> without error and without returning and object.

  Suggest you downgrade to R 1.8.1, which returns an error message:

  > eval(parse(text = paste(rep(1, 498), collapse = "+")))
  [1] 498

  > a=eval(parse(text = paste(rep(1, 499), collapse = "+")))
  Error in eval(expr, envir, enclos) : evaluation is nested too deeply: 
  infinite recursion?

  I dont have an R 1.9.x handy at the moment.

  Baz



More information about the R-devel mailing list