0

I'm constantly running into a problem with a function from the R package ctmm. If I try running the example code from the package helpfile I get the error message

Error: C stack usage 7969420 is too close to the limit

If I then try to increase C stack limits and rerun the code, the error message turns into

Error: evaluation nested too deeply: infinite recursion / options(expressions=)?

Setting option(expressions=50000) leads to yet another error message:

Error: protect(): protection stack overflow

Is there something I can do about it? I'm not able to solve that problem. Can somebody help? Funny thing is, I'm in a course with ~30 people, all running through the code on various machines without problems, so I don't think the problem is within the code...

So, the example code would be:

# Load package and data
library(ctmm)
data(buffalo)
cilla <- buffalo[[1]]

# Fit a continuous-velocity model with tau ~ c(10 days,1 hour)
# also see help(variogram.fit)
GUESS <- ctmm(tau=c(10*24*60^2,60^2))
FIT <- ctmm.fit(cilla,GUESS)

and then the error messages appear.

sessionInfo gives:

R version 3.3.2 (2016-10-31)
Platform: x86_64-apple-darwin13.4.0 (64-bit)
Running under: OS X El Capitan 10.11.6

locale:
[1] de_DE.UTF-8/de_DE.UTF-8/de_DE.UTF-8/C/de_DE.UTF-8/de_DE.UTF-8

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base     

other attached packages:
[1] ctmm_0.3.4

loaded via a namespace (and not attached):
[1] tools_3.3.2     sp_1.2-3        Rcpp_0.12.5     raster_2.5-8    grid_3.3.2     
[6] lattice_0.20-34
Laura
  • 33
  • 3
  • 2
    This [post](http://stackoverflow.com/questions/14719349/error-c-stack-usage-is-too-close-to-the-limit) may be of help – akrun Dec 14 '16 at 08:38
  • Infinite/very deep recursion is one thing which could cause a stack overflow. You should inspect your code to see if infinite recursion is happening, or something else which could be overflowing the stack. – Tim Biegeleisen Dec 14 '16 at 08:39
  • so I tried setting options(expressions=50000) after increasing the limits via ulimit -s to 16384. Now the error message says Error: protect(): protection stack overflow Is there something I can do about that? The code should be fine, shouldn't it? It runs on 29 other machines in this room, just not in mine... What else could cause the overflowing? (Sorry, I'm not a computational expert...) – Laura Dec 14 '16 at 08:55

0 Answers0