knitr::opts_chunk$set(echo = TRUE)
The Geographic Aggregation Tool (GAT) was created to simplify the process of geographic aggregation. GAT takes a set of user-defined parameters, aggregates based on these parameters, and outputs both the resulting shapefiles and documents to help the user assess the quality of the aggregation. GAT is installed and run as a package in R. Before you can use GAT, you will need to install R.
You can download R at https://www.r-project.org/. Click on download R and select any site on the list. From there, choose your platform, then click on base. Next, click on the download link to download R.
After you have installed R, you can install RStudio, which is a wrapper that makes R more user-friendly and adds functionality, such as support for Markdown and Shiny and dedicated tabs for environments, tables, and images. RStudio is not required to run GAT.
You can download RStudio from https://rstudio.com/products/rstudio/download/. Under "RStudio Desktop Open Source License Free", click Download. Then click on the button, Download RStudio for Windows. After you have downloaded the file, install it as you would any other software program.
GAT was compiled in R version 4.2 using RStudio and devtools. GAT has also been tested in R versions 4.0 and 4.1. R version 3.5 or greater is needed to install GAT.
Before installing GAT, install the necessary packages (or check that you have them installed). One way to do this is run the following code in your R console:
libs <- c("classInt", "graphics", "grDevices", "methods", "raster", "RColorBrewer", "sf", "stats", "tcltk", "tibble", "utils") req <- unlist(lapply(libs, require, character.only = TRUE)) req <- libs[!req] if (length(req) > 0) { for (i in 1:length(req)) { install.packages(req[i]) } rm(i) } rm(req, libs)
Save the zip file for GAT. It will have a name like "gatpkg_\
In base R (not RStudio), click on "Packages" > "Install package(s) from local files...". Navigate to the gatpkg file and click "Open". Wait a few minutes while GAT installs.
If you prefer to install GAT through RStudio, click on "Tools" > "Install Packages...". In the "Install from:" drop-down, select "Package Archive File". A dialog should open immediately to select the "gatpkg_\
If you have not used GAT before, follow the tutorial vignette embedded in gatpkg
to learn how GAT works. Access the tutorial by running the code,
browseVignettes("gatpkg")
Then click on the tutorial vignette HTML link. This will walk you through many of the options and settings available in GAT using shapefiles embedded in gatpkg
.
To run the default version of GAT, you only need one line of code,
gatpkg::runGATprogram()
To learn about ways to customize GAT, check the technical notes or run the code,
?gatpkg::runGATprogram
If you have used R before, gatpkg
contains over 30 custom functions that can be modified or combined in different ways to meet your specific needs. Each of these functions has a corresponding help file that provides options and simple examples.
To uninstall gatpkg
, run the code,
remove.packages("gatpkg")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.