# An Open-Source R Package for Building and Using US Environmentally-Extended Input-Output Models
## 2 Materials & Methods
### Model Initialization  
The first step in the model building process is to initialize the model according to the input model name, and paths to configuration files if provided. This step establishes the scope, e.g., single-region or two-region, and focus, e.g., specific or all environmental impacts, of the model. model <- initializeModel(modelname, configpaths)  
If the desired model is available in _useior_, it is initialized based on _modelname_ only, i.e., configpaths = NULL. This loads the built-in model configuration.yml file with that model name, and related aggregation/disaggregation configuration, and.yml and data.csv files. Alternatively, a user-customized model can be initialized as long as its configuration files, including model and related hybridization configuration (in.yml format only), as well as data files (in.csv format only), are prepared following the format of configuration and data files of the available models. All configuration and data files must be accessible in the user directory specified in model configuration, i.e., configpaths = user_directory. Model initialization returns a model object in list form that contains two elements: model specs and crosswalk. Specs stored the model specifications sourced directly from the model configuration files include:  
* Basic information including the name of the model, model region acronym, model type, and pointers to hybridization, such as aggregation and disaggregation;
* Basic IO specifications including base IO schema, base IO level, IO year, model region acronym, IO data source, base price type, base with redefinitions or not, commodity or industry type, and scrap included or not;
* Satellite table specifications including the name of environmental satellite tables, years represented by flows included in the satellite table, path of the source file, source category used for sectors in the satellite table, year and level of resolution of the sectors, original flow source, function name for additional processing of the satellite table, and metadata of satellite table;
* Indicator specifications including name, code, group, and unit of indicator, path of the source file, function name and parameters for additional processing of the indicator, and metadata of indicator; and
* Demand vectors specifications including a pointer to default demand vectors (i.e., a production vector, a consumption vector, and domestic version of the two vectors), and optional demand vectors, such as household purchase that contains name, type, year, system, and location information. \begin{table}
\begin{tabular}{l l l l l l} \hline \hline
**Model Name** & **Description** & **Number of Sector** & \
\begin{tabular}{l} **Number of** \\ **Impact Category** \\ \end{tabular} & **IO Data Year** &
\begin{tabular}{l} **Environmental** \\ **Data Years** \\ \end{tabular} \\ \hline \hline \multicolumn{5}{l}{A detail level commodity model with waste sector disaggregation and full life cycle inventory, including updated satellite tables with UIDs} \\ \hline \multicolumn{5}{l}{A detail level commodity model with waste} \\ \hline \multicolumn{5}{l}{A detail level commodity model with waste sector disaggregation and electricity sector aggregation and disaggregation} \\ \hline \multicolumn{5}{l}{A detail level commodity model with life cycle inventory of greenhouse gas (GHG)} \\ \hline \multicolumn{5}{l}{A detail level industry model with life cycle inventory of greenhouse gas} \\ \hline \multicolumn{5}{l}{A summary level commodity model with life cycle inventory of greenhouse gas} \\ \hline \multicolumn{5}{l}{A summary level commodity model with life cycle inventory of greenhouse gas} \\ \hline \hline \end{tabular}
\end{table} 
Table 1: _Cont._The crosswalk is a sector correspondence table of five columns for sets of BEA and NAICS codes, and any custom codes used in the current model:  
1. NAICS--2- to 6-digit NAICS codes (7-10 digit codes exist for manufacturing and mining industries);
2. BEA_Sector--code used at the BEA sector level;
3. BEA_Summary--code used at the BEA summary level
4.