# What are the Advantages of R over Python in Statistics? [duplicate]

So I'm a budding quant, but came from an Economics background so what I learned first was R and, of course, have fallen in love ever since. However, I recently started doing research on why Python seems to be more valued in the finance industry, and based on many stack exchange questions (which I provide for context: here, here, and a reddit thread here), determined that, essentially, Python has two advantages:

• more robust integration with other languages and tools (C, VBA, etc.)
• bit faster when it comes to overall statistical analysis

However, R also has its clear Pros, which seem to be

• superior visual representation of data (ggplot2)

What I am interested in is the latter; however, I can't find too much research on what specific analysis R can do that Python can't. Would the more advanced statisticians and analysts here weigh in on this? I know Python has access to Tensorflow for deep learning and an advantage there, but are there any non-parametric analyses or non-linear models that Python won't have access to for the foreseeable future?

## marked as duplicate by S. Kolassa - Reinstate Monica, Tim♦Nov 2 '17 at 8:35

While it was not the cutting edge, but rather a must have standard, my Python coworker and I (R DS) tried to find a function that solves a regression model using OLS. Neither in numpy nor in statsmodels could we find this. It can cause confusion when one needs to derive significance and SE for coefficients and a linear combination. It felt strange to not being able to find this tool as a statistical tool.
The R stats has lots of tools some of which may be lacking in Python libraries, but I am not ready to enumerate all that is missing.
Look at glmnet for R (it is also available in Python per @seanv507 suggestion): a generalized regularized regression, incorporating Lasso, Ridge, and ElsasticNet, solved by warm-up using modern gradient descent methods; published in circa 2000s to consider it a cutting edge algorithm.