News for hackers. Stuff that matters.
Re:Ggplot2 for python by mbq on Monday October 14, 2013 @12:50PM (#6548292)
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.
Re:Ggplot2 for python by hadley on Monday October 14, 2013 @03:12PM (#6549020)
Your pollution is my tidy-ness: http://vita.had.co.nz/papers/tidy-data.html.
Re:Ggplot2 for python by joebo on Monday October 14, 2013 @04:09PM (#6549326)
hadley, 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.
Re:Ggplot2 for python by hadley on Monday October 14, 2013 @11:36PM (#6551358)
You're very welcome!
Re:Ggplot2 for python by mbq on Tuesday October 15, 2013 @06:02AM (#6552379)
It 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.

Re:Ggplot2 for python by hadley on Tuesday October 15, 2013 @07:59AM (#6552693)
I'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?

Re:Ggplot2 for python by mbq on Tuesday October 15, 2013 @06:10PM (#6556717)
Boxplots 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.

Re:Ggplot2 for python by blueblob on Monday October 14, 2013 @01:14PM (#6548428)
R is a scripting language used a lot in statistics and just graphing.

http://www.r-project.org/

EDIT: oops, posted to the wrong person

Re:Ggplot2 for python by joshlegs on Monday October 14, 2013 @01:31PM (#6548505)
heh, no worries. thanks for the link.
Re:Ggplot2 for python by kylebgorman on Tuesday October 15, 2013 @08:05AM (#6552725)
I'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!)
Re:Ggplot2 for python by hadley on Tuesday October 15, 2013 @02:59PM (#6555544)
I 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.
Re:Ggplot2 for python by joshlegs on Monday October 14, 2013 @01:13PM (#6548418)
hm. 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 ?

Re:Ggplot2 for python by cschmidt on Monday October 14, 2013 @07:53PM (#6550449)
R 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.

Re:Ggplot2 for python by mwfunk on Monday October 14, 2013 @01:53PM (#6548608)
Re:Ggplot2 for python by bosie on Monday October 14, 2013 @03:46PM (#6549210)
have you looked at plyr/pryr/reshape2 for the preprocessing routine?