I want to make a function that imports data in different numbers of batches depending on how much RAM is available on someone’s system. But how can I find the amount of available RAM in R? I can use memory.size() but that only works for Windows.
I want to make a function that imports data in different numbers of batches
Share
Given the warnings concerning platform-dependency discussed in the earlier comment, you could for example parse
/proc/meminfoon Linux:You could try the second approach via
system(..., intern=TRUE), or even via a pipe connection.Edit some 5+ years later: In R, and just following what the previous paragraph hinted at: