Is there a way for an R program to obtain the size of the machine's memory, when running on Linux?
In Windows the function to use is memory.size(), but when I run this on Linux it generates an error.
I can run system('free')
, and this will produce a nice display, but the return value is 0, indicating, I suppose, success... but nothing about the size of memory.
Note: The goal is for an R script to obtain, and use, the total size of a machine's memory. Printing memory info to the terminal, using system()
, is not useful.