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)

Arguments

tobemerged

A data frame, intended to be read from a shapefile DBF.

aggvar

The first variable by which polygons will be aggregated.

aggvar2

The second variable by which polygons will be aggregated.

minval

The desired minimum value at which to aggregate the first aggregation variable.

minval2

The desired minimum value at which to aggregate the second aggregation variable.

Examples

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
)