Table of contents
No headings in the article.
I recently started learning the R language because I am a Data Science enthusiast and I wanted to start my Data Science Journey. So, for that R Language was one of the best to start from.
So, for those who don’t know what is R Language. R is a programming language that is designed and made for statistical computing and graphical computing. It’s made by R Code Team and The R Foundation for Statistical Computing. It is designed by Ross Ihaka and Robert Gentleman.
As of now, it’s been 1 week learning R and I am using R studio for this. I have considerable skills in Python and MySQL. I also know a little bit about C and CPP. So, for me, R looks fairly similar to Python with a little bit of touch of C/CPP. Like most of the syntaxes (basics ones) are similar to Python-like for example print(“XYZ”) it’s the same in Python and R.
If you go to if-else and for-while loops in R, you can see that it has some similarities with C/CPP. Like, in C/CPP we use ' { } ' for pretty much-writing everything. In R also, we use ' { } ' just like C/CPP for writing something in the if-else function and in for-while loops which are unlike python where we use ' : '.
Simple If Else code in Python -
a=int(input())
b=int(input())
if a>b:
print(a," greater than ",b)
else:
print(b," greater than ",a)
Simple If Else code in R -
{
a = as.integer(readline())
b = as.integer(readline())
if(a>b){
print(paste0(a , " greater than ", b))
}else{
print(paste0(b ," greater than ", a))
}
}
And, since it’s different programming, it has its many unique elements of it too.
Apart from this using R Studio makes it very organized to code. In RStudio, you get 4 windows. One is a script (you have to open it though), another one is Console, then there's Environment window and then there are those files sections where you can see your files and plots, etc.
I think knowing Python (Specially) and C/CPP makes it R pretty easy to learn.
What do you people feel about this, tell me about your first experience with R in the comments? Have a great day/night ahead.