Introduction

This manual is designed for GTAP users.
For a comprehensive guide, please refer to the GTAPViz Vignette.

This document requires the following R scripts, aligned with the navigation menu:

  • 1.ProjectSetup.R β€” 1. Project Setup
  • 2.PlotGens.R β€” 2. Plotting
  • 3.TableGens.R β€” 3. Table

If you do not have these R script files (located in the GTAPViz-user folder), please download the ZIP file:
πŸ“ GTAPViz-R-GTAPusers-code


πŸ“Œ Recommended: Run the following code in R to download and unzip automatically:
Download and Unzip R scripts
# ==== 1. USER SETUP (define the full path e.g., "C:/Users/YourName/Documents") ====
output_dir <- "D:/One Drive/OneDrive - purdue.edu"


# ==== 2. DO NOT CHANGE BELOW THIS LINE ====
if (!dir.exists(output_dir)) dir.create(output_dir, recursive = TRUE)
zip_url <- "https://github.com/Bodysbobb/GTAPViz-R-GTAPuser/raw/main/GTAPViz-user.zip"
zip_file <- tempfile(fileext = ".zip")
download.file(zip_url, zip_file, mode = "wb")
unzip(zip_file, exdir = output_dir)
setwd(output_dir)

message("βœ… GTAPViz user scripts saved to:\n")
message(paste0("file:///", normalizePath(output_dir, winslash = "/")), "\n")

# Open the folder in Windows Explorer
# src 
shell.exec(normalizePath(paste0(output_dir,"/GTAPViz-user/src")))
# map
shell.exec(normalizePath(paste0(output_dir,"/GTAPViz-user/map")))

Package Installation

Copy and paste the following code into your R script, then run it to install GTAPViz from CRAN:

# Install the GTAPViz package (note: case-sensitive)
install.packages("GTAPViz")

# Check the installed version of GTAPViz
library(GTAPViz)
packageVersion("GTAPViz")

Package Helps

Programs

If you don’t have RStudio (or Visual Studio Code with R language support) installed yet, please install either of them first.