HARplus: Enhanced R Package for GEMPACK .har and .sl4 Files

Overview

HARplus is an R package designed to process and analyze .HAR and .SL4 files, making it easier for GEMPACK users and GTAP model researchers to handle large economic datasets. It simplifies the management of multiple experiment results, enabling faster and more efficient comparisons without complexity.

With HARplus, users can extract, restructure, and merge data seamlessly, ensuring compatibility across different tools. The processed data can be exported and used in R, Stata, Python, Julia, or any software that supports .txt, CSV, or Excel formats.

Key Features

How It Works

HARplus simplifies .HAR and .SL4 file processing. You can: - Load files and selectively extract headers. - Extract data by variable name or dimension patterns. - Group, merge, and restructure data with ease. - Pivot and export data into structured formats. - Filter subtotals and rename dimensions for clarity.

Installation

HARplus is currently under CRAN review and will be available there soon. In the meantime, install it directly from GitHub using the following command:

devtools::install_github("Bodysbobb/HARplus")

Quick Guide to HARplus

All commands in this package have several options that allow users to play around with the data more freely and efficiently, not just import and get the data. For a complete guide on HARplus functions, check out the Vignette or GitHub Vignette

Below is a categorized reference of the main functions in HARplus:

Data Importing

Data Extraction

Data Structure Summary & Comparison

Data Grouping & Processing

Data Transformation

Data Export

License & Author

HARplus is released under the MIT License. See the full license.

Author:
Pattawee Puangchit
Ph.D. Candidate, Agricultural Economics
Purdue University
Research Assistant at GTAP

Acknowledgements

Acknowledgement is due to Maros Ivanic for his work on the HARr package, which served as the foundation for HARplus. This package would not have been possible without his contributions.

GTAPViz: An Extension of HARplus for Visualization

I have developed another package specifically for visualization, particularly for GTAP users: GTAPViz

GTAP Database

Sample data used in this vignette is obtained from the GTAPv7 model and utilizes publicly available data from the GTAP 9 database. For more details about the GTAP database and model, refer to the GTAP Database.