Sunday, 7 October 2018

Basics of Calculations_Calculator_Built in Function Assignments

Integer Division %/%

Integer Division :  Division in which the fractional part (remainder) is discarded

> c (2, 3, 5, 7)  % / %  c(2,3)

[1]  1  1  2  2



Modulo Division (x mod y)  %%:

x mod y : modulo operation finds the remainder after division of one number by another

> c (2,3,5,7)  %% 2
  [1]  0  1  1  1



Maximum: max



Maximum: min




Overview Over Further Functions



Example :

> abs ( -4)
  [1] 4

> abs (c(-1, -2, -3, 4, 5) )
 [1]  1  2  3  4  5
> sqrt (4)
  [1]  2

> sqrt ( c(4,9,16,25) )
  [1]  2  3  4  5

 
 > sum (c(2,3,5,7) )
  [1]  17

> prod ( c( 2,3,5,7) )
  [1]   20

> round  (1.23)
  [1]  1

> round (1.83)
  [1]  2



Assignments

Assignments can be made in two ways:

>  x<-6
>  x
    [1]   6

> mode(x)
  [1]  "numeric"

> x=8
> x
   [1]   8

>  mode (x)
    [1]  "numeric"


An assignments can also be used to save values in variables:

>  x1  <-  c(1,2,3,4)

>  x2  <-  x1^2

>  x2
  [1]  1  4  9  16

ATTENTION: R is case sensitive (X is not the same as x

0 Comments:

Post a Comment

Popular Posts

Categories

AI (32) Android (24) AngularJS (1) Assembly Language (2) aws (17) Azure (7) BI (10) book (4) Books (146) C (77) C# (12) C++ (82) Course (67) Coursera (198) Cybersecurity (24) data management (11) Data Science (106) Data Strucures (8) Deep Learning (13) Django (14) Downloads (3) edx (2) Engineering (14) Excel (13) Factorial (1) Finance (6) flask (3) flutter (1) FPL (17) Google (21) Hadoop (3) HTML&CSS (47) IBM (25) IoT (1) IS (25) Java (93) Leet Code (4) Machine Learning (46) Meta (18) MICHIGAN (5) microsoft (4) Nvidia (1) Pandas (3) PHP (20) Projects (29) Python (888) Python Coding Challenge (285) Questions (2) R (70) React (6) Scripting (1) security (3) Selenium Webdriver (2) Software (17) SQL (42) UX Research (1) web application (8)

Followers

Person climbing a staircase. Learn Data Science from Scratch: online program with 21 courses