4 ms·
I'd be interested in more about your beefs on R. Note that its origins are the earlier language 'S', part of the original AT&T UNIX suite, and seen as an adjun
by dredmorbius 12y ago
I'd be interested in more about your beefs on R.
Note that its origins are the earlier language 'S', part of the original AT&T UNIX suite, and seen as an adjunct to the data knife of awk. Later you'd likely have paired Perl, Python, or Ruby, and likely a pseudo-database (sqlight, say), along with some stats and graphing libraries or tools.
My own stats background includes some very basic SPSS, as well as SAS and R, and graphics under gnuplot. I've always found R tremendously difficult to grok, though I've known a number of statisticians I respected (at least as statisticians, if not as programmers) who found R exceptionally useful and powerful. My understanding is that its real value is as a matrix manipulation language, which may account for both its obscure syntax and appeal among hard-core stats geeks.
But still: your criticisms?
- east2west 12y agoOK, to be fair, R is a reasonable language for statisticians and others. I guess R and S are different enough from usual programming languages that I may be biased against them. But I did spent five years working on bioinformatics and statistical genetics using it, and I couldn't wait to get away from it when I did. I will list my personal peeves. 1. R's syntax has problems. This is well documented on the web. I recall : has wrong precedence. 2. My biggest problem is R's lack of basic abstraction facility. Beyond functions there is nothing good. There are three object-oriented programming systems, none of which are simple or straightforward. It has first-class functions and lexical closure so at least basic functional programming should have been possible and fun. But R functions' have a weird parameter passing mechanism which scared me away from investigating deep. In the end I used RCPP to write large codebase and expose an R interface. And I like to delve deep into things. I was learning template metaprogramming when I was working on bioinformatics. 3. CRAN has way too many low quality packages, but far more importantly almost all packages' documentation consist of use-cases plus reference. To this day I don't have a good mental picture of genomicRange (a foundational bioinformatics package in Bioconductor for NGS data analysis) data structure and how to manipulate it (one main data structure, I believe). This is annoying at best and infuriating at best. 4. R, more than any other language I know, is an implementation-defined language. The language reference manual frankly admits fuzzy rules for some of the more advanced features. Python, which has been recently criticised for similar problems, is clear at the basic language features level. I don't want to this discussion to degenerate into a flamewar. Programming language preference is a highly personal thing and I respect people who use R, even admire programmers who create awsome packages. ggplot2 and Plyr are some of the best packages I have ever used, and their documentation is superb. I just don't believe R is a good language for statistical students if they hope to move on to professional programming in other languages.
- vsbuffalo 12y ago> Beyond functions there is nothing good. There are three object-oriented programming systems, none of which are simple or straightforward. I don't think this is quite fair. R was greatly inspired from Scheme and stole a lot of good ideas. S4 is very similar to CLOS, and does a fairly good job. If you come from Python or Java, this system looks crazy, but being unfamiliar with a language style does not make the language bad. > To this day I don't have a good mental picture of genomicRange (a foundational bioinformatics package in Bioconductor for NGS data analysis) data structure and how to manipulate it (one main data structure, I believe). It's a dataframe attached to ranges. This design extends lower classes like IRanges, and all the accessors, setters, etc are consistent. You can manipulate the range part with integer range operations and manipulate the dataframe part as a dataframe. I would check out the IRanges vignette — this is very helpful. > R, more than any other language I know, is an implementation-defined language. This is the most severe problem for sure. I'm cross my fingers someone forks R's implementation and does it right (which should break a lot of packages and code).
- jghn 12y agoS4 was heavily influenced by Dylan, FWIW
- east2west 12y ago>It's a dataframe attached to ranges. This design extends lower classes like IRanges, and all the accessors, setters, etc are consistent. You can manipulate the range part with integer range operations and manipulate the dataframe part as a dataframe. I would check out the IRanges vignette — this is very helpful. I agree that the accessors, setters of GRange are consistent. I was having trouble picturing how manipulating the range part impacts the dataframe. I think they are like a database table joint but that is not explicitly spelled out. It becomes even less clear what happens to the attached dataframes when merging two GRange intervals. I once had to a symmetric difference of two GRange and it took a few hours of staring at the manual and trying out things at the command prompt.
- icelancer 12y agoI agree. It is VERY strange to complain about R in the context of IT/Developers, considering R is widely complained about by statisticians (since .edus have incentive to encourage the purchase of SPSS, SAS, and Mathematica).
- geebee 12y agoNot the OP, and I don't have a beef with R, but I prefer python. A lot of it is just my background. I was a math major, but I didn't use Matlab (much) - my professors just happened to be the kind who prefer C (numerical recipes types). So my intro to math was through programming languages rather than through math environments that can be programmed. I'd say that's probably the big difference between Python and R. I'm sure there's absolutely nothing you can't do with R, but python is a general purpose programming language with great libraries for ML, R is a stats environment with general purpose programming capabilities. Having also been a programmer for 15 years since my school days, I'm more productive in the former (general programming language with great libraries). There's one other reason. People often speak derisively of "cramming things into a random forest." In my experience, it takes a remarkable amount of intricate programming to cram things into a random forest! Even a kaggle assignment, the sort of thing where you have the question and reasonably cleaned data set available, even then you have to poke and prod and threaten and beg the data into different formats. And in the wild? Sheesh. Python seems to be the heir to the perl crowd, the "pipe it here and twist it there and cram it" sort of thing. I'd rather be doing that with Python than R.