+ 1

Is R similar to Python /CPython Yes /No. Please give explanation in this regards?

Asker :,.

8th Aug 2018, 7:22 AM
Asim Farheen
Asim Farheen - avatar
2 Answers
+ 3
R and python not a similar. Major differences. Everything in R is a vector and you don’t usually have to worry about loops. The Zen of Python is that there’s one proper way to do something. This is just not the case with R. Indexing in R is quite intuitive for Excel people and quite horrible for anyone with Computer Science background: Indexing starts at 1: X[1] selects the first element of X. In Python, that would return the second element, because indexing starts at 0. Sub-setting is performed with the exact range that you specify: in R, X[2:3] will select the second and the third element of X. In contrast, in Python that will return the third element only. Sub-setting with a negative index excludes these indices from the range. That way, X[-2] will return all elements except the second one. In Python, it will return the element before the last one. Indention - R is kind enough to use curly braces; That is the number 1 thing in Python that still wakes me up at night, screaming.
8th Aug 2018, 7:47 AM
Maninder $ingh
Maninder $ingh - avatar
0
There is an introduction to R on SoloLearn now. Take a look and you'll see that R has some similarities, but is very different from Python
8th Aug 2018, 11:01 AM
Chris
Chris - avatar