In this week in R Programming, we are asked to select a dataset from the Vincent Arel Bundock dataset list and create visualizations from that data.
Link to the list: Vincent Arel Bundock Datasets
I decided to work from the pizzaplace.csv dataset which contains sales, pizza type, and size data over an entire year.
In the instructions, it is mentioned that there are three ways to make visualizations in R: Base R, Lattice package, and ggplot2 package. Thus, I will generate visualizations from these listed methods.
In base R, let's make a "pie" chart that determines the occurrences of each of the 4 types of pizzas sold:
As for the second visual, let's use the lattice package to explore the relationship between prices and pizza size:
Moving on to the third visual using the ggplot2 package, the data was separated by facet to make it easier to compare trends between the four types of pizza and their associated sales over time:
After creating the visuals using the three different methods, I must admit that it is interesting to see how each method does have its pros and cons. For example, I do like to use the base R method but things can get complicated fast with having to call out all the individual methods. To make the first visual better, I should include percentages for each of the four types of pizza sold. Moving on to the second visual, I do not have too much experience using the Lattice package but I do think that the visual came out well in telling a story with the data. For instance, it still weirds me out that someone bought a super expensive small pizza that surpassed the price of a large pizza. Lastly, the ggplot2 visual really puts into perspective which pizza type is the most expensive in terms of sales like classic going above 30.
Check out the code here: Module 9 Code
~ Katie