This function cleans up the code to flag areas based on exclusion criteria so that they will not be used in the merge.
calculateGATexclusions(d, var, math, val)
The dataset containing the flag and exclusion variables.
The variable to use when calculating exclusions.
The condition to use when calculating exclusions. Recognized conditions include "equals", "less than", "greater than".
The value to compare to var
based on the condition selected.
calculateGATexclusions(d = hftown, var = "TOTAL_POP",
math = "less than", val = 1000)
#> Simple feature collection with 21 features and 8 fields
#> Attribute-geometry relationship: 7 constant, 0 aggregate, 0 identity, 1 NA's
#> Geometry type: MULTIPOLYGON
#> Dimension: XY
#> Bounding box: xmin: -74.86813 ymin: 42.98286 xmax: -74.04656 ymax: 44.12058
#> Geodetic CRS: +proj=longlat +datum=NAD27
#> First 10 features:
#> TOWN ID COUNTY AREALAND AREAWATR TOTAL_POP MY_FLAG
#> 1 Bleecker 035\\06882 035 148175370 5831674 573 0
#> 2 Broadalbin 035\\08433 035 82166307 20853757 5066 0
#> 3 Caroga 035\\12573 035 131696633 8774235 1407 1
#> 4 Ephratah 035\\24603 035 101576541 578556 1693 0
#> 5 Gloversville 035\\29443 035 13187984 13599 15413 0
#> 6 Johnstown City 035\\38781 035 12588379 16814 8511 0
#> 7 Johnstown 035\\38792 035 181852496 3009850 7166 0
#> 8 Mayfield 035\\46217 035 151343307 16212224 6432 0
#> 9 Northampton 035\\51407 035 54516993 35414661 2760 0
#> 10 Oppenheim 035\\55101 035 145745641 478206 1774 0
#> geometry GATflag
#> 1 MULTIPOLYGON (((-74.43194 4... 1
#> 2 MULTIPOLYGON (((-74.16108 4... 0
#> 3 MULTIPOLYGON (((-74.55706 4... 0
#> 4 MULTIPOLYGON (((-74.53326 4... 0
#> 5 MULTIPOLYGON (((-74.36883 4... 0
#> 6 MULTIPOLYGON (((-74.38627 4... 0
#> 7 MULTIPOLYGON (((-74.29606 4... 0
#> 8 MULTIPOLYGON (((-74.20821 4... 0
#> 9 MULTIPOLYGON (((-74.13178 4... 0
#> 10 MULTIPOLYGON (((-74.72027 4... 0