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.
We can use a group of character as a value.
Eg:
name , place ,etc..
🔥👍
ReplyDelete