-
Notifications
You must be signed in to change notification settings - Fork 0
/
prep-data.R
44 lines (33 loc) · 1.19 KB
/
prep-data.R
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
# prep-data.R
library(tidyverse)
library(sf)
library(urbnmapr)
# counties_sf <- get_urbn_map("counties", sf = TRUE)
# write_rds(counties_sf, "counties_sf.rds")
counties_sf <- read_rds("counties_sf.rds")
# Sys.setenv(PATH = paste("/opt/homebrew/bin", Sys.getenv("PATH"), sep = ":"))
# Sys.setenv(PROJ_LIB = "/opt/homebrew/Cellar/proj/9.4.1/share/proj")
# Sys.setenv(GDAL_CONFIG = "/opt/homebrew/bin/gdal-config")
counties_sf <- st_transform(counties_sf, crs = 4326)
counties_sf <- counties_sf %>%
as_mapbox_source()
source("token.R")
# ipeds_green <- read_dta("ipeds&green.dta")
#
# ipeds_green_summed <- ipeds_green %>%
# group_by(unitid, greencat) %>%
# summarize(sum_cmplt_green = sum(cmplt_tot)) %>%
# filter(greencat != "") %>%
# spread(greencat, sum_cmplt_green)
#
# write_rds(ipeds_green_summed, "ipeds_green_summed.rds")
ipeds_green_summed <- read_rds("ipeds_green_summed.rds")
ipeds_green_summed <- ipeds_green_summed %>%
pivot_longer(-unitid, names_to = "greencat", values_to = "size")
# hdallyears <- read_dta("hdallyears.dta")
#
# hdallyears <- hdallyears %>%
# filter(year == 2020)
#
# write_rds(hdallyears, "hdallyears.rds")
hdallyears <- read_rds("hdallyears.rds")