This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
library(tidyverse) | |
library(sf) | |
#Join population data to tract boundaries and convert to point coordinates | |
tractdata<-read_csv("nhgis0105_2017_tract_racepov.csv") #Data on population downloaded from NHGIS | |
tracts<-st_read("nhgis0101_shapefile_tl2017_us_tract_2017/US_tract_2017.shp",stringsAsFactors=FALSE) %>% #Tract boundaries downloaded from NHGIS | |
st_transform(4326) | |
tract_center<-tracts %>% | |
st_centroid() %>% | |
st_coordinates() %>% |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
library(tidyverse) | |
library(patchwork) | |
dat_wide <- tibble( | |
x = 1:3, | |
top = c(4.5, 4, 5.5), | |
middle = c(4, 4.75, 5), | |
bottom = c(3.5, 3.75, 4.5) | |
) |