generate_fu_allocation_template: Create a final-to-useful allocation template

View source: R/template_functions.R

generate_fu_allocation_templateR Documentation

Create a final-to-useful allocation template

Description

This function creates a blank final-to-useful allocation template on a per-country basis.

Usage

generate_fu_allocation_template(
  country,
  cache_path = PFUWorkflow::cache_info$cache_path,
  data_target = PFUWorkflow::target_names$Specified,
  fu_analysis_path_target = PFUWorkflow::target_names$fu_analysis_folder,
  fu_allocation_template_file_name = paste0(country, " FU Allocations Template"),
  ext = ".xlsx",
  output_path = file.path(drake::readd(fu_analysis_path_target, character_only = TRUE,
    path = cache_path), country) %>% dir_create_pipe(showWarnings = FALSE, recursive =
    TRUE) %>% file.path(paste0(fu_allocation_template_file_name, ext)),
  n_allocation_rows = 4,
  overwrite = FALSE
)

Arguments

country

A string, the 3-letter ISO code of the country for which a template is desired.

cache_path

See PFUWorkflow::cache_info.

data_target, fu_analysis_path_target

See PFUWorkflow::target_names.

fu_allocation_template_file_name

The file name for the template. Default is "country FU Allocations Template.ext".

ext

The output file name extension. Default is ".xlsx" for an Excel file.

output_path

The path of the output file to be created. Default uses arguments country, fu_analysis_path_target, fu_allocation_template_file_name, and ext to construct a path.

n_allocation_rows

The number of allocation rows per combination of sector and final energy carrier. Default is 4.

overwrite

Tells whether to overwrite an existing file at output+path. Default is FALSE.

Details

The only arguments used internally are country, data_target, cache_path, overwrite, n_allocation_rows, and output_path, allowing the caller to specify only output_path to override all of the path information stored in the drake cache.

Value

the path to the blank final-to-useful allocation template


MatthewHeun/SEAPSUTWorkflow documentation built on April 22, 2022, 2:21 p.m.