Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to set max ppsize in R?

Tags:

r

I am experiencing an error in R that says:

> Error: protect(): protection stack overflow

I have learned through googling that I need to increase:

> --max-ppsize

R-manual:Memory

This can only be set when starting R so I write the following in the command prompt:

C:\Program Files\RStudio\bin\rstudio.exe --max-ppsize=5000000

The error still occurs. I am running a 1500R x 26000C dataset.

How do I solve this problem?


Edit:

The problem occurs in a standard SVM() function, where I pass a dataset of the size 600R x 26.000C. It does not happen when the dataset is 600R x 12.000C.

> model <- svm(TARGET ~ ., data = ds, type = "C-classification", kernel "linear", scale = TRUE, cost = c, cross = k)
like image 942
Kasper Christensen Avatar asked Feb 25 '15 20:02

Kasper Christensen


2 Answers

I found a similar problem and that the actual issue was related to expansion of formulas into a model matrix. If you can get the data into that format without using formulas and then use the overload in the svm command (like many other models) that takes an X and y value instead, your probably may go away like mine did.

like image 137
Eric Czech Avatar answered Oct 01 '22 05:10

Eric Czech


My way to fix a problem similar to yours:

  1. in the command-line, cd into the location of R progranm (e.g. C:\Program Files\R\R-3.1.3\bin\x64)
  2. in the command-line, Rgui.exe --max-ppsize=500000
  3. in the new open Rgui.exe, options("expressions"=20000)

Do the coding... NO original Error for me!!

like image 31
Hsiao-Pei Lu Avatar answered Oct 01 '22 03:10

Hsiao-Pei Lu