Module 6: Basic Visualizations in R
Hi everyone!
This week we learned how to create basic visualizations in R and the techniques to decide which visualizations fit one type of data versus another. Yau explains the most important aspect of a visualization is its ability to help a viewer spot differences in the data.
I chose to explore the in-built dataset in R called "USArrests" which is categorizes arrests by murder, rape, and assault per 100,000 residents in each of the 50 US states in 1973. I have never created a pie chart in R before, so I used this dataset to capture a basic visualization of the country's total arrests by crime type in a pie chart. I chose to calculate these by percentages of the whole in order to help the viewer understand assaults are significantly higher percentage of crimes in the US.
Within these assaults, I thought it would be interesting to understand the distribution of number of assaults by each state to know which states have the highest and lowest assault crime rates. In order to visualize this, I created a bar plot using the ggplot2 package. This package allowed me to rearrange the order of the bars in descending number of assaults, choose an alarming red color, and modify the label placement for clarity.
It is clear North Carolina and Florida have the largest assault crime numbers, while Hawaii and North Dakota have the lowest. Both of these visualizations are simple plots to draw the difference either by crime type in the pie chart or state crime amounts in the bar chart for a greater understanding about 1973 US crimes.
Check this out in GitHub!
-Ramya's POV


Comments
Post a Comment