R vs. Python

R and Python are major programming languages in the world of data science and both happen to be open-sourced (i.e. not proprietary and free to use). But which one should you used? As always, there is no clear cut answer but hopefully after reading this you will have a better idea of which one to pick.

Python

Python is object-oriented programming (OOP) language. What does this mean? This means that we are manipulating data (i.e. objects) rather than the logic around the data. Other languages that fall under this categorization are Java, C++, etc. However, unlike Java, Python’s syntax is much more simple. Additionally, while Python is open-sourced, it takes the approach that all functionality is built in to begin with. In terms of interface, Python is often run through the command line, but you can write in Jupyter notebooks or use the software PyCharm if you prefer that interface instead.

There is a high demand in industry for python in areas of web development, AI and Machine learning, etc due to the fact that python is more focused on deployment and production. Learning this language allows you to be a very attractive employee to industry. If you are interested in getting a job in programming in Python then you should learn the syntax, common modules (i.e. numpy), differences between Python 2 and 3, and uses of python in industry.

R

Unlike python, R is not an object-oriented programming but a procedural language (that being said, there are packages you can use though in R to do object oriented programming). R can be hard to learn at first though for people not familiar with programming. However it has an extensive and active online community, and a wide variety of packages. The main interface used for R is RStudio and allows easy viewing of data and variables. Additionally, R (and by extension R Shiny) is great at making visualizations.

R focuses on data analysis and statistics, and while certainly used in industry, is perhaps not valued as highly Python. R tends to be more favored in academia or research and development.

Conclusion

So which one should you learn? While you can accomplish many of the same things in both languages, I would recommend learning both. Why?

R (via RStudio) allows easy navigation of data and has a strong selection of data visualization packages, making it a strong workhorse of research and development.

Python has a wide variety of applications in industry and an important component of production based work.

Like any other skill, you should develop your programming languages and keep up on developments. If you don’t have the opportunity to learn a language via your current job, then take the time to develop it on you own. It will pay dividends later on in your career.