-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathgat_install_instructions.Rmd
More file actions
107 lines (66 loc) · 4.04 KB
/
gat_install_instructions.Rmd
File metadata and controls
107 lines (66 loc) · 4.04 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
---
title: "Installing GAT"
author: "Abigail Stamm, New York State Department of Health"
output:
pdf_document:
toc: TRUE
keep_tex: TRUE
header-includes:
- \usepackage{fancyhdr}
- \pagestyle{fancy}
- \fancyfoot[CO,CE]{Draft revision \today}
- \fancyfoot[LE,RO]{\thepage}
- \fancypagestyle{plain}{\pagestyle{fancy}}
- \fancyhead[CO,CE]{}
- \fancyhead[LO,LE]{}
- \fancyhead[RO,RE]{}
---
```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = TRUE)
```
# About GAT
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.
# Installing R
You can download R at [https://www.r-project.org/](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.
# Installing RStudio (optional)
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/](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.
# Installing GAT
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:
```{r, eval = FALSE}
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_\<ver>.tar.gz" where \<ver> will be the package version number.
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_\<ver>.tar.gz" file, but if it does not, click the "Browse..." button. Select the file. Click "Install". Wait a few minutes while GAT installs.
# Using GAT
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,
```{r, eval = FALSE}
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,
```{r, eval = FALSE}
gatpkg::runGATprogram()
```
To learn about ways to customize GAT, check the technical notes or run the code,
```{r, eval = FALSE}
?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.
# Uninstalling GAT
To uninstall `gatpkg`, run the code,
```{r, eval = FALSE}
remove.packages("gatpkg")
```