Kaboom_flow | R Documentation |
Kaboom flow is a function for plotting the riverplot or snake plot. Traditional riverplot could not handle unique categories without come and going. this flow chart is designed to achieve to illustrate something like gene mutation through generations. This is based on GGplot
Kaboom_flow(TB) # Quick Start A <- c("A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M") B <- c("A", "B", "C", "D", "E", "F", "K", "L", "M", "N") C <- c("A", "B", "C", "D", "E", "F", "G", "H", "N","O") TB = data.frame(row.names = sort(unique(c(A,B,C)))) Num = 0 for(Col in list(A,B,C)){ Num = Num + 1 TB[paste("Group",Num, sep="_")] = 0 TB[paste("Group",Num, sep="_")][row.names(TB) %in% Col,] = 1 } Kaboom_flow(TB)
data |
Data frame |
Kaboom_flow(TB)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.