protect(): protection stack overflow

Published by onesixx on

> dd %>% dim
[1]    12 39319

to change the data from data.frame to matrix form.


You probably have to set –max-ppsize See You’ll also find some discussions about this on StackOverflow. See for instance   ================================ ‘memory.limit’ function recommended by Maurizio may work for some users, but it is Windows-specific, and thus will not work for UNIX-like systems. For UNIX or Linux systems, we will want to set the $R_MAX_VSIZE environmental variable prior to running RStudio or R from the cli. See the following thread for more info on solving this problem:   Another option to for UNIX/Linux users to try when they get the protect error is the ‘options’ expressions setting, e.g.:   options(expressions = 5e5)   as recommended at the following URL:   Additionally, ‘–max-ppsize’ controls the maximum size of the protection stack, as per the Memory entry in the manual, at the following URL:   ==================================================================================  

ranger(formula = NULL, data = NULL, num.trees = 500, mtry = NULL,
  importance = "none", write.forest = TRUE, probability = FALSE,
  min.node.size = NULL, replace = TRUE, sample.fraction = ifelse(replace,
  1, 0.632), case.weights = NULL, class.weights = NULL, splitrule = NULL,
  num.random.splits = 1, alpha = 0.5, minprop = 0.1, = NULL, always.split.variables = NULL,
  respect.unordered.factors = NULL, scale.permutation.importance = FALSE,
  keep.inbag = FALSE, holdout = FALSE, quantreg = FALSE,
  num.threads = NULL, save.memory = FALSE, verbose = TRUE, seed = NULL, = NULL, = NULL,
  classification = NULL)



Object of class formula or characterdescribing the model to fit. Interaction terms supported only for numerical variables.


Training data of class data.frame, matrix, dgCMatrix (Matrix) or

Coercion of matrix to sparse matrix (dgCMatrix) and maintaining dimnames.

iris_sparse <- Matrix(data.matrix(iris), sparse = TRUE)
ranger(data = iris_sparse, = "Species", classification = TRUE)






Categories: R Basic


Blog Owner

Leave a Reply

Your email address will not be published.