This function calculates the observation with the highest aggregation value, which will be the next observation merged in the full program. The minimum value must be greater than zero, but is only important if there are two aggregation variables.
identifyGATfirstobs(tobemerged, aggvar, aggvar2, minval, minval2)
A data frame, intended to be read from a shapefile DBF.
The first variable by which polygons will be aggregated.
The second variable by which polygons will be aggregated.
The desired minimum value at which to aggregate the first aggregation variable.
The desired minimum value at which to aggregate the second aggregation variable.
aggvar <- "TOTAL_POP" # identify the aggregation variable
minvalue <- 5000 # identify the minimum value
# observation with the highest POP2010
my_firstobs <- identifyGATfirstobs(
tobemerged = hftown,
aggvar = aggvar,
aggvar2 = aggvar, # repeat aggvar if only one variable
minval = minvalue,
minval2 = minvalue # repeat minval if only one variable
)