![]() ![]() In the recording, this took awhile due to several brain farts (which happen often when dealing with factor ordering). To do that we change the internal factor labels of state volume to the specified order. We want the sort the labels by their average star rating, descending. You may notice that the order of the states is alphabetical going from the bottom of the axis to the top, and R will always set this order for any character vector. But the x-axis is cluttered and the States would look better on the y-axis. The correct fix is to add a stat="identity" parameter to geom_bar, which tells it to scale the bars by the given value of the aesthetic.īetter. geom_bar by itself does histograms on raw values, as shown in the qplots. Ggplot ( data = df_states, aes ( state, avg_stars )) + geom_bar () Additionally, the video can be played at an unusually high quality for screencasting: 1440p on supported browsers, at 60 frames per second. I have recorded a screencast of myself coding in R to play around with data from Yelp Dataset Challenge and uploaded it to YouTube. Why not celebrate by playing around with ggplot2 and making some pretty charts? Let’s Code! # Last week, ggplot2 author Hadley Wickham released a surprise update for my favorite R package, bumping the version to 2.0.0. It’s time to take things to the next level of transparency by recording screencasts of my data analysis and visualizations. “Big data” in particular is a area where the steps to reproduce results are rarely released publicly in a step-by-step manner, often in an attempt to make the resulting analysis unimpeachable. 2015 was a year of misleading and incorrect data visualizations, and I don’t want to help contribute to the misconception that data can be used for trickery. One of the reasons I have open-sourced the code for my complicated data visualizations is transparency for the creation process. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |