diff --git a/DESCRIPTION b/DESCRIPTION index c15d7a7d..db149e3b 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -2,14 +2,10 @@ Package: gcamfaostat Type: Package Title: Prepare, process, and synthesize FAOSTAT data for global agroeconomic and multisector dynamic modeling Version: 1.1.0 -Date: 2024-12-1 +Date: 2025-11-11 Authors@R: c(person("Xin", "Zhao", email = "xin.zhao@pnnl.gov", role = c("cre", "aut"), comment = c(ORCID = "0000-0002-1801-4393")), person("Maksym", "Chepeliev", role = "aut", comment = c(ORCID = "0000-0001-8585-2314")), person("Pralit", "Patel", role = "aut", comment = c(ORCID = "0000-0003-3992-1061")), - person("Marshall", "Wise", role = "aut", comment = c(ORCID = "0000-0002-2718-0051")), - person("Kate", "Calvin", role = "aut", comment = c(ORCID = "0000-0003-2191-4189")), - person("Kanishka", "Narayan", role = "aut", comment = c(ORCID = "0000-0001-8483-6216")), - person("Chris", "Vernon", role = "aut", comment = c(ORCID = "0000-0002-3406-6214")), person("Pacific Northwest National Laboratory", role = "cph")) Description: Clean and balance agricultural input, trade, and supply-utilization data for GCAM and other global agroeconomic modeling. License: BSD_2_clause + file LICENSE diff --git a/R/yfaostat_Traceable_FBS_DataExport.R b/R/yfaostat_Traceable_FBS_DataExport.R index 9e0746ea..497e4350 100644 --- a/R/yfaostat_Traceable_FBS_DataExport.R +++ b/R/yfaostat_Traceable_FBS_DataExport.R @@ -48,6 +48,10 @@ module_yfaostat_Traceable_FBS_DataExport <- function(command, ...) { Curr_Envir <- environment() + # out_filename_suffix is appended to output file names, e.g., dates could be used + out_filename_suffix <- paste0("_", Sys.Date()) + out_filename_suffix <- "" + # adding dummy output ---- Metadata_GCAMFAOSTAT_Traceable_FBS <- tibble(CSV_export = MODULE_OUTPUTS) @@ -113,7 +117,7 @@ module_yfaostat_Traceable_FBS_DataExport <- function(command, ...) { output_csv_data( gcam_dataset = Nested_Mapping_SUA_To_Traceable_FBS, - out_filename = "Nested_Mapping_SUA_To_Traceable_FBS" %>% paste0("_", Sys.Date()), + out_filename = "Nested_Mapping_SUA_To_Traceable_FBS" %>% paste0(out_filename_suffix), col_type_nonyear = "ccicici", title = "Mapping of SUA items to aggregated primary commodity equivalent products by level of nestings", unit = "NA", @@ -150,14 +154,14 @@ module_yfaostat_Traceable_FBS_DataExport <- function(command, ...) { output_csv_data( gcam_dataset = SUA_2010_2022, - out_filename = "SUA_2010_2022" %>% paste0("_", Sys.Date()), + out_filename = "SUA_2010_2022" %>% paste0(out_filename_suffix), col_type_nonyear = "ccifc", title = "Supply utilization accounts for all FAO items in 2010 - 2022", unit = "1000 tonnes", code = "SCL", description = "Data is compiled and generated by gcamfaostat. Data is balanced in trade, supply_utilization, and storage", out_dir = DIR_OUTPUT_CSV, - GZIP = F) + GZIP = T) add_to_output_meta(.df = SUA_2010_2022, "SUA_2010_2022") @@ -179,14 +183,14 @@ module_yfaostat_Traceable_FBS_DataExport <- function(command, ...) { output_csv_data( gcam_dataset = SUA_Food_Calorie_Macronutrient_2010_2022, - out_filename = "SUA_Food_Calorie_Macronutrient_2010_2022" %>% paste0("_", Sys.Date()), + out_filename = "SUA_Food_Calorie_Macronutrient_2010_2022" %>% paste0(out_filename_suffix), col_type_nonyear = "ccicc", title = "SUA: food energy and macronutrient in 2010 - 2022", unit = "Mt or Mkcal", code = "SCL", description = "Data is compiled and generated by gcamfaostat. Food energy and macronutrient by iso and SUA items. Item and item code are based on FAO/gcamfaostat definitions", out_dir = DIR_OUTPUT_CSV, - GZIP = F) + GZIP = T) add_to_output_meta(.df = SUA_Food_Calorie_Macronutrient_2010_2022, "SUA_Food_Calorie_Macronutrient_2010_2022") @@ -208,14 +212,14 @@ module_yfaostat_Traceable_FBS_DataExport <- function(command, ...) { output_csv_data( gcam_dataset = Traceable_FBS_PCe_2010_2022, - out_filename = "Traceable_FBS_PCe_2010_2022" %>% paste0("_", Sys.Date()), + out_filename = "Traceable_FBS_PCe_2010_2022" %>% paste0(out_filename_suffix), col_type_nonyear = "cccc", title = "Traceable FBS: supply utilization accounts in primary equivalent for APE items in 2010 - 2022", unit = "1000 tonnes", code = "SCL", description = "Data is compiled and generated by gcamfaostat.", out_dir = DIR_OUTPUT_CSV, - GZIP = F) + GZIP = T) add_to_output_meta(.df = Traceable_FBS_PCe_2010_2022, "Traceable_FBS_PCe_2010_2022") @@ -237,14 +241,14 @@ module_yfaostat_Traceable_FBS_DataExport <- function(command, ...) { output_csv_data( gcam_dataset = Traceable_FBS_Food_Calorie_Macronutrient_2010_2022, - out_filename = "Traceable_FBS_Food_Calorie_Macronutrient_2010_2022" %>% paste0("_", Sys.Date()), + out_filename = "Traceable_FBS_Food_Calorie_Macronutrient_2010_2022" %>% paste0(out_filename_suffix), col_type_nonyear = "cccc", title = "Traceable FBS: food energy and macronutrient in 2010 - 2022", unit = "Mt or Mkcal", code = "SCL", description = "Data is compiled and generated by gcamfaostat. Food energy and macronutrient by iso and APE items", out_dir = DIR_OUTPUT_CSV, - GZIP = F) + GZIP = T) add_to_output_meta(.df = Traceable_FBS_Food_Calorie_Macronutrient_2010_2022, "Traceable_FBS_Food_Calorie_Macronutrient_2010_2022") @@ -302,14 +306,14 @@ module_yfaostat_Traceable_FBS_DataExport <- function(command, ...) { output_csv_data( gcam_dataset = Traceable_FBS_Extraction_Rate_2010_2022, - out_filename = "Traceable_FBS_Extraction_Rate_2010_2022" %>% paste0("_", Sys.Date()), + out_filename = "Traceable_FBS_Extraction_Rate_2010_2022" %>% paste0(out_filename_suffix), col_type_nonyear = "cciiccc", title = "Extraction rates used for compiling the traceable FBS dataset", unit = "NA", code = "NA", description = "Data is compiled and generated by gcamfaostat.", out_dir = DIR_OUTPUT_CSV, - GZIP = F) + GZIP = T) add_to_output_meta(.df = Traceable_FBS_Extraction_Rate_2010_2022 %>% rename(item = sink_item), "Traceable_FBS_Extraction_Rate_2010_2022") diff --git a/README.md b/README.md index f0630fcd..78729c54 100644 --- a/README.md +++ b/README.md @@ -59,7 +59,8 @@ The package is documented in the [online manual](https://jgcri.github.io/gcamfao #### 4. Run the driver * `driver_drake()` -* if `write_csv_model = GCAM` in the function, related CSV will be exported to `output/gcamfaostat_GCAM` +* if `driver_drake(write_csv_model = GCAM)`, related CSV for GCAM will be exported to `output/gcamfaostat_GCAM` +* if `driver_drake(write_csv_model = "Traceable_FBS")`, related CSV for generating traceable FBS (T-FBS) will be exported to `output/gcamfaostat_Traceable_FBS` * Users can add and design data flows for other models. #### 5. Use data and package functions diff --git a/data/GCAM_DATA_MAP.rda b/data/GCAM_DATA_MAP.rda index 714b990d..10faea14 100644 Binary files a/data/GCAM_DATA_MAP.rda and b/data/GCAM_DATA_MAP.rda differ diff --git a/docs/404.html b/docs/404.html index 307587f8..326ac1a8 100644 --- a/docs/404.html +++ b/docs/404.html @@ -32,7 +32,7 @@ gcamfaostat - 1.0.1 + 1.1.0 @@ -127,7 +127,7 @@

Page not found (404)