From 0a389fdc01f6a53862965b5901bd42d0bff46387 Mon Sep 17 00:00:00 2001 From: Ben Young Date: Tue, 6 Jun 2023 15:09:15 -0400 Subject: [PATCH 1/2] add two region UsewithTrade to model outputs --- R/BuildModel.R | 1 + 1 file changed, 1 insertion(+) diff --git a/R/BuildModel.R b/R/BuildModel.R index 7a7bf68..fdd802f 100644 --- a/R/BuildModel.R +++ b/R/BuildModel.R @@ -653,6 +653,7 @@ assembleTwoRegionIO <- function(year, iolevel) { ## Two-region Domestic Use table with interregional exports and imports TwoRegionIO[["DomesticUsewithTrade"]][[state]] <- TwoRegionDomesticUseModel[1:4] + TwoRegionIO[["UsewithTrade"]][[state]] <- TwoRegionUseModel[1:4] ## Two-region Commodity Output SoI_CommodityOutput <- rowSums(TwoRegionDomesticUseModel[["SoI2SoI"]][, c(industries, FD_cols, ITA_col, "ExportResidual")]) + From de7f2371d07c84257f453457ed4c3274af3a91e4 Mon Sep 17 00:00:00 2001 From: Ben Young Date: Mon, 17 Jul 2023 14:56:22 -0400 Subject: [PATCH 2/2] update data commons url --- R/UtilityFunctions.R | 8 ++++---- format_specs/OneRegionData.md | 2 +- format_specs/TwoRegionData.md | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/R/UtilityFunctions.R b/R/UtilityFunctions.R index f69f379..3a66383 100644 --- a/R/UtilityFunctions.R +++ b/R/UtilityFunctions.R @@ -174,7 +174,7 @@ getFlowsaData <- function(dataname, year) { # Define file directory directory <- file.path(rappdirs::user_data_dir(), subdirectory) if (!file.exists(file.path(directory, filename))) { - url <- paste0("https://edap-ord-data-commons.s3.amazonaws.com/", subdirectory) + url <- paste0("https://dmap-data-commons-ord.s3.amazonaws.com/", subdirectory) logging::loginfo(paste0("file not found, downloading from ", url)) # Check for and create directory if necessary if (!file.exists(directory)) { @@ -197,7 +197,7 @@ getFlowsaData <- function(dataname, year) { #' "flowsa/FlowByActivity". #' @return A dataframe of StateIO data registry on Data Commons. getRegistryonDataCommons <- function(data_group = "stateio") { - registry_ls <- aws.s3::get_bucket(bucket = "edap-ord-data-commons", + registry_ls <- aws.s3::get_bucket(bucket = "dmap-data-commons-ord", prefix = data_group) registry <- cbind.data.frame(basename(sapply(registry_ls, `[[`, "Key")), sapply(registry_ls, `[[`, "LastModified"), @@ -251,7 +251,7 @@ downloadStateIODatafromDataCommons <- function(filename, ver = NULL) { f <- paste0(paste(filename, ver, sep = "_"), ".rds") } # Download file - url <- "https://edap-ord-data-commons.s3.amazonaws.com/stateio" + url <- "https://dmap-data-commons-ord.s3.amazonaws.com/stateio" utils::download.file(file.path(url, f), file.path(directory, f), mode = "wb", quiet = TRUE) } @@ -296,7 +296,7 @@ loadStateIODataFile <- function(filename, ver = NULL) { "not found in local data directory, either.")) message("Please confirm ", filename, " is correctly spelled. ", "You should be able to find the correctly spelled file on ", - "https://edap-ord-data-commons.s3.amazonaws.com/index.html?prefix=stateio/. ", + "https://dmap-data-commons-ord.s3.amazonaws.com/index.html?prefix=stateio/. ", "If it's not found there, please open an issue at ", "https://github.com/USEPA/stateior/issues/new ", "and inform package maintainers.\n", diff --git a/format_specs/OneRegionData.md b/format_specs/OneRegionData.md index ff6d75a..840114e 100644 --- a/format_specs/OneRegionData.md +++ b/format_specs/OneRegionData.md @@ -12,7 +12,7 @@ One region IO data created by `stateior` are data for single states saved as `.r | Commodity Output | State_Summary_CommodityOutput_`year`_`version` | numeric vector | [Output Vectors](https://github.com/USEPA/useeior/blob/v1.1.0/format_specs/Model.md#output-vectors) | | Industry Output | State_Summary_IndustryOutput_`year`_`version` | numeric vector | [Output Vectors](https://github.com/USEPA/useeior/blob/v1.1.0/format_specs/Model.md#output-vectors)| -1 Data names on [Data Commons](https://edap-ord-data-commons.s3.amazonaws.com/index.html?prefix=stateio/). `year` and `version` are subject to change. +1 Data names on [Data Commons](https://dmap-data-commons-ord.s3.amazonaws.com/index.html?prefix=stateio/). `year` and `version` are subject to change. 2 These Use tables add, as the final column, the international trade adjustment (ITA) containing the value of all transportation and insurance services and customs duties diff --git a/format_specs/TwoRegionData.md b/format_specs/TwoRegionData.md index c86e36b..edc350c 100644 --- a/format_specs/TwoRegionData.md +++ b/format_specs/TwoRegionData.md @@ -19,7 +19,7 @@ Each two-region matrix has a four-quadrant structure. In each matrix, `SoI` is r | Commodity Output | TwoRegion_Summary_CommodityOutput_`year`_`version` | numeric vector | [Two-region total output by commodity](#Two-Region-Output-Vectors) | | Industry Output | TwoRegion_Summary_IndustryOutput_`year`_`version` | numeric vector | [Two-region total output by industry](#Two-Region-Output-Vectors) | -1 Data names on [Data Commons](https://edap-ord-data-commons.s3.amazonaws.com/index.html?prefix=stateio/). `year` and `version` are subject to change. +1 Data names on [Data Commons](https://dmap-data-commons-ord.s3.amazonaws.com/index.html?prefix=stateio/). `year` and `version` are subject to change. ### Two Region Make The two-region Make is an `industry x commodity` matrix with amounts of commodities (in model year USD) being made by industries.