title: How to solve 'protection stack overflow' issue in R Studio
body: <p>I'm trying to build a model with the glmnet package, but I'm getting the following error when I run the following line:</p>
  
  <pre><code>#library('glmnet')
  x = model.matrix(response ~ ., data = acgh_frame[,c(3:ncol(acgh_frame))])
  
  Error: protect(): protection stack overflow
  </code></pre>
  
  <p>I know this is due to my large number of variables (26k+) in the dataframe. When I use fewer variables the error doesn't show. I know how to solve this in command line R, but I require to stay in R studio, so I want to fix it from R Studio.
  So, how do I do this?</p>