Skip to content

Commit

Permalink
added version column
Browse files Browse the repository at this point in the history
  • Loading branch information
cyyllam committed Nov 10, 2022
1 parent 8faa346 commit 4013b72
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion ofm/convert_format_saep.R
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ filename <- "saep_block20.csv"
id.cols <- c("STATEFP", "COUNTYFP", "TRACTCE", "BLOCKCE", "GEOID20")
counties <- c("33", "35", "53", "61")
years <- c(as.character(2020:2022))
version <- 'October 14, 2022' # taken from OFM block metadata

# functions ---------------------------------------------------------------

Expand All @@ -24,7 +25,7 @@ filter.for.psrc <- function(table) {
attributes <- c("POP", "HHP","GQ", "HU", "OHU")
cols <- apply(expand.grid(attributes, years), 1, function(x) paste0(x[1], x[2])) # create all combinations of years & attributes
allcols <- c(id.cols, cols)
dt <- dt[, ..allcols]
dt <- dt[, ..allcols][, VERSION := version]
}

convert.file <- function(filename, inputfileformat, outputfileformat){
Expand Down

0 comments on commit 4013b72

Please sign in to comment.