Closed cstillwellusgs closed 1 year ago
If you can also show multi-mixed regions (where 3rd, 4th, and 5th most likely regions are > 5% probability) I think that would help. But might be too complex of a map
for whenever HPC is not super slow...
`test <- tibble(a = c(0.95, 0.01, 0.02, 0.3, 0.1), b = c(0.02, 0.7, 0.1, 0.35, 0.75), c = c(0.03, 0.29, 0.88, 0.35, 0.15), id = c("01", "02", "03", "04", "05")) test1 <- select(test, -id)
test2 <- t(apply(-test1, 1, rank, ties.method = "random")) %>% as_tibble() %>% rename(rank_a = a, rank_b = b, rank_c = c)
test3 <- bind_cols(test, test2)
threshold = 0.05 test5 <- test3 %>% mutate(transition_region = case_when(rank_a == 1 & rank_b == 2 & a > threshold & b > threshold ~ "ab", rank_a == 2 & rank_b == 1 & a > threshold & b > threshold ~ "ab", rank_a == 1 & rank_c == 2 & a > threshold & c > threshold ~ "ac", rank_a == 2 & rank_c == 1 & a > threshold & c > threshold ~ "ac", rank_b == 1 & rank_c == 2 & b > threshold & c > threshold ~ "bc", rank_b == 2 & rank_c == 1 & b > threshold & c > threshold ~ "bc"))`