# excel file
data <- read_excel("Salaries.xlsx")
data
## # A tibble: 397 × 6
## rank discipline yrs.since.phd yrs.service sex salary
## <chr> <chr> <dbl> <dbl> <chr> <dbl>
## 1 Prof B 19 18 Male 139750
## 2 Prof B 20 16 Male 173200
## 3 AsstProf B 4 3 Male 79750
## 4 Prof B 45 39 Male 115000
## 5 Prof B 40 41 Male 141500
## 6 AssocProf B 6 6 Male 97000
## 7 Prof B 30 23 Male 175000
## 8 Prof B 45 45 Male 147765
## 9 Prof B 21 20 Male 119250
## 10 Prof B 18 18 Female 129000
## # … with 387 more rows
filter(data, rank == "Prof")
## # A tibble: 266 × 6
## rank discipline yrs.since.phd yrs.service sex salary
## <chr> <chr> <dbl> <dbl> <chr> <dbl>
## 1 Prof B 19 18 Male 139750
## 2 Prof B 20 16 Male 173200
## 3 Prof B 45 39 Male 115000
## 4 Prof B 40 41 Male 141500
## 5 Prof B 30 23 Male 175000
## 6 Prof B 45 45 Male 147765
## 7 Prof B 21 20 Male 119250
## 8 Prof B 18 18 Female 129000
## 9 Prof B 20 18 Male 104800
## 10 Prof B 12 3 Male 117150
## # … with 256 more rows
arrange(data, desc(salary))
## # A tibble: 397 × 6
## rank discipline yrs.since.phd yrs.service sex salary
## <chr> <chr> <dbl> <dbl> <chr> <dbl>
## 1 Prof B 38 38 Male 231545
## 2 Prof A 43 43 Male 205500
## 3 Prof A 29 7 Male 204000
## 4 Prof A 42 18 Male 194800
## 5 Prof B 26 19 Male 193000
## 6 Prof B 49 60 Male 192253
## 7 Prof B 34 33 Male 189409
## 8 Prof B 56 49 Male 186960
## 9 Prof A 33 18 Male 186023
## 10 Prof A 39 9 Male 183800
## # … with 387 more rows
select(data, rank, discipline, yrs.since.phd, salary)
## # A tibble: 397 × 4
## rank discipline yrs.since.phd salary
## <chr> <chr> <dbl> <dbl>
## 1 Prof B 19 139750
## 2 Prof B 20 173200
## 3 AsstProf B 4 79750
## 4 Prof B 45 115000
## 5 Prof B 40 141500
## 6 AssocProf B 6 97000
## 7 Prof B 30 175000
## 8 Prof B 45 147765
## 9 Prof B 21 119250
## 10 Prof B 18 129000
## # … with 387 more rows
mutate(data,
gain = desc(yrs.since.phd - yrs.service))
## # A tibble: 397 × 7
## rank discipline yrs.since.phd yrs.service sex salary gain
## <chr> <chr> <dbl> <dbl> <chr> <dbl> <dbl>
## 1 Prof B 19 18 Male 139750 -1
## 2 Prof B 20 16 Male 173200 -4
## 3 AsstProf B 4 3 Male 79750 -1
## 4 Prof B 45 39 Male 115000 -6
## 5 Prof B 40 41 Male 141500 1
## 6 AssocProf B 6 6 Male 97000 0
## 7 Prof B 30 23 Male 175000 -7
## 8 Prof B 45 45 Male 147765 0
## 9 Prof B 21 20 Male 119250 -1
## 10 Prof B 18 18 Female 129000 0
## # … with 387 more rows
These graphs show that the more time spent in working in their industries, then the higher their salary will become over time. A good amount of people who have higher salaries will be able to work their way up in a company and/or industry. These are also the type of people who not only know a lot more than other who are just starting out, but they will able to work a lot better to provide more for the company.