Lecture 8
Cornell University
INFO 5001 - Fall 2024
September 24, 2024
college_recent_grads <- college_recent_grads |>
mutate(major_type = if_else(major_category == stem_categories,
"STEM", "Not STEM"
))
college_recent_grads |>
filter(major_type == "STEM", median < 55000) |>
select(major, median) |>
arrange(desc(median))
# A tibble: 20 × 2
major median
<chr> <dbl>
1 Architectural Engineering 54000
2 Electrical Engineering Technology 52000
3 Environmental Engineering 50000
4 Industrial Production Technologies 46000
5 Nuclear, Industrial Radiology, And Biological Technologies 46000
6 Mathematics 45000
7 Physics 45000
8 Information Sciences 45000
9 Pharmacology 45000
10 Engineering And Industrial Management 44000
11 Computer Programming And Data Processing 41300
12 Architecture 40000
13 Mechanical Engineering Related Technologies 40000
14 Microbiology 38000
15 Computer Administration Management And Security 37500
16 Environmental Science 35600
17 Communication Technologies 35000
18 Neuroscience 35000
19 Ecology 33000
20 Zoology 26000
college_recent_grads <- college_recent_grads |>
mutate(major_type = if_else(major_category %in% stem_categories,
"STEM", "Not STEM"
))
college_recent_grads |>
filter(major_type == "STEM", median < 55000) |>
select(major, median) |>
arrange(desc(median))
# A tibble: 47 × 2
major median
<chr> <dbl>
1 Architectural Engineering 54000
2 Computer Science 53000
3 Electrical Engineering Technology 52000
4 Materials Engineering And Materials Science 52000
5 Civil Engineering 50000
6 Miscellaneous Engineering 50000
7 Environmental Engineering 50000
8 Engineering Technologies 50000
9 Geological And Geophysical Engineering 50000
10 Industrial Production Technologies 46000
# ℹ 37 more rows
read_csv()
read_tsv()
, read_delim()
, etc.read_excel()
read_arrow()
, read_parquet()
read_sas()
, read_sav()
, read_dta()
read_sheet()
fread()
1ae-06
ae-06
(repo name will be suffixed with your GitHub name).renv::restore()
to install the required packages, open the Quarto document in the repo, and follow along and complete the exercises.