4 ms·
Reasons I prefer R to python: - Rmarkdown. I prefer a text document over a web notebook for exploratory research - The standard library is for statistics and
by clircle 5y ago
Reasons I prefer R to python:
- Rmarkdown. I prefer a text document over a web notebook for exploratory research
- The standard library is for statistics and data: dataframe, lm, anova, etc. are builtin
- A huge range of probability distributions are built-in. I don't need to import extra libs to do simulations.
- Between functional programming techniques and vectorization, I can write very clean and concise code
- Tidyverse and data.table are lovely and coherent approaches to data management. Data.table is fast and memory efficient.
- Advanced models are trustworthy: For example, glmnet, mgcv, nlme, rms are authored by statistical heavyweights, and have accompanying books that are excellent. I don't have the same confidence in python's statsmodels.
- CRAN is easy to use, I can access it from my R session, and there are rarely problems (big thanks to Uwe Ligges)
- Libraries for design of experiments and surveys are available. R supports the entire design -> data management -> model cycle.
- base graphics/lattice/ggplot2 are excellent for plotting. If I need something advanced, I can use grid. If I need vector graphics, I can use tikzDevice for latex.
- Rstudio is a an excellent IDE, and Emacs Speaks Statistics is an excellent Emacs plugin
- It is very easy to get help without going to google. (?foo, ??bar, etc) Documentation is well organized, and the documents often contain citations and relevant links.
- Lots of advanced models can't be found outside of R. Today I fit a splines-on-a-sphere model using mgcv (https://stat.ethz.ch/R-manual/R-patched/library/mgcv/html/smooth.construct.sos.smooth.spec.html https://stat.ethz.ch/R-manual/R-patched/library/mgcv/html/sm...)
- Rapid iteration in modeling using Wilkinson notation formulas. Built-in formulas are the actual killer app of R, IMO.
- Things are generally fast, but if you need extra horsepower, plugging into c++ is easy using Rcpp.
- R feels like lisp. Experimentation is easy, and I don't feel forced into any particular paradigm while using R. I have a lot of ways to evaluate code (https://ess.r-project.org/Manual/ess.html#Evaluating-code https://ess.r-project.org/Manual/ess.html#Evaluating-code)
- jarenmf 5y agoAgreed, also R with vim is really a joy to work with (Nvim-R plugin) I can't replicate the experience with any other IDE. For example, I can define my own key bindings to show a certain summary statistic or a custom plot for the variable I'm at.
- clircle 5y agoThanks for this. I might give it Nvim-R a shot. I've been using Evil+ESS for a long time, but Emacs runs like a dog on Windows 10.
- jhoechtl 5y agoDoes RStudio already work on Linux wayland? Last time it failed because of a QT-component but AFAIK the whole thing is transitioning to electron.
- ekianjo 5y agoIt works as long as you set the right flag before launching it.