(Someone may have said this already, but there is no way I'm reading through all the "Python vs R" BS to find out)
R Passes SAS in Scholarly Use
61–70 of 126 posts
Re: R Passes SAS in Scholarly Use
#62Earlier quoted context omitted.
A big problem with R is that it's just stats. The other day I wanted to do a simple loan amortization (simple PMT/IPMT in Excel). People say 'use R over Excel!'. Right. There are some clunky barely-working packages in R that do half of what you need and some stack overflow posts that mostly show how to do the other half, but that's no basis to build on. And don't get me started on string handling in R, or that there'…
There are many things wrong with R but basic plotting functions are one of its strengths. Is this the way you did it? It seems pretty intuitive... a=pi/180 x=1:360 plot(x,sin(a * x)) plot(x,a * cos(a * x)) plot(x,-a^2 * sin(a * x))
My main problem was the derivative, not so much the plotting (or maybe it was 'plotting an arbitrary function'); but I looked it up and it seems I slightly misremembered what it was I wanted to do. I wanted to draw a cubic spline, not a sine. What I ended up doing was
spline_x
I still don't quite understand how that derivative works - ?list doesn't mention anything about 'deriv', and there's a function called 'deriv' but I'm not sure how that's being interpreted in the code above.Also it seems recent versions of ggplot2 have geom_xspline() which does what I need (I'm told) but that wasn't in the release version when I was doing it.
Re: R Passes SAS in Scholarly Use
#63Some reasons I love / use R: Plenty of free high quality documentation and learning materials around R (just read anything by Hadley) Package manager. Super easy to find, install, and start using packages. Open source / Free Large community of users Extensive usage by the stats community. (If a new algorithm comes out, chances R there will be an R implementation) Easy to build and share your own packages via Github.…
A big problem with R is that it's just stats. The other day I wanted to do a simple loan amortization (simple PMT/IPMT in Excel). People say 'use R over Excel!'. Right. There are some clunky barely-working packages in R that do half of what you need and some stack overflow posts that mostly show how to do the other half, but that's no basis to build on. And don't get me started on string handling in R, or that there'…
Re: R Passes SAS in Scholarly Use
#64I think Python is the biggest hidden gem in statistics. It's had a tremendous impact on machine learning and algorithm development, yet traditional statisticians still rely on SAS/R/Stata/MATLAB. All of these languages have libraries that produce the same results, the difficulty is mangling the data into the correct input format. Python's list comprehensions are much, much easier to use than MATLAB matrices, R's data…
Re: R Passes SAS in Scholarly Use
#65Is Machine Learning cooling down?
Re: R Passes SAS in Scholarly Use
#66Earlier quoted context omitted.
I'm glad I read this comment. After checking some of the docs I think I will have a go at Python for data wrangling. List comprehensions look... friendly. R still rules for plotting and running canned statistical procedures but sometimes I feel like if I stop programming R for a week I forget how to use it effectively... E.g. Forgetting to add stringsAsFactor=FALSE to everything, forgetting rbind() can overwrite colu…
I'd recommend reading http://r4ds.had.co.nz for an R workflow that eliminates a lot of those pain points. (Except for infix string concatenation - I've never really understood why people prefer that to paste(). Maybe if you're not thinking in vectors?)
I do like the look of the dplyr library a lot. Combining functions like select and group_by with the pipe operators creates code that is reminiscent of SQL- very nice for readability.
Re: R Passes SAS in Scholarly Use
#67Earlier quoted context omitted.
With pandas, this is no longer true.
How pandas solves statistical problems or the thousand utility functions that are missing? Please, explain.
Take a look: http://pandas.pydata.org/pandas-docs/stable/
EDIT: Specified name of interface (rpy2).
Re: R Passes SAS in Scholarly Use
#68If I use R for a plot, or a simple bit of regression, or anova, or even cross-validation. I don't reference it in a paper. I only cite it if there is a package designed for a particular type of data (e.g. a Bioconductor package) or something a bit more esoteric (e.g. apcluster). About 95% of the work is data munging and - sorry Hadley - I don't cite dplyr, purrr, magrittr etc...
However I have notice that in clinical trial or small social science papers simple analyses of this type are often cited as being done in SPSS or SAS. I think this just reflects the fact that non specialist data analysts are more likely to cite SAS or SPSS for simple procedures such as graphs or anova as an appeal to authority.
So I reckon the data may reflect a trend but tells us little about the true levels.
Re: R Passes SAS in Scholarly Use
#69Earlier quoted context omitted.
If I use python I have to write half of the algorithms I use myself. Worse, I have to write a gazillion helper functions nyself. It just won't do
I think you got downvoted because people didn't know what you meant. You're right though. Although R is laughably inferior to python as a programming language, it is vastly more work to try to do statistical data analysis in python than in R. I recommend using both languages and using csv or whatever format to exchange data sets.
Have you used Pandas in the past year or two? I'm curious why you would exchange data sets using csv or another format between Python and R when you could easily call the R function of interest from within Pandas (using rpy2) and not even worry about data interchange.
It's definitely not vastly more work to do statistical analysis using Python Pandas than in R anymore, perhaps it was several years ago.
EDIT: And carlmcqueen mentioned feathers in response, which is a collaboration between the developers of Pandas and R to create interoperable on-disk data frames for both languages. Point being, between rpy2 and feathers (and probably other projects), you definitely don't need to use intermediary csv files anymore to move data back and forth between R and Python.
Re: R Passes SAS in Scholarly Use
#70Mathematica isn't being used at all? That's surprising. Mathematica is wonderful. I wonder what's holding it back? It doesn't seem to have a package manager. Could it be that simple?
The interfaces are terrible. The price is high. If you need to call one of the built-in pieces of Magic (TM) then Mathematica is OK, but if you want to build something new that needs to interface with literally anything outside of Mathematica, then Mathematica is a PITA.
The interface was trivial.