ggplot2画简单堆叠条形图
1.使用ggplot2和reshape2包;
library(ggplot2)
library(reshape2)
2.创建并读取数据;
df = read.table(text = "
activity A B C D E F G H
Social.events 3 6 12 3 14 24 11 24
Academic.skills.workshops 15 17 14 6 11 29 17 24
Summer.research 36 11 5 9 16 21 1 27
Research.fellowship 24 12 8 15 17 20 5 23
Travel.grants 34 18 4 19 12 14 6 19
Resume.preparation 22 20 13 17 11 15 18 19
RAs 25 23 10 12 19 15 17 22
Faculty.preparation 17 24 2 11 17 11 12 23
Job.interview.skills 9 8 11 11 17 13 14 28
Preparation.of.manuscripts 8 7 3 10