8 ms·
What's Next for R?
- bransonf 7y agoDisappointed in the lack of discussion of R-Shiny or Plumber. R-Shiny is a full stack platform for web apps, and it’s how I leveraged my data science background to get into web development. It’s incredibly powerful in my opinion, with the only obvious limitation being the speed of R itself. And Plumber. It’s become the defacto method for deploying R code in a REST api. It too is still maturing, but I see it eventually becoming the Flask of R. Truth be told, however, after developing quite a few projects on the Shiny/Plumber stack, I wouldn’t recommend anyone do it. If for some reason you can only have an R interpreter, go for it. But learning multiple languages really is the best solution if you want to manage efficient applications. I say this, however, realizing that all of my colleagues writing R don’t have engineering backgrounds. I can’t help but feel like R is like JavaScript in many ways. Ease of use and the ease of publishing packages very quickly clutters the repository. R will always have a special place in my heart, after all it’s the language that made me discover programming. However, I can’t help but feel that my thirst for efficiency is making me outgrow it as a language quickly.
- bllguo 7y agoon the shiny note - check out streamlit. declarative python equivalent. it's pretty incredible how easy it is to use
- deleted 7y ago[deleted]
- santa_boy 7y agoI understand where you are coming from and had similar experience. After learning a fair bit of web-development, I feel R should focus on an analytics oriented path. R just isn't designed for a web-app. Web-apps are much better and faster developed in more focussed languages / frameworks (node/python/django/express, etc) and can be seamlessly integrated to leverage R modules / scripts.
- sammm 7y agoI started at a company using Shiny for their applications and R as part of their data pipelines. A huge pain point for us is the packaging system. It is absolutely awful. Packages constantly get overridden so we have to install packages in a specific order. Whenever I have reached out to the community (including prominent members, which have written R books) I have always been told to just use the latest version of all packages and just get on with it, which as anybody knows, isn’t always possible, especially as there are constantly breaking API changes. I understand R’s history and that in general, it is a lot better than it use to be, but I would only recommend R is used for notebook style work and to keep it well away from production. We have migrated to Python, which isn’t perfect, but the difference in logging and packaging has been night and day.
- truculent 7y agoI have also found R in production to be a nightmare. On packaging, the renv package seems to be the new way to try to manage things. It’s not perfect but seems to be a step up on what was around before. Have you tried it out at all?
- sammm 7y agoI haven’t, thank you for the suggestion. I will give it a go.
- amelius 7y agoSame experience here. A lot of packages/functionality are not available in Python, however.
- wodenokoto 7y agoAt my old work we would “freeze” CRAN, by downloading a complete dump of everything and setup R to install from that version instead of the online version as a way of version controlling packages. So instead of defining our app to use version 1.4.5 of a package, we would use “latest version from 3rd of May”.
- glofish 7y agoWhat's Next for R? Doing the exact same thing we did before! We have a new library called "dtplyr" (no seriously!) it is designed to save users from the arcane and obtuse sides of R by combining the power of "dplyr" and "data.table", the two libraries that were designed to save users from the arcane and obtuse sides of packages such as "data.frame" and .... I wish I were kidding. There is the absurd contention in the R world that by introducing yet another weirdly named package people can avoid having to learn and suffer through the "real" R.
- tzabal 7y agoI also got excited when I found out about R Markdown, and how well is integrated with RStudio. I believe that it is a decent alternative to Jypyter Notebook.
- AmeliaR 7y agoFuture could be predicted with some data from the past. That's a bit ironic that we are discussing about the future of R. Programming languages never got this much attention. Everyday is a new day for a programming language and specifically R-programming enthusiasts. R is experiencing threats from Python, Julia but R still survives. R’s future is as bright as a sky with data.table and spark’s API with R.
- AmeliaR 7y agohttps://speedtest.vet/ https://speedtest.vet/ https://vidmate.bid/ https://vidmate.bid/ https://123-movies.red/ https://123-movies.red/
- RA_Fisher 7y agoI'm so thankful for R, it's community and their great libraries! I've built a eight year (so far) career in data science using R to model data and perform experiments. I love R's functional programming style / dplyr which makes manipulating data a delight. ggplot2 is such a great plotting library, well worth the investment to learn. Then there's all the stats tools like glm, MASS, through brms for advanced Bayesian analysis (https://github.com/paul-buerkner/brms#brms https://github.com/paul-buerkner/brms#brms). With R and Python, it's a great time to be a statistician-programmer! I recommend folks looking to start with R check out: https://r4ds.had.co.nz/ https://r4ds.had.co.nz/
- sedeki 7y agoThere is also ”Advanced R” by Wickham, that goes into more technical details on how the language itself works (and datastructures, etc). It is also available for free.
- pickdenis 7y agoI know this is a dead horse, but I think R seriously shot itself in the foot with its data structures[1]. I don't really see a solution for this, as fixing it would never be backward compatible. I'll always pick Python over R because the data structures actually make sense to me as a programmer (objects that look like lists, dicts, matrices, etc. or any combination of the above, and they all behave in very predictable ways). I think this puts off a lot of other people like me. [1]: https://jamesmccaffrey.wordpress.com/2016/05/02/r-language-vectors-vs-arrays-vs-lists-vs-matrices-vs-data-frames/ https://jamesmccaffrey.wordpress.com/2016/05/02/r-language-v...
- kgwgk 7y agoFrom that link: > A vector is what is called an array in all other programming languages except R Vectors are called vectors in several "wispy" languages: Common Lisp, Scheme, Clojure... > An array with two dimensions is (almost) the same as a matrix. I think it's the same, not "almost" the same. At least in the current version of R: > class(array(1, c(2,3))) [1] "matrix" > identical(array(1, c(2,3)), matrix(1, nrow=2, ncol=3)) [1] TRUE In 4.0 there will be a change and the class of a matrix will be both "matrix" and "array", but I think the fact that there is no difference between a 2-dimensional array and a matrix remains.
- downerending 7y agoIt's based pretty directly on S, which was designed in the mid 1970s. Yeah, it has very rough edges here, but hard to argue that they should have foreseen the future back then. That said, the real value in R seems to be the libraries. Has anyone looked at a shim that could make those libraries available to Python in a reasonably natural way? If that existed, the R language itself could be allowed to finally rest in peace.
- anthony_doan 7y agoThere is something to be said to build a programing language to solve a certain task in mind. Being vector aware and having a dataframe support in R is much more elegant for me than Python's add on library. It's like Scala building on top of Java but trying to have an Actor paradigm vs Erlang built from get go around concurrency and choosing Actor as it's main concurrency paradigm. You can see this in other language on PHP and C++ let you be OOP but it's an after thought compare to Ruby or Python.
- roel_v 7y agoI hope a hospice. Ugh that language has damaged me worse than Perl.
- luhego 7y agoI used R when I took an online course on Data Analysis. I didn't like it at all. Its syntax is weird and painful to read. The only nice things about R are Tidyverse and ggplot. I found Python to be a better alternative. You can use Pandas for data analysis y EDA. Matplotlib and Seaborn for plotting. Scikit-learn for training your models. An additional benefit is that Python is a general purpose language that you can use to build a complete application.
- curiousgal 7y agoIn almost all of the use cases you mentionned, R blows Python out of the water. Working with dataframes in R is much much more convenient than Pandas (loc, iloc, etc??) Plotting is an obvious win for R, matplotlib is horrible, it's powerful yes but it is an absolute pain when compared to ggplot. Scikit is definitely unmatched but caret is not so far behind. Also, R has a plethora of implemented models that Python lacks (from something as basic as decent quantile regression to time series analysis tools). As for building a complete application, Python is indeed the go-to. Syntax wise, using magrittr's pipes is an absolute pleasure. Good luck doing that with Python.
- whoisnnamdi 7y agoJust as an FYI - the statsmodels python package just released numerous new time series tools in version 0.11 rc1 [1] and also has functions for quantile regression [2] [1] https://github.com/statsmodels/statsmodels/releases https://github.com/statsmodels/statsmodels/releases [2] https://www.statsmodels.org/dev/examples/notebooks/generated/quantile_regression.html https://www.statsmodels.org/dev/examples/notebooks/generated...
- PlugTunin 7y agoExactly. I initially liked Pandas, but then I discovered what I can do with data frames in R, visualizations with ggplot, and the SQL-like data manipulation using dplyr w/ pipes from magrittr. R may have the steeper learning curve -- and for certain uses, be inferior to Python -- but it's a wonderful language.
- gdevenyi 7y ago
- meztez 7y agoI would highly recommend the use of the package data.table over tibble or the basic data.frame if you are doing any type of modeling in R with larger datasets. Yes R has many data structures but knowing how to use data.table will blow your mind in term of efficiency. Matt and other contributors have built something extremely fast and flexible. I get that R is not for everyone but used correctly it is a beast. Now this is anecdotal, but we have in the insurance industry what we call on level premium calculators. It is basically a program that will rerate all policies with the current set of rates. Our current R program can rate 41000 policies a second fully vectorized on a user laptop that has a an i5 from 2015. In contrast, the previous SAS program could do 231 policies a minute on xeon 64 core processor from 2017. For our workload and type of work, R has been a godsend. Bonus, we can put what our data scientist develop in R directly in production. (after peer review, testing, etc, not different than any other production code) Back when I started in 2005, we modeled in some proprietary software like Emblem, used Excel to build a first draft premium calculator, rebuilt the computation in SAS for the onlevel program and sent specs to IT to rebuilt the program again for production. All three had to produce the same results. I've tried Python, Go, Rust, Julia. I'd say Python could be a good alternative but speed of data.table, RStudio IDE and ease of package management in R makes R an obvious choice for us. I believe Julia to be the future but so far the adoption rate in house has been low.
- petulla 7y agoThis may be useful. I prefer dplyr's syntax. https://github.com/tidyverse/dtplyr https://github.com/tidyverse/dtplyr
- meztez 7y agoOne of the reason we use data.table is that it reduces the depencies when building custom images and its stability has been better than the tidyverse in the past. It might not be the case in the future, but that is how we made our choice initially.
- xiaodai 7y agoFor larger-than-RAM data I would recommend diskframe.com It uses dplyr and data.table syntax to manipulate data on disk
- latte 7y agoCannot comment from my personal impressions, as I have almost zero knowledge of R, compared to several years of using Python for writing apps and working with data. I like R's focus on functional programming, though. However, a couple of years ago, my wife tried to transition from business consulting to a data analytics / data science role. She started with taking an R course. She was put off by R's complexity and the course's early focus on the details of R syntax, function definitions, closures etc. and abandoned it. The year after, she decided to try again and enrolled in a course that used Python (with numpy+pandas+scipy as data science stack) and she reported it to be much simpler, more intuitive and easier to learn compared to her previous experience with R. Now she has successfully completed the program and is employed as a data analyst.
- lottin 7y agoR has a number of features that are intended to facilitate interactive use, which despite being very convenient can be confusing to someone who is trying to learn the language. With Python, on the other hand, it is easier for a novice to build a mental model of how things work. However Python is pretty awful as an interactive language due to the way it interprets white space. Personally I think taking the time to learn R is well worth it.
- datashow 7y agoI guess that's more an issue with the courses than the language per se. Sometimes it is a good idea to begin the course with direct application, instead of focusing on the language.
- cwyers 7y agoI have encountered a lot of really terrible R learning materials. One data viz course I took (a very, very reputable and widely-used course on a major MOOC platform) taught how to make several simple chart types in each of base R, a library called lattice that I've never encountered since, and ggplot2. I think a lot of it comes from R instructors who started out back before the tidyverse trying to teach the path they _took_ to learning the language, rather than the quickest path to being proficient in the language as it exists today. The tidyverse is incredibly controversial in parts of the R community; it's essentially an opinionated set of packages that basically comes with its own "standard" library. But I think that wholeheartedly embracing it, and hiding the way to do things in R that you would do them without the affordances that the tidyverse offers, is absolutely the right way to teach R these days. Unfortunately, a lot of courses and books haven't caught up to that yet.
- bathtub365 7y agoS
- deleted 7y ago[deleted]
- xvilka 7y agoThis currently missing are better LSP (Language Server Protocol)[1] (it supports only some of the LSP features), better linter[2] and static analysis, better integration with GitHub[3], and so on. More on the tooling side, I believe. [1] https://cran.r-project.org/web/packages/languageserver/readme/README.html https://cran.r-project.org/web/packages/languageserver/readm... [2] https://github.com/jimhester/lintr https://github.com/jimhester/lintr [3] https://github.com/github/semantic/issues/382 https://github.com/github/semantic/issues/382
- thegginthesky 7y agoWhen I used R in University (majored in Applied Mathematics and Statistics) I was always awestruck at how every sort of novel modeling technique from GLM, to Beta Regressions, to GARCH, is all easily accessible for free, with proper academic paper and documentation, and with a cohesive standard support. It was really useful to be able to apply most theory I was learning to actual research datasets. This is what I miss the most since moving to Python. What I don't miss is R's terrible packaging system and how it made collaborating with colleagues near impossible. I can't count the amount of times I had to debug dependencies on others' script just to be able to move forward with some team project.
- CreRecombinase 7y agoWhat didn't you like about the packaging system? Even if you hate R the language, R has among the most user-friendly, cross-plaform packaging systems I'm aware of.
- jhanschoo 7y agohttps://stackoverflow.com/questions/10947159/writing-robust-r-code-namespaces-masking-and-using-the-operator https://stackoverflow.com/questions/10947159/writing-robust-... Historically, the conventional way to write R code was one that tended to result in shadowed names (and hence brittle code).
- Quasimoto3000 7y agoR has actually come a long way on the environments front. Check out “renv” from the good people at RStudio. Link: https://rstudio.github.io/renv/articles/renv.html https://rstudio.github.io/renv/articles/renv.html