You are on page 1of 24

School of Computing

Science and Engineering

Program: B.Tech Specialization


Course Code: BCSE3092
Course Name: Data Science
School of Computing Science and Engineering
Course
ourse Code
Code :: BCSE3092
BCSE3092 Course
Course Name:
Name: Data
Data Science
Science

Course Outcomes :
• CO1 To acquire good introducing knowledge of the essentials in
Statistical
Fundamentals used in Data science.(K1)
• CO2 Develop an ability to apply algorithmic principles and Programing
knowledge
using Python and R language on Data Science .(K2,K3)
• CO3 Develop ability to visualise the data for Analysis. (K4)
• CO4 Apply and Implement ML principles using Probability and Statistics
(K5)
• CO5 Understating and Recommending statistics and Machine learning
solutions (K6)
• CO6 Gaining Research insights and latest solutions provided by
researchers(K6)
Program Name: BCSE3029 Program Code: Data Science
School of Computing Science and Engineering
Course Code : BCSE3092 Course Name: Data Science

Course Prerequisites

• PYTHON BASICS
• STATISTICS
• LINEAR ALGEBRA

Program Name: BCSE3029 Program Code: Data Science


School of Computing Science and Engineering
Course Code : BCSE3092 Course Name: Data Science

Syllabus

Program Name: BCSE3029 Program Code: Data Science


School
School of
of Computing
Computing Science
Science and
and Engineering
Engineering
C
Course
ourse Code
Code :: BCSE3092
BCSE3092 Course
Course Name:
Name: Data
Data Science
Science

Recommended Books
Text books

Reference Book

Program Name: BCSE3029 Program Code: Data Science


R operators
• R has several operators to perform tasks
including arithmetic, logical and bitwise
operations
• R Arithmetic Operators
• These operators are used to carry out
mathematical operations like addition and
multiplication. Here is a list of arithmetic
operators available in R.
Arithmetic Operators in R

Operator Description

+ Addition
– Subtraction
* Multiplication
/ Division
^ Exponent

%% Modulus (Remainder from division)

%/% Integer Division


• R Relational Operators
• Relational operators are used to compare
between values. Here is a list of relational
operators available in R.
Relational Operators in R

Operator Description

< Less than

> Greater than

<= Less than or equal to

>= Greater than or equal to

== Equal to

!= Not equal to
• The above mentioned operators work on vectors. The
variables used above were in fact single element vectors.

• We can use the c() [as in concatenate] to make vectors in R

• When there is a mismatch in length (number of elements)


of operand vectors, the elements in shorter one is recycled
in a cyclic manner to match the length of the longer one.

• R will issue a warning if the length of the longer vector is


not an integral multiple of the shorter vector.
R Logical operators
Logical operators are used to carry out Boolean
operations like AND , OR etc.
Logical Operators in R

Operator Description

! Logical NOT

& Element-wise logical AND

&& Logical AND

| Element-wise logical OR

|| Logical OR
• R Assignment Operators
• These operators are used to assign values to
variables.
Assignment Operators in R

Operator Description

<-, <<-, = Leftwards assignment

->, ->> Rightwards assignment


• The operators <- and = can be used, almost
interchangeably, to assign to variable in the
same environment.

• The <<- operator is used for assigning to


variables in the parent environments .
• The rightward assignments, although available
are rarely used.
Operator Precedence

• When multiple operators are used in a single


expression, we need to know the precedence
of these operators to figure out the sequence
of operation that will take place.
• Precedence defines the order of execution,
i.e., which operator gets the higher priority.
Operator Associativity

• t is possible to have multiple operators of


same precedence in an expression. In such
case the order of execution is determined
through associativity.
Operator Precedence in R

Operator Description Associativity

^ Exponent Right to Left

-x, +x Unary minus, Unary plus Left to Right

%% Modulus Left to Right

*, / Multiplication, Division Left to Right

+, – Addition, Subtraction Left to Right

<, >, <=, >=, ==, != Comparisions Left to Right

! Logical NOT Left to Right

&, && Logical AND Left to Right

|, || Logical OR Left to Right

->, ->> Rightward assignment Left to Right

<-, <<- Leftward assignment Right to Left

= Leftward assignment Right to Left


R if statement

The syntax of if statement is:


If ( test condition)
{
Statement
}
• R for Loop
Loops are used in programming to repeat a
specific block of code. In this article, you will
learn to create a for loop in R programming.

You might also like