Fixing str_split

This commit is contained in:
Louis 2026-02-09 15:53:17 +01:00
parent 5f922c1453
commit 3477c6e123

View file

@ -64,7 +64,7 @@ plot_mat <- function(matrix, rank) {
matrix %>%
as_tibble(rownames = "Var1") %>%
pivot_longer(-Var1, names_to = "Var2", values_to = "value") %>%
mutate(Var1 = stringr::str_split(Var1, "-", simplify = TRUE)[, rank])
mutate(Var1 = stringr::str_split(Var1, ";_;", simplify = TRUE)[, rank])
p <- ggplot(dat2, aes(Var1, Var2)) +
geom_tile(aes(fill = value)) +
# geom_text(aes(label = round(value, 1)), data = dat2 %>% filter(value > 0)) +