DACSS601 HW2 Example
- state: state represents the 53 states in America
- total_employees: total_employees represents the number of employees in each state
A ‘tibble’ refers to a data frame
# A tibble: 53 x 2
state total_employees
<chr> <dbl>
1 AE 2
2 AK 103
3 AL 4257
4 AP 1
5 AR 3871
6 AZ 3153
7 CA 13137
8 CO 3650
9 CT 2592
10 DC 279
# ... with 43 more rows
state total_employees
Length:53 Min. : 1
Class :character 1st Qu.: 1917
Mode :character Median : 3379
Mean : 4819
3rd Qu.: 6092
Max. :19839
# A tibble: 42 x 2
state total_employees
<chr> <dbl>
1 TX 19839
2 IL 19131
3 NY 17050
4 NE 13176
5 CA 13137
6 PA 12769
7 OH 9056
8 GA 8605
9 IN 8537
10 MO 8419
# ... with 32 more rows
We are using functions filter() and arrange () to filter out the states with more than 1000 total employees and then arranging them in descending order.