littleworth
littleworth

Reputation: 5169

How to make sure RStudio to incorporate changes made in .bashrc

Currently in my RStudio I ran this code with this error:

> library(gtools)
> nrow(combinations(n=448,r=2,v=1:448,repeats.allowed=F))
Error: C stack usage  7971524 is too close to the limit

What I did, is I add this line

ulimit -s 16384

in my bashrc.

The R code above runs ok if I execute it with R console in my terminal. But it still gives an error when I run it RStudio console.

How can I fix the issue?

Upvotes: 4

Views: 488

Answers (1)

Tom Lime
Tom Lime

Reputation: 1204

Adding ulimit -s 16384 to .bashrc will only affect commands executed from bash shell. Like execution of R console from terminal (in same way you can execute RStudio from bash and it will work).

To apply ulimit -s 16384 to a whole login session:

  • add changes to /etc/security/limits.conf file.
*            soft    stack           16384                                   
*            hard    stack           16384
  • logout/login to apply.
  • run RStudio as usual and check.

Upvotes: 4

Related Questions