redist.group.percent
computes the proportion that a group makes up in
each district across a matrix of maps.
group_frac(
map,
group_pop,
total_pop = map[[attr(map, "pop_col")]],
.data = cur_plans()
)
redist.group.percent(plans, group_pop, total_pop, ncores = 1)
a redist_map
object
A numeric vector with the population of the group for every precinct.
A numeric vector with the population for every precinct.
a redist_plans
object
A matrix with one row for each precinct and one column for each map. Required.
Number of cores to use for parallel computing. Default is 1.
matrix with percent for each district
data(fl25)
data(fl25_enum)
cd <- fl25_enum$plans[, fl25_enum$pop_dev <= 0.05]
redist.group.percent(plans = cd,
group_pop = fl25$BlackPop,
total_pop = fl25$TotPop)
#> [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8]
#> [1,] 0.15569 0.19637 0.177320 0.177320 0.172667 0.172667 0.16053 0.162539
#> [,9] [,10] [,11] [,12] [,13] [,14] [,15] [,16]
#> [1,] 0.142972 0.182796 0.182796 0.15479 0.15159 0.15870 0.191546 0.191546
#> [,17] [,18] [,19] [,20] [,21] [,22] [,23] [,24]
#> [1,] 0.175916 0.175916 0.065701 0.065701 0.055238 0.081932 0.081932 0.052479
#> [,25] [,26] [,27] [,28] [,29] [,30] [,31] [,32]
#> [1,] 0.12112 0.051501 0.070945 0.13226 0.171770 0.067677 0.067677 0.15923
#> [,33] [,34] [,35] [,36] [,37] [,38] [,39] [,40]
#> [1,] 0.090424 0.142020 0.15672 0.072963 0.059096 0.14374 0.135781 0.12702
#> [,41] [,42] [,43] [,44] [,45] [,46] [,47] [,48]
#> [1,] 0.12702 0.12302 0.123022 0.057485 0.134208 0.16716 0.150167 0.158729
#> [,49] [,50] [,51] [,52] [,53] [,54] [,55] [,56]
#> [1,] 0.195477 0.178413 0.16995 0.127858 0.11581 0.11581 0.115813 0.11963
#> [,57] [,58] [,59] [,60] [,61] [,62] [,63] [,64]
#> [1,] 0.099131 0.099131 0.144763 0.142555 0.134017 0.117300 0.133355 0.13532
#> [,65] [,66] [,67] [,68] [,69] [,70] [,71] [,72] [,73]
#> [1,] 0.13532 0.11023 0.17060 0.145246 0.16092 0.17032 0.15805 0.173717 0.130748
#> [,74] [,75] [,76] [,77] [,78] [,79] [,80] [,81]
#> [1,] 0.155913 0.17097 0.094771 0.16252 0.191966 0.114451 0.238294 0.208378
#> [,82] [,83] [,84] [,85] [,86] [,87] [,88] [,89]
#> [1,] 0.183832 0.201341 0.236634 0.14754 0.192347 0.177133 0.202074 0.20462
#> [,90] [,91] [,92] [,93] [,94] [,95] [,96] [,97]
#> [1,] 0.193517 0.19325 0.200559 0.19228 0.157006 0.18373 0.217294 0.217588
#> [,98] [,99] [,100] [,101] [,102] [,103] [,104] [,105]
#> [1,] 0.260531 0.254680 0.19228 0.188738 0.180280 0.252700 0.22160 0.215317
#> [,106] [,107] [,108] [,109] [,110] [,111] [,112] [,113]
#> [1,] 0.14906 0.213492 0.261208 0.18550 0.199492 0.20472 0.269151 0.213696
#> [,114] [,115] [,116] [,117] [,118] [,119] [,120] [,121]
#> [1,] 0.235920 0.21801 0.241570 0.18053 0.222050 0.255232 0.256347 0.279312
#> [,122] [,123] [,124] [,125] [,126] [,127] [,128] [,129]
#> [1,] 0.19324 0.153093 0.169385 0.238522 0.243288 0.196412 0.229331 0.252595
#> [,130] [,131] [,132] [,133] [,134] [,135] [,136] [,137]
#> [1,] 0.237543 0.23977 0.263258 0.13197 0.222708 0.262525 0.21944 0.222681
#> [,138] [,139] [,140] [,141] [,142] [,143] [,144] [,145]
#> [1,] 0.19521 0.172758 0.258560 0.230694 0.254556 0.213716 0.271380 0.175888
#> [,146] [,147] [,148] [,149] [,150] [,151] [,152] [,153]
#> [1,] 0.251596 0.22541 0.242463 0.254165 0.280205 0.240785 0.242396 0.276500
#> [,154] [,155] [,156] [,157] [,158] [,159] [,160] [,161]
#> [1,] 0.259430 0.191629 0.194680 0.251692 0.267875 0.263438 0.234389 0.261348
#> [,162] [,163] [,164] [,165] [,166] [,167] [,168] [,169]
#> [1,] 0.270047 0.26429 0.235789 0.210129 0.224806 0.260091 0.15462 0.262091
#> [,170] [,171] [,172] [,173] [,174] [,175] [,176] [,177]
#> [1,] 0.21758 0.253622 0.263679 0.274207 0.253509 0.248728 0.257506 0.277850
#> [,178] [,179] [,180] [,181] [,182] [,183] [,184] [,185]
#> [1,] 0.253120 0.26641 0.21898 0.275090 0.272856 0.26518 0.268874 0.247796
#> [,186] [,187] [,188] [,189] [,190] [,191] [,192]
#> [1,] 0.23144 0.25883 0.222882 0.26312 0.233113 0.227284 0.218911
#> [ reached getOption("max.print") -- omitted 2 rows ]