4 ms·
Please don't blame R for the ggplot syntax -- it is bizarre on its own. Also ggplot requires very specific form of input, and thus many scripts must be heavily
by mbq 13y ago
Please don't blame R for the ggplot syntax -- it is bizarre on its own. Also ggplot requires very specific form of input, and thus many scripts must be heavily polluted with a nontrivial preprocessing routines.
- joshlegs 13y agohm. i've never even heard of R .... it's a graphing library ?? Also, seems like that's a lot of dependencies for ggplot2. I'm wondering if this is really worth switching off of matplotlib. Sounds like all it's really doing is changing the method that you call ?
- mwfunk 13y agohttp://en.wikipedia.org/wiki/R_(programming_language) http://en.wikipedia.org/wiki/R_(programming_language)
- cschmidt 13y agoR is the language of choice for statisticians. That means just about any statistical technique you can imagine is available as a library in R. It is very nice as an interactive environment to explore your data. The fact that it was designed by stats people also leads to some funky language choices. There are actually a number of other graphics packages in addition to ggplot. Good integration with C for speed (it can be slow otherwise on iterative code, and a bit of a memory hog, as it copies objects in memory with reckless abandon.) It is my second choice language these days after python, and the only one to use when you need a certain library.
- blueblob 13y agoR is a scripting language used a lot in statistics and just graphing. http://www.r-project.org/ http://www.r-project.org/ EDIT: oops, posted to the wrong person
- joshlegs 13y agoheh, no worries. thanks for the link.
- hadley 13y agoYour pollution is my tidy-ness: http://vita.had.co.nz/papers/tidy-data.html http://vita.had.co.nz/papers/tidy-data.html.
- joebo 13y agohadley, I couldn't pass up an opportunity to say thank you for ggplot2 and plyr. Both have made R infinitely more useful to me and have been used thousands of times by me over the past 3 years.
- hadley 13y agoYou're very welcome!
- mbq 13y agoIt is certainly a pollution of code -- a necessity to convert a good, efficient data structure which base graphics can plot into some specific form will always seem redundant from a programming point of view (and I was replying to a programmer). Obviously the situation is opposite when one considers, let's say, "analysts", i.e. people that expect to be able to completely ignore the form of the data and focus purely on the content -- for them your stack of tools is a pure gold, even with its trade-offs.
- hadley 13y agoI'd love to see an example of that - I agree that you might have to do some data transformation to use ggplot2, but I think the net effect is still fewer lines of code than with base graphics (except for v. simple graphics). Some clarification about what you mean regarding efficiency would be useful - do you prefer arrays?
- mbq 13y agoBoxplots from a list, matplot of a matrix, all the cool default plot methods for various complex objects like clusterings, trees, models... Maybe I'm alone in that, but I believe the power of R lies in its resilience and the fact that it allows me to write code that is equally obvious in what it does as how it does. The philosophies of one-true-data-structure and natural-language-like expressions doesn't play well with it, though I admit they are very useful for people accustomed to a declarative programming.
- bosie 13y agohave you looked at plyr/pryr/reshape2 for the preprocessing routine?
- kylebgorman 13y agoI'd say more that it's approaching "domain-specific language". (I think R's syntax is just horrendous; love the libraries, though! ggplot2 included. Thanks Hadley!)
- hadley 13y agoI think R is a lot like JavaScript: there's a beautiful language at its heart, but it's surrounded by layers of cruft. It doesn't help that most people using r are not programmers.