5 ms·
If I'm already productive in Python doing similar analysis, is there a good reason to switch to R?
by mechanical_bear 4y ago
If I'm already productive in Python doing similar analysis, is there a good reason to switch to R?
- mistrial9 4y agoit seems the author has something to say about that: https://github.com/matloff/R-vs.-Python-for-Data-Science https://github.com/matloff/R-vs.-Python-for-Data-Science
- mechanical_bear 4y agoThanks for that!
- notafraudster 4y agoI write code in both daily. I don't think there is a burning need to know both, but there are definitely tasks each is good at. The RStudio IDE is really quite wonderful for interactive stuff. The pipe operator (allowing left to right evaluation of function chains) makes for extremely literate code. Most of the basic statistical functions are substantially better than their Python equivalents. Many of the ways in which you use Python for data science stuff are just poor imitations of R (in particular, pandas is a take on R's data frames that is imo not as productive). In some conditions R can be faster [in others, slower]. The R package ecosystem for more off the beaten path statistical stuff is better than the Python package ecosystem (if you're doing more intense ML and CNNs, the opposite is true). If you're doing dashboards, Shiny is great. But in each case, you can basically work in either language and you'll be fine. I think it makes more sense to think of R as replacing Stata, SPSS, SAS, and to a lesser extent Matlab, rather than replacing Python. Julia is also fun.
- nojito 4y agoLess code to get the same result and r markdown is infinitely better than anything in the python ecosystem
- lmc 4y ago> And r markdown is infinitely better than anything in the python ecosystem You might want to check out Quarto [1], which i recently discovered on here [1] https://quarto.org/ https://quarto.org/
- nojito 4y agoYes! Quarto is absolutely game changing. I hope it becomes standard place in analytics.
- t_mann 4y agoPython vs R is the new Matlab vs R (and soon it may be Julia vs R). My answer is always the same: there are a few excellent and quasi-standard packages/libraries that exist in one of them without fully equivalent analogues in the others, so if you need any of those then go with that system (eg Simulink in Matlab, tons of classical statistical models in R, some ML/DL libraries in Python). In fact, you might have to use multiple systems if your problems are complex enough and you don't want to compromise. If you don't fall in that category, then just stick with what you have, any of those languages are decent enough general purpose tools and the differences don't justify a codebase migration.
- temp8964 4y agoYes. There are a few cool things only exist in R: - R Shiny - RStudio Jobs - RStudio Server - RMarkdown, Blogdown, Bookdown, etc.
- p10_user 4y agoPython is great for plumbing, R is great for new analyses. I use Python to knit Rmarkdown documents from premade templates. Of course you can achieve something similar with Jupiter notebooks. The real benefit is the perceived ability to get going with a new dataset. With respect to massaging and visualizing rectangular data, I can get much further much faster in R tidyverse than python. Just as we see python as a language that allows for rapid development with its straightforward syntax - I see R tidyverse providing a faster data analysis exploration “experience”. Tidyverse also introduced me to functional programming which I have found to be very useful for data analysis; you can very strictly separate procedures in a way I have found beneficial. (Not to say you cannot acquire this knowledge another way, however.) I remain an avid user of pandas data frames inside the python ecosystem. On more than one occasion, I have translated rapidly written tidyverse data wrangling routines into more maintainable functions in python with pandas. YMMV