Silicon Valley University Visual Analytics R and R Studio Code
Description
Part 1:
- produce a scatterplot of the by_country data with the points colored by consent_law
- Using facet_wrap() split the consent_law variable into two panels and rank the countries by donation rate within the panels
- Use geom_pointrange() to create a dot and whisker plot showing the mean of donors and a confidence interval.
- Create a scatterplot of roads_mean v. donors_mean with the labels identifying the country sitting to the right or left of the point
- load the ggrepel() library
- using the elections_historic data, plot the presidents popular vote percentage v electoral college vote percentage. draw axes at 50% for each attribute and use geom_text_repel() to keep the labels from obscuring the points.
- What is the electoral college?
- create a new binary value column in organdata called ‘ind’ populated by determining whether the ccode is “Spa” or “Ita” and the year is after than 1998.
- create an organdata plot of Roads v. Donors and map the ind attribute to the color aesthetic. Label those points with the ccode and suppress the legends.
- Add a label in a rectangle to the previous plot that says “Spa = Spain & Ita = Italy
Part 2:
- Return to the visualization for Presidential Elections: Popular and Electoral College margins, subset by party, and use that to add color to your points.
- Recreate figures 5.28 using functions from the dplyr library.
- Using gss_sm data, calculate the mean and median number of children by degree
- Using gapminder data, create a boxplot of life expectancy over time.
Get your college paper done by experts
Do my question How much will it cost?Place an order in 3 easy steps. Takes less than 5 mins.
Leave a Reply
Want to join the discussion?Feel free to contribute!