scripts/sectors_sources.R

# look at sectors

proj_sectors <- distinct(proj_raw, sector) %>% rename(sector.proj = sector)
mac_sectors  <- distinct(mac_raw, sector) %>% rename(sector.mac = sector)

sector_join <- full_join(proj_sectors, sector_xwalk, by = "sector.proj") %>%
  full_join(mac_sectors, by = "sector.mac")

# confirms that the above crosswalk works

sector_join <- full_join(
  distinct(proj, sector),
  left_join(distinct(mac, sector), sector_xwalk, by = c("sector" = "mac_sector")),
  by = c("sector" = "proj_sector")
)


proj_sources <- distinct(proj, sector, source)
mac_sources  <- distinct(mac, sector, source)

source_join <- full_join(proj_sources, mac_sources, by = c("sector", "source"), suffix = c(".proj", ".mac")) %>%
  arrange(sector, source)

# conclusions: see source_designation.csv
MollieCarroll/NonCO2-Figs documentation built on April 19, 2020, 6:05 p.m.