From d819599e096778c25f110f2f69003b31ee925576 Mon Sep 17 00:00:00 2001 From: yhanw0719 <62628137+yhanw0719@users.noreply.github.com> Date: Wed, 13 Jul 2022 16:10:37 -0700 Subject: [PATCH] fix RData load var name error --- main.R | 4 ++-- process_VMT.R | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/main.R b/main.R index 16b289f..974f7bf 100644 --- a/main.R +++ b/main.R @@ -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) diff --git a/process_VMT.R b/process_VMT.R index c32d7a4..b0d0e0e 100644 --- a/process_VMT.R +++ b/process_VMT.R @@ -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) %>%