This function opens a dialog window for the user to select whether the selected settings for GAT are correct. It provides the settings in list format. The dialog window looks like this.
Figure: Dialog to confirm your settings
Review your settings. Then click on one of the following buttons.
Click Yes
to confirm the settings. In GAT, the next step is
starting the aggregation process.
Click No
to reject the settings. In GAT, this returns you to step 1.
confirmGATbystep(
gatvars,
ratevars,
mergevars,
filevars,
exclist,
savekml,
step = 0
)
A list of objects created by the GAT tool. It contains the strings aggregator1, aggregator2, myidvar, boundary variable and setting, and the numbers and booleans for the aggragators' minimum and maximum values.
A list of objects needed to calculate rates. It contains the strings ratename, numerator, and denominator and the number multiplier.
A list of string objects denoting aggregation settings. It contains the merge option and desired centroids.
The names of shapefiles to read in and the name of the shapefile to save to, all without extensions.
A list of exclusion criteria to use when merging. It contains strings representing the variables var1, var2, and var3, and the conditions math1, math2, and math3, and numbers representing cutoffs val1, val2, and val3 and the number of excluded areas, flagsum.
A boolean, whether or not to save a KML file.
Integer step in the GAT program, for help reference.
This function reads in the lists created during the user input portion of the GAT tool. As such, it requires that the inputted lists contain the same elements as those generated by the GAT tool.
if (interactive()) {
gatvars <-
list(
aggregator1 = "agg1",
aggregator2 = "agg2",
myidvar = "tract",
minvalue1 = 5000,
minvalue2 = 10000,
maxvalue1 = 10000,
maxvalue2 = 15000,
boundary = "county",
rigidbound = FALSE, # within county preferred, not required
popvar = "pop",
savekml = TRUE,
numrow = 15,
exclmaxval = 2,
ismax1 = TRUE, # user selected "NONE" as maximum value
ismin2 = TRUE, # user selected "NONE" as minimum value
ismax2 = FALSE
)
mergevars <-
list(
mergeopt1 = "similar", # can be similar, closest, or least
similar1 = "ratio1",
similar2 = "ratio2",
centroid = "geographic"
)
ratevars <-
list(
ratename = "my_rate",
numerator = "case",
denominator = "pop",
multiplier = 100000,
colorname = "Blue-Green"
)
exclist <-
list(
var1 = "exclusion1",
var2 = "exclusion2",
var3 = "NONE", # flag to denote no third variable
math1 = "greater than",
math2 = "less than",
math3 = "equals",
val1 = 10000,
val2 = 50,
val3 = 0,
flagsum = 5
)
filevars <-
list(
filein = "hftown",
popfile = "hfblock",
fileout = "my_savefile",
userin = "C:/users/default/shapefiles/hftown",
userout = "C:/users/default/shapefiles/my_saves/my_savefile"
)
confirmGATbystep(
gatvars = gatvars,
ratevars = ratevars,
mergevars = mergevars,
exclist = exclist,
filevars = filevars,
step = 10
)
}
#> [1] "cancel"