Learn R Programming

GTAPViz: R Package for Automating GTAP Data Processing and Visualization

Overview

GTAPViz is an R package designed to streamline the processing and visualization of GTAP-CGE results. While primarily built for GTAP simulations, it also supports other .har and .sl4 datasets.

With intuitive commands and automated adjustments, users can create, customize, and export high-quality visualizations for journal publications, economic analysis, and research reports—all with minimal coding.

Key Features

This package streamlines the creation of figures and tables from .har and .sl4 results, making academic presentations effortless. Some key features are:

  • Effortless Multi-Plot Generation – Automatically adjusts dimensions, facets, and layout with minimal input.

  • Smart Plot Adjustments – Fine-tune visuals easily without manual sizing or layout tweaks.

  • Dual Export Plot Formats – Instantly save high-resolution PNG and PDF outputs for slides, papers, and LaTeX.

  • Publication-Ready Pivot Tables – Generate clean tables alongside figures—ideal for academic papers.

  • Streamlined Styling – Customize colors, fonts, and legends through simple, flexible options.

  • Powerful Yet Simple – Built on ggplot2, with intuitive TRUE/FALSE switches—no advanced coding needed.

  • Self-Contained Help – Includes a detailed vignette and internal help—no need to search online.

Installation

GTAPViz can be installed from GitHub using the following command in R:

devtools::install_github("Bodysbobb/GTAPViz")

Package Helps

The most interactive package help is available via ChatGPT GTAPViz, specifically designed to assist with the GTAPViz package!

For complete instructions on using this package and exploring practical examples:

GTAP Users

For GTAP users seeking minimal or no code modifications, please visit GTAPViz for GTAP Users.

Useful Packages for CGE Fellows

Author:

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

Copy Link

Version

Install

install.packages('GTAPViz')

Monthly Downloads

206

Version

1.1.3

License

MIT + file LICENSE

Maintainer

Pattawee Puangchit

Last Published

April 19th, 2025

Functions in GTAPViz (1.1.3)

report_table

Generate a Structured Report Table
create_export_config

Create an Export Configuration
convert_units

Convert Units in GTAP Data
auto_gtap_data

Process GTAP Data Automation with Flexible Output Options
detail_plot

Create Comprehensive Bar Charts from HAR and SL4 Data
add_mapping_info

Add Mapping Information to GTAP Data
create_plot_style

Create a Plot Style Configuration
comparison_plot

Create Comparative Bar Charts from HAR and SL4 Data
.coalesce

Coalesce Two Values
create_title_format

Create a Title Format Configuration
get_all_config

Print Plot and Export Configuration Snippets
get_color_palette

Print and Visualize Themed Color Palettes
pivot_table_with_filter

Export Data as an Excel Pivot Table
rename_value

Rename Values in a Column
stack_plot

Create Stacked Bar Charts for Decomposition Analysis
sort_plot_data

Sort GTAP Plot Data