Lecture 9
Cornell University
INFO 2950 - Spring 2024
February 20, 2024
major_income_undergrad <- major_income_undergrad |>
mutate(major_type = if_else(major_category == stem_categories,
"STEM", "Not STEM"
))
major_income_undergrad |>
filter(major_type == "STEM", undergrad_median < 55000) |>
select(major, major_type, undergrad_median) |>
arrange(desc(undergrad_median))
# A tibble: 1 × 3
major major_type undergrad_median
<chr> <chr> <dbl>
1 Biology STEM 54000
major_income_undergrad <- major_income_undergrad |>
mutate(major_type = if_else(major_category %in% stem_categories,
"STEM", "Not STEM"
))
major_income_undergrad |>
filter(major_type == "STEM", undergrad_median < 55000) |>
select(major, major_type, undergrad_median) |>
arrange(desc(undergrad_median))
# A tibble: 7 × 3
major major_type undergrad_median
<chr> <chr> <dbl>
1 Biology STEM 54000
2 Communication Technologies STEM 52000
3 Botany STEM 50000
4 Physiology STEM 50000
5 Molecular Biology STEM 50000
6 Ecology STEM 48700
7 Neuroscience STEM 40000
read_csv()
read_tsv()
, read_delim()
, etc.read_excel()
read_arrow()
, read_parquet()
read_sas()
, read_sav()
, read_dta()
read_sheet()
fread()
1ae-07
ae-07
(repo name will be suffixed with your GitHub name).