Closed CoryMcCartan closed 2 years ago
Fixed by 8b17c0e6
@CoryMcCartan this commit will cause a unexplained error when a column is all NAs. Maybe add | all(is.na(x))
so NAs don't propogate?
library(redist)
library(dplyr)
data(iowa)
iowa_map <- redist_map(iowa, existing_plan = cd_2010, pop_tol = 0.05)
sims <- redist_smc(iowa_map, nsims = 100, runs = 2) %>%
mutate(demv = NA)
summary(sims)
#> SMC: 200 sampled plans of 4 districts on 99 units
#> `adapt_k_thresh`=0.985 • `seq_alpha`=0.5
#> `est_label_mult`=1 • `pop_temper`=0
#> Plan diversity 80% range: 0.54 to 0.83
#> Error in `vectbl_as_col_location2()`:
#> ! Must extract column with a single valid subscript.
#> ✖ Subscript `col` can't be `NA`.
Created on 2022-06-03 by the reprex package (v2.0.1)
Good catch, thanks. NA == NA
is NA
.
dev branch
Need to drop constant columns (or NaN r-hats in general)