Is there an R function to retrieve CPU and RAM information?
Asked Answered
P

1

5

I want to print some hardware info in my R session. I can achieve this by using the system() function, which in my Linux machine looks like this:

> system("lscpu | grep 'Model name:'")
Model name:          Intel(R) Core(TM) i7-8700 CPU @ 3.20GHz
> system("lsmem | grep 'Total online memory'")
Total online memory:      16G

I know R has functions like Sys.info() to provide this kind of data, but I couldn't find such a function that allows one to print CPU and RAM info.

I would really like to find one such function, as relying on system() is OS-dependent.

Pederast answered 20/3, 2020 at 13:58 Comment(0)
T
10

The benchmarkme package has a couple of functions you may find useful, like get_cpu() and get_ram().

Thadthaddaus answered 20/3, 2020 at 14:20 Comment(1)
That's helpful, thanks! Now I just need to decide if I'm OK with adding a package to my workflow here.Pederast

© 2022 - 2024 — McMap. All rights reserved.