Skip to content

Commit

Permalink
consolidate to a single file for crosswalk from industry to commodity…
Browse files Browse the repository at this point in the history
… name
  • Loading branch information
bl-young committed Feb 28, 2024
1 parent 017a5c1 commit 10b7ed0
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 411 deletions.
3 changes: 2 additions & 1 deletion data-raw/MasterCrosswalk.R
Original file line number Diff line number Diff line change
Expand Up @@ -199,8 +199,9 @@ getMasterCrosswalk <- function (year) {
BEAtoUSEEIOtoNAICS <- rbind(BEAtoUSEEIOtoNAICS, Crosswalk23, CrosswalkHSandORE, CrosswalkG, CrosswalkF, CrosswalkV)

# Add USEEIO_Commodity columns
SectortoCommodity <- utils::read.table(paste0("inst/extdata/Crosswalk_DetailIndustrytoCommodityName", year, "Schema.csv"),
SectortoCommodity <- utils::read.table("inst/extdata/Crosswalk_DetailIndustrytoCommodityNameSchema.csv",
sep = ",", header = TRUE, stringsAsFactors = FALSE, quote = "\"")
colnames(SectortoCommodity) <- c(paste0("BEA_", year, "_Detail_Code"), paste0("BEA_", year, "_Detail_Name"), "USEEIO_Name")
BEAtoUSEEIOtoNAICS <- merge(BEAtoUSEEIOtoNAICS, SectortoCommodity[, -2], by = paste("BEA_", year, "_Detail_Code", sep = ""), all.x = TRUE)

# Keep wanted columns
Expand Down
Loading

0 comments on commit 10b7ed0

Please sign in to comment.