This function opens a dialog window for the user to select the desired merge method. The dialog window looks like this.
Figure: Dialog to select your merge type
Select your desired merge type. If you select "similar ratio", you will also need to supply two variables. Then click on one of the following buttons.
Click Next
to continue to the next step.
Click Cancel
to end GAT.
Click Back
to return to the previous step.
Click Help
to get further guidance and open this manual.
inputGATmerge(
shp,
aggvar,
aggvar2,
step = 8,
limitdenom = TRUE,
mergevars = NULL,
backopt = TRUE
)
Spatial layer.
String denoting the name of the first aggregation variable in the data frame.
String denoting the name of the second aggregation variable in the data frame.
Integer step in the GAT program, for help reference.
Boolean denoting whether to force denominators in rates and ratios to contain only non-zero values.
List of variables created by the function if pre-defined.
Boolean denoting whether to include the back button.
For the "similar" method, in which two variables are compared, the function reads in a list of numeric variables from the dataset. For the "least" method, the function reads in the names of the aggregation variables.
This function returns a list with the following elements:
The merge option chosen. Options include "least", "closest", and "similar".
The numerator in the ratio that compares variables if "similar" is the method chosen. This variable will also hold the value for "back" or "cancel", if the user selects one of those.
The denominator in the ratio that compares variables if "similar" is the method chosen. The list of options removes variables with values that equal 0 or non-finite values. If there are no suitable variables, the list will be blank.
if (interactive()) {
# make your selections and click "OK"
inputGATmerge(shp = hftown, aggvar = "TOTAL_POP", aggvar2 = "W_TOT")
}
#> $similar1
#> [1] "cancel"
#>
#> $similar2
#> [1] "NONE"
#>
#> $mergeopt1
#> [1] "0"
#>
#> $centroid
#> [1] "geographic"
#>