This function opens a dialog window for the user to select the settings to calculate the rate for a map, if so desired. The dialog window looks like this.
Figure: Dialog to select your rate settings
Select your desired rate settings. If you do not want to calculate a rate, check the box at the top. If you do want to calculate a rate, sselect the desired numerator, denominator, and color scheme from the drop-down lists. Name your rate something other than "no_rate", the flag that tells GAT a rate should not be calculated. 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.
inputGATrate(
shp,
defaultopt = 0,
help = "There is no help for you.",
limitdenom = TRUE,
step = 9,
ratevars = NULL,
backopt = TRUE
)
The layer from which to select variables.
An integer that notes which initial list item should be highlighted.
A text string containing the help message.
A boolean denoting whether to limit the denominator to only variables without zeroes or missings before aggregation.
Integer step in the GAT program, for help reference.
Rate settings, if pre-defined.
Boolean denoting whether to include the back button.
Change the limitdenom option from FALSE to TRUE in step 9 (requesting rate
calculation information) in runGATprogram
if you want to
allow only denominators with finite, non-zero values.
This function returns a list with the following elements:
What to call the rate. The default is "gat_rate". If the user chooses not to calculate a rate, the value is set to "no_rate" to indicate that rate calculations should not be done later. This variable also holds the value for "back" or "cancel", if the user selects one of those.
The name of the numerator variable for the rate.
The name of the denominator variable for the rate.
The number by which to multiply the rate. If the user includes commas, they will be removed.
The ColorBrewer color scheme to use when mapping the rate later.
The formal name of the selected ColorBrewer color scheme.
if (interactive()) {
inputGATrate(shp = hftown, help = "Select your options.", limitdenom = FALSE)
}
#> $ratename
#> [1] "cancel"
#>
#> $numerator
#> [1] "NONE"
#>
#> $denominator
#> [1] "NONE"
#>
#> $multiplier
#> [1] "0"
#>
#> $colorname
#> [1] "NONE"
#>
#> $colorscheme
#> character(0)
#>