Right upfront: this is an issue I encountered when submitting an R package to CRAN. So I
- dont have control of the stack size (as the issue occured on one of CRANs platforms)
- I cant provide a reproducible example (as I dont know the exact configurations on CRAN)
Problem
When trying to submit the cSEM.DGP package to CRAN the automatic pretest failed with the NOTE: C stack usage 7975520 is too close to the limit
.
I know this is caused by a function with three arguments whose body is about 800 rows long. The function body consists of additions and multiplications of these arguments. It is the function varzeta6()
which you find here (from row 647 onwards).
How can I adress this?
Things I cant do:
- provide a reproducible example (at least I would not know how)
- change the stack size
Things I am thinking of:
- try to break the function into smaller pieces. But I dont know how to best do that.
- somehow precompile? the function (to be honest, I am just guessing) so CRAN doesnt complain?
Let me know your ideas!