Guest User

Untitled

a guest
Jan 22nd, 2018
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.54 KB | None | 0 0
  1. library(ggplot2)
  2.  
  3. s <- "aminoSet eth num
  4. AE AFR 2
  5. AK AFR 1
  6. AL AFR 1
  7. AT AFR 1
  8. AV EAS 1
  9. DE AFR 4
  10. DE AMR 1
  11. DE EAS 4
  12. DE EUR 2
  13. DE SAS 2
  14. EK AFR 1
  15. EK EAS 1
  16. ER AFR 1
  17. GT AFR 1
  18. HS AFR 1
  19. LS AFR 1
  20. MP AFR 1
  21. MP SAS 1
  22. PS AFR 1
  23. PS EAS 1
  24. PT AFR 1
  25. RS EAS 1"
  26. counts <- read.delim(textConnection(s),header=T,sep = " ")
  27.  
  28.  
  29. g <- ggplot(counts[order(counts$eth,decreasing=T),], aes(x=reorder(aminoSet,-num),group=num, y=num))
  30. 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