City
Distance
C01
22,000
C02
170
C03
800
C04
1,700
C05
200
C06
2,000
C07
400
C08
23,000
C09
14
C10
500
C01
3,500
C02
1,000
C03
653
C04
800
C05
230
C06
1,200
C07
5,000
C08
750
C09
1,500
C10
280
Using RStudio, generate the following graphs using the ggplot2 package:
Figure 1 - Box plot of the estimated distances by city
Figure 2 - Dot plot of the estimated distances by city, using a bin width of 50 miles
Figure 3 - Box plot of the estimated distances by city for distance estimates under 5,000 miles
Figure 4 - Dot plot of the estimated distances by city for distance estimates under 5,000 miles, using a bin width of 50 miles
*How to subset your data:
Install the dplyr package
Use the filter command to create a new data frame: New Data = filter(Old Data Frame, condition)
Be sure that all plots meet these requirements:
- Title with the figure number and brief description
- Footnote with your full name and section
- City codes on the left side of the graph
- Scale label on the horizontal scale should have the form: variable(units)
- About 6-10 tick mark labels on the horizontal scale
- Plotting symbols of reasonable size - you will have to play around with it until it looks right
- Font size 12 for tick mark labels ("axis.text" in ggplot)
- Font size 13 for scale labels ("axis.label" in ggplot)