Skip to content

Commit

Permalink
Update configureSystemData.R
Browse files Browse the repository at this point in the history
Changed order of some list objects
  • Loading branch information
knoiva-indecon committed Jun 18, 2024
1 parent 845398a commit f5a507a
Showing 1 changed file with 9 additions and 14 deletions.
23 changes: 9 additions & 14 deletions R/configureSystemData.R
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ configureSystemData <- function(
rDataList[["stateData"]] <- list(name="stateData", data=list())

if(reshape){
rDataList[["rsData_reg" ]] <- list(name="rsData_reg" , data=list())
# rDataList[["rsData_reg" ]] <- list(name="rsData_reg" , data=list())
rDataList[["rsData_state"]] <- list(name="rsData_state", data=list())
} ### End if(reshape)

Expand All @@ -39,7 +39,7 @@ configureSystemData <- function(
###### 1. Load Excel Data ######
### Load region data
(!silent) |> ifelse("\n", "") |> paste0(msg1, "Loading region-level data...") |> message()
loadReg0 <- loadData(
loadReg0 <- loadData(
fileDir = fileDir, ### Path to project
fileName = fileName, ### Name of excel file with config information
sheetName = sheetName, ### Sheet with info about tables in config file
Expand All @@ -62,7 +62,7 @@ configureSystemData <- function(
### Reshape region data
(!silent) |> ifelse("\n", "") |> paste0(msg1, "Reshaping region-level data...") |> message()
reshapeReg0 <- loadReg0|> reshapeData(byState=F, silent=silent)
if(reshape){
if(reshape){
rDataList[["rsData_reg"]] <- reshapeReg0
} ### End if(reshape)
rm(loadReg0)
Expand Down Expand Up @@ -92,17 +92,12 @@ configureSystemData <- function(
### List of data that is the same for both state & region and not modified in configuration steps
frediNames0 <- c("fredi_config") |>
c("co_sectors", "co_sectorsRef", "co_stateSectors") |>
c("co_variants", "co_impactTypes") |>
c("co_impactYears", "co_impactYearLevels") |>
c("co_regions", "co_states") |>
c("co_models", "co_modelTypes") |>
c("co_econMultipliers", "co_scalarInfo") |>
c("co_slrScalars") |>
c("co_defaultTemps", "temp_default") |>
c("slr_cm", "slr_default") |>
c("gdp_default") |>
c("co_inputScenarioInfo", "testDev") |>
c("co_defaultScenario") # |> c("co_statePopRatios")
c("co_variants", "co_impactTypes", "co_impactYears", "co_impactYearLevels") |>
c("co_regions", "co_states", "co_models", "co_modelTypes", "co_inputScenarioInfo") |>
c("co_econMultipliers", "co_scalarInfo", "co_slrScalars") |>
c("co_defaultTemps", "temp_default", "slr_default", "gdp_default", "co_defaultScenario") |>
c("slr_cm") |>
c("testDev")
### Update objects
# sysDataList0 |> names() |> print()
frediList0 <- sysDataList0 |> (function(x){x[ names(x) %in% frediNames0 ]})()
Expand Down

0 comments on commit f5a507a

Please sign in to comment.