I'm trying to use the spread()
function from the tidyr
package in R on a dataframe that has about three million observations. It's returning the following error message:
Error : C stack usage 26498106 is too close to the limit
When I run Cstack_info()
, it tells me
> Cstack_info()
size current direction eval_depth
7969177 15272 1 2
Following the advice in the answer to this question, I've tried increasing the stack size by running ulimit -s 32768
in a terminal window and opening Rstudio from the terminal. When I try this, however, the output of Cstack_info()
is unchanged, and when I run my code, I get the same error message. Following another answer to the same earlier question I've tried updating R and Rstudio, also to no avail. What am I doing wrong here?
I am running R 3.3 on mac os x 10.12.2 with 16 GB of memory.