This is an extension of the tidytuesday assignment you have already done. Complete the questions below, using the screencast you chose for the tidytuesday assigment.
library(tidyverse)
recent_grads <- read_csv("https://raw.githubusercontent.com/fivethirtyeight/data/master/college-majors/recent-grads.csv")
recent_grads
## # A tibble: 173 x 21
## Rank Major_code Major Total Men Women Major_category ShareWomen
## <dbl> <dbl> <chr> <dbl> <dbl> <dbl> <chr> <dbl>
## 1 1 2419 PETR… 2339 2057 282 Engineering 0.121
## 2 2 2416 MINI… 756 679 77 Engineering 0.102
## 3 3 2415 META… 856 725 131 Engineering 0.153
## 4 4 2417 NAVA… 1258 1123 135 Engineering 0.107
## 5 5 2405 CHEM… 32260 21239 11021 Engineering 0.342
## 6 6 2418 NUCL… 2573 2200 373 Engineering 0.145
## 7 7 6202 ACTU… 3777 2110 1667 Business 0.441
## 8 8 5001 ASTR… 1792 832 960 Physical Scie… 0.536
## 9 9 2414 MECH… 91227 80320 10907 Engineering 0.120
## 10 10 2408 ELEC… 81527 65511 16016 Engineering 0.196
## # … with 163 more rows, and 13 more variables: Sample_size <dbl>,
## # Employed <dbl>, Full_time <dbl>, Part_time <dbl>,
## # Full_time_year_round <dbl>, Unemployed <dbl>, Unemployment_rate <dbl>,
## # Median <dbl>, P25th <dbl>, P75th <dbl>, College_jobs <dbl>,
## # Non_college_jobs <dbl>, Low_wage_jobs <dbl>
The data consists of 173 rows and 21 columns. Each row is a different college major and the rows dive into the specifics of that topic. It takes a look at the economic earnings that are paired with each major. Unemployment rate is a pretty self explanaotry row but the row median isn’t. After watching more of the video, you learn that this row is representing the median salary for said major.
Hint: One graph of your choice.
recent_grads %>%
mutate(Major_category = fct_reorder(Major_category, Median)) %>%
ggplot(aes(Major_category, Median)) +
geom_boxplot() +
coord_flip()
This is a box plot showing the earnings from each major. I used the function coord_flip to rotate the graph 90 degrees to read the x-axis. I then reorderd the graph by the median column. This makes it easy to see the majors from lowest to highest earning.