Limit RAM usage in R

I'm running some analysis and would like to fix the RAM usage on R to be able to use other software simultaneously without any problem. So I would like, for example, to limit 4GB of RAM, even making the analysis more time-consuming.

I tried this strategy available here, where you create a limit on the properties of the program, but it does not work.

I am currently working with calculating arrays of distance 62 variables x 60 thousand observations.

Another option was to use h20, but I end up using more RAM because I have to call JAVA.

Author: Joyce Maia, 2019-10-11