0% found this document useful (0 votes)
0 views12 pages

R Programming Experment For Data Science

The document provides a step-by-step guide for installing R programming on Windows and Linux operating systems. It includes detailed instructions on downloading the installer, running it, adding R to the PATH environment variable, and verifying the installation. Additionally, it explains how to run R using the command prompt or R GUI and how to create and execute R script files.

Uploaded by

morasanjana2058
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
0 views12 pages

R Programming Experment For Data Science

The document provides a step-by-step guide for installing R programming on Windows and Linux operating systems. It includes detailed instructions on downloading the installer, running it, adding R to the PATH environment variable, and verifying the installation. Additionally, it explains how to run R using the command prompt or R GUI and how to create and execute R script files.

Uploaded by

morasanjana2058
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 12

Experiment 1

Download and install R- Programming environment and install basic packages using install. Packages
() command in R.

R programming is a very popular language and to work on that we have to install RGui.

Installing R to the local computer is very easy. First, we must know which operating system we are using
so that we can download it accordingly.

The official site https://cloud.r-project.org provides installer files for major operating systems including
Windows, Linux, and Mac OS.

Install R in Windows:

To install R on your Windows, just follow these steps:

1. Download the R Installer File

2. Run the Installer

3. Install R

4. Add R to the PATH Environment Variable Manually

5. Verify the Installation

Step 1: Download the R Installer File

Go to the official R Project website (https://cloud.r-project.org) and download the latest version of R
for Windows.

To proceed, please click the link labelled “Download R for Windows”.


To proceed, please click the link labelled "install R for the first time."

To proceed, click the link labelled Download R-4.4.2 for Windows. Subsequently, the R Installer File
will begin to download.

Step 2: Run the Installer

Open your downloads folder and double-click on the R installer file that you just downloaded.

You may be required to grant access based on your security configurations. Please permit it and
continue.

Step 3: Install R

After executing the installer, you will encounter this screen.


Select your desired language. (Here English) and click on OK button.

And then click on Next button to accept licenses agreements,

You will be prompted to specify the installation directory. The default location is C:\Program Files\R\.
You may retain this setting and continue with the installation by clicking on Next button.
The installer will then prompt you to choose components and where to place shortcuts. Click Next

button to continue installation.

Select Start-up options, then click Next button.


Select Start Menu Folder, then click Next button.

Select Additional Tasks, then click Next button.


Setup has finished installing R for Windows 4.4.2. Click Finish to exit the installer.
Step 4: Add R to the PATH Environment Variable Manually

It is essential to manually set that the PATH environment variable of your system is configured properly.
To add the PATH environment variable, please follow these steps.

 Copy the path where R is installed to the bin folder. (Usually, it is in C:\Program Files\R\R-
4.4.2\bin)

 Right-click on This PC and select Properties.

 Click on Advanced System Settings and then Environment Variables.

 Under User and System Variables sections, find and select Path, then click Edit.

 Click New and paste the path.

Click OK to close all dialogs and apply the changes.

Step 5: Verify the Installation

After the installation is finished, you can confirm that R has been installed correctly by opening a
command prompt (cmd) and entering the following command:

R --version
Install R in Linux (Ubuntu):

Installing R on Linux is as simple as following three steps.

Step 1:

In the initial step, it is essential to update all necessary files within our system by executing the
command sudo apt-get update.

Step 2:

In the second step, we will proceed to install the R programming language on our system by utilizing
the command sudo apt-get install r-base.

Step 3:

In the final step, we need to type R and hit enter to start using the R editor.

Running R:

After installing R in our system, there are several ways to work with R.

 Using command prompt

To start the R command prompt, just type R in the Windows command prompt. After pressing enter,
the interpreter will open, and you will see a prompt where you can write your code.
 Using R Gui app

To start working with R, open the R 4.4.2 app from the Start Menu. Your screen will then appear as
shown below.

R Script File:

The R script file is another method to write our programs (set of instructions).

To create an R Script file, just open a text editor and type in your code. After that, save the file with a .R
extension.

We can run these scripts from the command prompt using the R interpreter called Rscript.

Syntax: Rscript filename. R

Example:

To start, Open Notepad, type the code, and save the file as first.R, as shown below.
Next, Open the command prompt from your current location and enter the following command
to execute the R script file.

Rscript first.R

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy