Earlier quoted context omitted.
R has much better syntax with tidyverse for data wrangling and even up to models with tidymodels and all. Python in comparison is hard to read.
What... Have you seen the piping syntax in tidyverse? It's incomprehensible unless you put in a lot of effort to understand all that's going on.
Why Clinical Laboratorians Should Embrace the R Programming Language
41–50 of 62 posts
Re: Why Clinical Laboratorians Should Embrace the R Programming Language
#42Earlier quoted context omitted.
What is incomprehensible about it?
Grandparent commenter mentioned the piping syntax, specifically.
It's problematic because people abuse it for everything (300 line pipes are common, sadly) but it's a really useful tool in moderation.
Re: Why Clinical Laboratorians Should Embrace the R Programming Language
#43Earlier quoted context omitted.
> In R you more packages that do what you expect (mathematically) I disagree with this point explicitly. Many packages are not only poorly written programmatically and systemically, they also produce bad results in common cases and fail silently. This has been discussed well before on our very own YCombinator. https://news.ycombinator.com/item?id=17308554 > is not exactly doing what user need or skips important featu…
> This is why classes are cool You may be unaware, but there are vast similarities between the object system of R and Python, mostly due to their common inheritance from the Art of the Metaobject protocol. They look very different (generic functions vs classes), but they are equally extensible. The trouble with R's systems is that there's three of them, and people use whichever works without really understanding any…
Re: Why Clinical Laboratorians Should Embrace the R Programming Language
#44- 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/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)
Re: Why Clinical Laboratorians Should Embrace the R Programming Language
#45My impression is that people outside of maths and statistics are more likely to choose Python than R, because they're able to get started with it more easily. Conventional programmers seem to be somewhat reluctant to learn R's syntax and adjust their programming model. Non-programmer types think in maths even less so they like the python "straightforwardness".
R is used almost exclusively in stats. Most in maths use python, c++ (there's a surprising amount of hpc code, e.g. pde solvers and other stuff floating around in c++), matlab, etc.
Re: Why Clinical Laboratorians Should Embrace the R Programming Language
#46I basically worked as an R troubleshooter in a Pharmaceutical company, and honestly I wish python or Julia would take its place. There's so many instances when R would return a nonsense answer rather than fail, but you wouldn't realise until you did a deep dive of someone's code.
Re: Why Clinical Laboratorians Should Embrace the R Programming Language
#47Earlier quoted context omitted.
> In R you more packages that do what you expect (mathematically) I disagree with this point explicitly. Many packages are not only poorly written programmatically and systemically, they also produce bad results in common cases and fail silently. This has been discussed well before on our very own YCombinator. https://news.ycombinator.com/item?id=17308554 > is not exactly doing what user need or skips important featu…
> This is why classes are cool You may be unaware, but there are vast similarities between the object system of R and Python, mostly due to their common inheritance from the Art of the Metaobject protocol. They look very different (generic functions vs classes), but they are equally extensible. The trouble with R's systems is that there's three of them, and people use whichever works without really understanding any…
Re: Why Clinical Laboratorians Should Embrace the R Programming Language
#48I basically worked as an R troubleshooter in a Pharmaceutical company, and honestly I wish python or Julia would take its place. There's so many instances when R would return a nonsense answer rather than fail, but you wouldn't realise until you did a deep dive of someone's code.
Re: Why Clinical Laboratorians Should Embrace the R Programming Language
#49Re: Why Clinical Laboratorians Should Embrace the R Programming Language
#50Reasons 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 - T…