title: How to increase memory limit for R on a Mac?
body: <p>I've been looking into methods to increase memory limit for R on a Mac, but haven't found anything particularly useful. I tried both <a href="https://stackoverflow.com/questions/56737430/increasing-memory-limit-in-r-for-mac">Increasing memory limit in R for Mac</a> and <a href="https://stackoverflow.com/questions/51295402/r-on-macos-error-vector-memory-exhausted-limit-reached">R on MacOS Error: vector memory exhausted (limit reached?)</a>, but neither worked.</p>
  
  <p>I'm running </p>
  
  <pre><code>fviz_nbclust(df, kmeans, method = "wss") 
  </code></pre>
  
  <p>on a set of data of 1.79m rows and 2 columns. Error says vector memory exhausted (limit reached?). I've tried <code>memory.limit()</code> but this doesn't work on a Mac.</p>
  
  <p>sessionInfo as below:</p>
  
  <pre><code>R version 3.6.1 (2019-07-05)
  Platform: x86_64-apple-darwin15.6.0 (64-bit)
  Running under: macOS Sierra 10.12.6
  
  Matrix products: default
  BLAS:   /Library/Frameworks/R.framework/Versions/3.6/Resources/lib/libRblas.0.dylib
  LAPACK: /Library/Frameworks/R.framework/Versions/3.6/Resources/lib/libRlapack.dylib
  
  locale:
  [1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8
  
  attached base packages:
  [1] stats     graphics  grDevices utils     datasets  methods   base     
  
  other attached packages:
  [1] factoextra_1.0.6 ggplot2_3.2.1   
  
  loaded via a namespace (and not attached):
   [1] ggrepel_0.8.1    Rcpp_1.0.3       withr_2.1.2      assertthat_0.2.1
   [5] crayon_1.3.4     dplyr_0.8.3      grid_3.6.1       R6_2.4.1        
   [9] lifecycle_0.1.0  gtable_0.3.0     magrittr_1.5     scales_1.1.0    
  [13] pillar_1.4.2     rlang_0.4.1      lazyeval_0.2.2   tools_3.6.1     
  [17] glue_1.3.1       purrr_0.3.3      munsell_0.5.0    compiler_3.6.1  
  [21] pkgconfig_2.0.3  colorspace_1.4-1 tidyselect_0.2.5 tibble_2.1.3    
  &gt; 
  </code></pre>
  
  <p>Can anyone help? Thanks!!</p>