4 ms·
Wonderful demonstration. I can't help but wonder--as someone who has flirted with R but certainly not committed--how much time and practice it takes to acquire
by sk5t 8y ago
Wonderful demonstration. I can't help but wonder--as someone who has flirted with R but certainly not committed--how much time and practice it takes to acquire decent fluency with these half-magical incantations to become productive.
- jhbadger 8y agoNot that long. The trick is to really understand what each clause is doing. It's easy to just find some code on the Web for a graph similar to what you want and tweak it for your data, and I did that myself in the beginning, but then they will remain "half-magical incantations" as you put it. The thing about ggplot is nothing is there arbitrarily -- it is really describing how the plot is put together.
- dswalter 8y agoThe other thing is that the 'gg' in ggplot2 is the Grammar of Graphics, which describes a high-level grammar for composing visualizations. Having an underlying grammar makes it possible for the syntax to have logical consistency, where once you learn how it works, you can incorporate and generalize simply. (aside, I used to use ggplot2 but I switched to working in python, and I miss ggplot2 so, so much). The syntax being shown here demonstrates an incremental way of layering on the components of the final visualization, which shows the power of the underlying grammar of graphics.
- hprotagonist 8y agoHave you tried plotnine? The api is effectively identical.
- devit 8y agoYou can use R packages from Python and viceversa with rpy2 or reticulate.
- Gatsky 8y agoIt depends on what you want to do. ggplot2 is what I would describe as broad but not deep - you can access 90% of the functionality in a relatively short time. The main thing is that ggplot2 has been around for a long time, is developed by people that care a lot about R, and there is pretty much an answer to any question you may have on stackoverflow.
- neves 8y agoggplot2 also have excellent defaults. I'm really in Visualizations but I'm from the Python world. I had to teach a class using ggllot2 and was really impressed. You can easily make excellent graphs.
- black-tea 8y agoThis is ggplot. It's not a good example of what it's like to use R in general. I sorely wish there was a well-maintained ggplot for Python because the library is excellent but the language is terrible.
- amrrs 8y agoBBC internally created a cookbook for the same purpose. https://bbc.github.io/rcookbook/ https://bbc.github.io/rcookbook/ I think it's okay that if someone's fluent in R and yet don't know how to update scales in ggplot.