get_cpu_name: Get the name of the CPU

View source: R/get_cpu_name.R

get_cpu_nameR Documentation

Get the name of the CPU

Description

This function attempts to return the name of the CPU model. See Note.

Usage

get_cpu_name()

Details

The function first detects the operating system using the Sys.info() function in R. Depending on the operating system, it uses OS-specific system commands to retrieve the CPU name:

  • Windows (PowerShell): ⁠(Get-WmiObject Win32_Processor).Name⁠

  • Linux: ⁠lscpu | grep "Model name:"⁠

  • macOS: ⁠sysctl -n machdep.cpu.brand_string⁠

For operating systems other than the above, it returns "Unknown CPU."

Value

A character string representing the name of the CPU.

Note

This function has only been tested in Windows 11. Users are advised to manually test this function in their specific environment to ensure it works as expected.

Examples

get_cpu_name()

dryguy/rbitr documentation built on Oct. 15, 2024, 6:18 a.m.