Easy Tutorial
❮ R Line_Charts R Factor ❯

R Environment Setup

The development environment for R language inherently includes a graphical development environment, which is different from many other engineering languages. Therefore, it is best to install the development environment on an operating system designed for desktop personal computers (such as Windows, macOS, or Ubuntu Desktop Edition, etc.).

First, we need to download the installation package for the R language environment:

Windows

Linux

macOS

The versions above may be outdated. If you need the latest version, you can visit:


Windows Operating System

The installation on Windows is straightforward. After downloading the installation package, double-click the downloaded package to start the installation wizard:

Note: The operating system used here is 64-bit, but there are still a few computers using 32-bit operating systems. If your operating system is 32-bit, please select the "32-bit User Installation" option in this step.

When we enter the following code in the interactive command window:

print("Hello, world")

The output will be:

"Hello, world"

Linux

Ubuntu Installation

Execute the following commands to install the R language execution environment:

# sudo apt update
# sudo apt -y upgrade
# sudo apt -y install r-base

After successful installation, executing the R command will bring you to the interactive programming window:

CentOS Installation

# sudo yum install R

Enter the following command to check the installed version:

# R --version

The interactive command can be exited by typing q():

> q()
Save workspace image? [y/n/c]: y

macOS Installation

The installation of the R language environment on macOS is similar to Windows. Download the pkg installation package, double-click to open it, and then follow the installation wizard:

After successful installation, executing the R command will bring you to the interactive programming window:

The interactive command can be exited by typing q():

> q()
Save workspace image? [y/n/c]: y
❮ R Line_Charts R Factor ❯