作者: | 来源:互联网 | 2023-10-12 13:51
常见的堆砌条形图看腻了,试试冲积条形吧!!
rm(list=ls())
pacman::p_load(tidyverse,magrittr,reshape,RColorBrewer,ggalluvial)
computed_persent %
read.delim(check.names = FALSE, row.names = 1)
data2 %
mutate(sum = rowSums(.), persent = sum / sum(sum) * 100, sum = NULL,) %>%
rbind(filter(., persent % colSums()) %>%
mutate(OTU_ID = c(data %>% rownames(), "others"))
filter(data2[1:(nrow(data2) - 1),], persent > 1) %>%
rbind(data2[nrow(data2),]) %>%
set_rownames(seq_len(nrow(.))) %>%
return()
}
path % melt() %>% filter(variable !="persent")
colors % read.delim()
a4
参考:http://corybrunson.github.io/ggalluvial/articles/ggalluvial.html
数据链接:https://pan.baidu.com/s/1HDVjd47YWN5_ayJCElGIpg
提取码: ejrr