Skip to content

Commit

Permalink
fix RData load var name error
Browse files Browse the repository at this point in the history
  • Loading branch information
yhanw0719 committed Jul 13, 2022
1 parent 07c68a8 commit d819599
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions main.R
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ if(useparser){
option_list <- list(
make_option(c("--input_fname"), dest="input_fname", action="store", help="name of VMT input file", default="Sample_Input.csv" ),
make_option(c("--output_fname"), dest="output_fname", action="store", help="name of output file", default="Sample_Output.csv" ),
make_option(c("--emis_inputfname"), dest="emis_inputfname", action="store", help="name of NEI input file", default="nei_isrm_summary_state_new.csv"),
make_option(c("--emis_category"), dest="emis_category", action='store', help="emission category in NEI input file", default="Gas LD Veh."),
make_option(c("--emis_inputfname"), dest="emis_inputfname", action="store", help="name of NEI input file", default="nei_isrm_summary_state_onroad.csv"),
make_option(c("--emis_category"), dest="emis_category", action='store', help="emission category in NEI input file", default="Onroad"),
make_option(c("--basedir"), dest="basedir", action="store", help="working dir", default="/" ),
make_option(c("--codedir"), dest="codedir", action="store", help="base dir where R code is located", default="/opt/gitrepo/BILD-AQ/" ),
make_option(c("--PMfactor"), dest="PMfactor", action="store", help="% PM25 change = PMfactor * % VMT change", default=0)
Expand Down
8 changes: 4 additions & 4 deletions process_VMT.R
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,12 @@ state_map = data.frame(
state_names = state_map[state_map$code %in% state_codes,'name']

## load Rdata of those states
network_isrm_all = NULL
network_isrm = NULL
for (state_name in state_names){
load(file=file.path(inputdir,paste0('network_isrm_',state_name,'.RData')))
network_isrm_all = rbind(network_isrm_all, network_isrm)
load(file=file.path(inputdir,'HPMS',paste0('network_isrm_',state_name,'.RData')))
network_isrm = rbind(network_isrm, hpms_tract_isrm)
}
network_isrm = network_isrm_all[,c('GEOID','isrm','lanemiles')]
network_isrm = network_isrm[,c('GEOID','isrm','lanemiles')]

## convert tract VMT to ISRM VMT
vmt_isrm <- data.frame(network_isrm) %>%
Expand Down

0 comments on commit d819599

Please sign in to comment.