Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- library(ggplot2)
- s <- "aminoSet eth num
- AE AFR 2
- AK AFR 1
- AL AFR 1
- AT AFR 1
- AV EAS 1
- DE AFR 4
- DE AMR 1
- DE EAS 4
- DE EUR 2
- DE SAS 2
- EK AFR 1
- EK EAS 1
- ER AFR 1
- GT AFR 1
- HS AFR 1
- LS AFR 1
- MP AFR 1
- MP SAS 1
- PS AFR 1
- PS EAS 1
- PT AFR 1
- RS EAS 1"
- counts <- read.delim(textConnection(s),header=T,sep = " ")
- g <- ggplot(counts[order(counts$eth,decreasing=T),], aes(x=reorder(aminoSet,-num),group=num, y=num))
- g + geom_bar(aes(fill = eth),stat = "identity") + theme_bw() + theme(text = element_text(size = 20)) + theme(axis.text.x=element_text(angle=90))
Add Comment
Please, Sign In to add comment