. .
2011-Aug-31 02:08 UTC
[R] Error: evaluation nested too deeply: infinite recursion / options(expressions=)?
Hi all, Why I am getting, Error: evaluation nested too deeply: infinite recursion / options(expressions=)? Thanks in advance! func <- Vectorize(function(x, a, sad, trunc=0, ...) { result <- function(x) { f1 <- function(n) { dcom <- paste("d", deparse(substitute(sad)), sep="") dots <- c(as.name("n"), list(...)) f <- do.call(dcom, dots) g <- dpois(x,a*n) f * g } integrate(f1, 0, Inf)$value } return(result(x) / (1 - result(trunc))) }, "x") func(1, 0.1, exp)
Jim Holtman
2011-Aug-31 03:21 UTC
[R] Error: evaluation nested too deeply: infinite recursion / options(expressions=)?
get a 'traceback' at the point of the error to see how deep the stack is and what is being called. Also look at the help page for 'options' to see how to get the browser when an error ocurs; this is under 'error' on the help page. also lookup debugging under R so that you can do this yourself. the error indicates you have probably an infinite recursive call that you have to track down. Sent from my iPad On Aug 30, 2011, at 22:08, ". ." <xkziloj at gmail.com> wrote:> Hi all, > > Why I am getting, > > Error: evaluation nested too deeply: infinite recursion / options(expressions=)? > > Thanks in advance! > > func <- Vectorize(function(x, a, sad, trunc=0, ...) { > result <- function(x) { > f1 <- function(n) { > dcom <- paste("d", deparse(substitute(sad)), sep="") > dots <- c(as.name("n"), list(...)) > f <- do.call(dcom, dots) > g <- dpois(x,a*n) > f * g > } > integrate(f1, 0, Inf)$value > } > return(result(x) / (1 - result(trunc))) > }, "x") > > func(1, 0.1, exp) > > ______________________________________________ > R-help at r-project.org mailing list > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide http://www.R-project.org/posting-guide.html > and provide commented, minimal, self-contained, reproducible code.
Patrick Connolly
2011-Aug-31 09:06 UTC
[R] Error: evaluation nested too deeply: infinite recursion / options(expressions=)?
. . -- .- -.-- -... . ... --- -- . .-. . .--. .-. --- -.. ..- -.-. .- -... .-.. . -.-. --- -.. . .-- --- ..- .-.. -.. .... . .-.. .--. ..- ... .- -. ... .-- . .-. -.-- --- ..- .-. --.- ..- . ... - .. --- -. ... - --- .--. .- .--. --- .-.. --- --. .. . ... ..-. --- .-. -- -.-- .-. ..- ... - -.-- -- --- .-. ... . -.-. --- -.. . ... - --- .--. On Tue, 30-Aug-2011 at 11:08PM -0300, . . wrote: |> Hi all, |> |> Why I am getting, |> |> Error: evaluation nested too deeply: infinite recursion / options(expressions=)? |> |> Thanks in advance! |> |> func <- Vectorize(function(x, a, sad, trunc=0, ...) { |> result <- function(x) { |> f1 <- function(n) { |> dcom <- paste("d", deparse(substitute(sad)), sep="") |> dots <- c(as.name("n"), list(...)) |> f <- do.call(dcom, dots) |> g <- dpois(x,a*n) |> f * g |> } |> integrate(f1, 0, Inf)$value |> } |> return(result(x) / (1 - result(trunc))) |> }, "x") |> |> func(1, 0.1, exp) |> |> ______________________________________________ |> R-help at r-project.org mailing list |> https://stat.ethz.ch/mailman/listinfo/r-help |> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html |> and provide commented, minimal, self-contained, reproducible code. -- ~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~. ___ Patrick Connolly {~._.~} Great minds discuss ideas _( Y )_ Average minds discuss events (:_~*~_:) Small minds discuss people (_)-(_) ..... Eleanor Roosevelt ~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.
Reasonably Related Threads
- Recall function: "evaluation nested too deeply: infinite recursion / options(expressions=)?"
- Error: evaluation nested too deeply: infinite recursion / options(expressions=)?
- Fwd: Recall function: "evaluation nested too deeply: infinite recursion / options(expressions=)?"
- evaluation is nested too deeply: infinite recursion?
- 'R CMD check' fails with "evaluation nested too deeply: infinite recursion"