R Language.

R language.


Origin:

R is an programming language used for statistical computing. It is developed by Ross Ihaka and Robert Gentleman. It is named as R because of the two developers name starts with R. It's initial release was 1995. It is implemented from S language. 



Purpose of R:

R language is used for statistical and graphical techniques. It is used in advanced analytics, predictive analysis, data mining, data science and so on.



Advantages:

Open source environment .Help to analyse the data in graphical representation. Highly used for statistical computing. When you see the data in graphical manner you can able to explore more and more about the particular data. Easy to use packages. Highly used in data science purposes.


Basic syntax and programs for R Language.

1.Basic arithmetic operation.

program:

Addition



a=1

b=2

c= a +



b

print(c)

output:

3


Subtraction:

a=10

b=5

c= a - b

print(c)

Output:

5

Multiplication:

a=7

b=11

c= a * b

print(c)

Output:

77

Division:

a= 10

b= 5

c= 2


Basic Data Type

Integer.

Double.

Boolean.

Complex.

Character.


Before going deep into data types ,we must know that in R language the values given may be integer or may be float but the program will take as double (float).

Eg:



In this example you can see the value of a is 77(integer)

But while running the program it will gives as double.

so from this we came to know that the values may be integer or float ,

R language will take as float(double).







Integer

So , to make the program know that , the value given is an integer.

For that we need a letter 'L' , buy giving this letter the program will know that the given value is an integer.


In this example we have used L for making the program to know that the given value is an integer.









Float




Here we have used an float value in this program.

so we have got the output as double.








Complex 


Here we have used complex values to implement in R language.




Character

In this example we have used an alphabet as a value. But we have used the value inside the double quotations. So that the program will come to know that the given value is an character.


We can use a group of character as a value.

Eg:

name , place ,etc..






Boolean

Here we can the outputs as logical as we are using the true and false as the value. 











Relational Operators

> Greater than
< Less than
== Equal
!=
>= Greater than or Equal
<= Less than or Equal


> Greater than



Comparing two values and checking which is greater.
















<Less than



Comparing two values and verifying which is smaller.














==Equal


comparing whether the two values are equal.

















!=



Comparing whether the both values are equal or not.




















<=Greater than or Equal



Comparing two values whether the first value is greater than or equal to other.
















>=Lesser than or Equal


Comparing whether the first value is lesser than or equal to the other.















content: Education




Comments

Post a Comment

Popular posts from this blog

How to install R language and R studio in windows 10.

How does an IPL Player earn?