0% found this document useful (0 votes)
0 views

Chapter_1_R programming for beginners

The document is a guide for beginners in R programming, covering its overview, features, and functionalities. It includes sections on getting started, data types, reading and writing data, control structures, and functions. It also highlights the importance of CRAN for R packages and introduces RStudio as a helpful IDE for R development.

Uploaded by

hypergenome76
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
0 views

Chapter_1_R programming for beginners

The document is a guide for beginners in R programming, covering its overview, features, and functionalities. It includes sections on getting started, data types, reading and writing data, control structures, and functions. It also highlights the importance of CRAN for R packages and introduces RStudio as a helpful IDE for R development.

Uploaded by

hypergenome76
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 7

R PROGRAMMING FOR

BEGINNERS

Eduonix Learning Solutions

Better Learning Everday

Eduonix Learning Solutions Pvt Ltd


R PROGRAMMING GUIDE

Contents

Pg No Section

01 Overview of R

06 Getting started with R

12 R Objects or Data Types

19 Reading and Writing Data

25 Control Structures

34 Functions

Eduonix Learning Solutions Pvt Ltd


R PROGRAMMING GUIDE

1. Overview of R
R is considered as a renowned programming language and software
environment for statistical analysis and graphics representation with
reporting functionality. R was invented by Ross Ihaka and Robert Gentleman
at the University of Auckland, New Zealand. Now the complete activities is
developed by the R development core team.
The main features of R is mentioned below:

1. Effective programming language:


R is a well-developed, simple and effective programming language which
defines conditionals, loops, user defined recursive functions which defines
input and output facilities.

2. Graphical Tools:
It includes graphical facilities for data which is core part of data science. It
includes various visualization tools which helps in better understanding of
data.

3. Mathematical Operations:
R includes various statistical tools which well defines the mathematical
operations in a very systematic way. It includes set of operations for arrays,
lists, vectors and matrices.

4. Data Handling:
R includes effective data handling and storage facility. The data handling
features includes handling various types of files

The following URL refers to the official website of R programming language is:

https://www.r-project.org/about.html

Page 01 Eduonix Learning Solutions Pvt Ltd


R PROGRAMMING GUIDE

CRAN Packages
CRAN is known as “The Comprehensive R Archive Network” is the main
repository for R packages. The main advantage of getting your package on
CRAN is that it can be easy for users to install with function “install.packages”.
Your package will also be daily tested on multiple systems.
CRAN now has 10,000 R packages. This can be considered as main purpose for
all developer or community clan. CRAN is considered as a global repository of
open-source packages that extend the capabilities of R, reached a milestone
today. It includes more than 10,000 R packages available for download.
R programming language has a feature of mirror server which is replica of
contents of the main server. These mirror servers reduce the load on one
server by having multiple synced copies. The user usually opts for mirror
(server) when there is low latency for faster downloads.

The various links of download for the mentioned CRAN package is mentioned
below:

https://ftp.iitm.ac.in/cran/

Page 02 Eduonix Learning Solutions Pvt Ltd


R PROGRAMMING GUIDE

History of R
Ross Ihaka and Robert Gentleman are the key persons who invented R. R is
actually based on one of the older programming language known as S which
was invented way back in 1970’s. Ihaka and Gentleman focused on developing
their own programming language while working together in New Zealand. This
went to release of R.
With the release of R in the early 1990’s, several developers or programmers
joined the project to help to improve it. By 1995, the R programming became
“open-source” which means that any developer can use and modify it for
themselves without any cost.

RStudio
RStudio is an R-specific IDE. The plot windows are better than the R GUI
originals, and it includes various facilities to publish the code.
The editor is more basic than either Emacs or Eclipse, but it’s good enough for
most purposes, and is easier specially in case of research activities. RStudio’s
awesome trick is that a user can run it remotely through a browser, so you can
run R on a powerful server, later you can access it from a smartphone without
loss of computational power
Download it from http://www.rstudio.org .

Page 03 Eduonix Learning Solutions Pvt Ltd


R PROGRAMMING GUIDE

The look and feel of IDE is mentioned in the snapshot below:

Starting your first R session


By now, you probably as a developer will be itching to get started on some real
code. In this section, we will focus on creating a demo program with R.
Programming books typically start with a very simple program and the first
program creates the message "Hello world!”. In R, these kinds of program
consists one line of code.
Following steps are used for first implementation of R programming language:

Page 04 Eduonix Learning Solutions Pvt Ltd


R PROGRAMMING GUIDE

Start a new R session, type the following in your console, and press Enter:
(refer to the diagram mentioned below):
> print("Hello world!")
R responds with the following output:
[1] "Hello world!"
As we explain in the beginning of this chapter, we collapse input and output
into a single block of code, which is mentioned below:
> print("Hello world!")
[1] "Hello world!"

Summary
R is a free, open source language for data science (data analysis and data
visualization).
It’s also a piece of software used to run programs written in R.
A user can download R from http://www.r-project.org.
A user can write R code in any text editor, but there are several IDEs that
make development easier.

Page 05 Eduonix Learning Solutions Pvt Ltd

You might also like