4 ms·
OK, 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 bia
by east2west 12y ago
OK, 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.