Fixing str_split
This commit is contained in:
parent
5f922c1453
commit
3477c6e123
1 changed files with 1 additions and 1 deletions
|
|
@ -64,7 +64,7 @@ plot_mat <- function(matrix, rank) {
|
||||||
matrix %>%
|
matrix %>%
|
||||||
as_tibble(rownames = "Var1") %>%
|
as_tibble(rownames = "Var1") %>%
|
||||||
pivot_longer(-Var1, names_to = "Var2", values_to = "value") %>%
|
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)) +
|
p <- ggplot(dat2, aes(Var1, Var2)) +
|
||||||
geom_tile(aes(fill = value)) +
|
geom_tile(aes(fill = value)) +
|
||||||
# geom_text(aes(label = round(value, 1)), data = dat2 %>% filter(value > 0)) +
|
# geom_text(aes(label = round(value, 1)), data = dat2 %>% filter(value > 0)) +
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue