2016-08-01 9 views
0

'high'와 'low'의 두 그룹을 포함하는 데이터 프레임을 녹였습니다. 모두 그룹의 각 문안이 상대적으로 풍부합니다. 나는 (높고 낮음) 두 개의 열이되도록, 누적 막대 그래프를 만들려면 그 I는 다음과 같이 그려 봤어 (100)박테리아의 누적 막대 그래프 만들기 R

Phylum   Group value 
1 Euryarchaeota High 0.0000000000 
2 Acidobacteria High 0.0000000000 
3 Actinobacteria High 0.0014929190 
4 Bacteroidetes High 0.6620724580 
5 Chloroflexi  High 0.0000000000 
6 Cyanobacteria High 0.0036403330 
7 Elusimicrobia High 0.0000000000 
8 Fibrobacteres High 0.0000000000 
9 Firmicutes  High 0.3299947690 
10 Fusobacteria High 0.0008169250 
11 GemmatimonadetesHigh 0.0000000000 
12 Lentisphaerae High 0.0000000000 
13 Nitrospirae  High 0.0000000000 
14 Planctomycetes High 0.0000000000 
15 Proteobacteria High 0.0010844560 
16 SR1    High 0.0000000000 
17 Spirochaetes High 0.0002579760 
18 Synergistetes High 0.0000000000 
19 TM7    High 0.0000000000 
20 Tenericutes  High 0.0000023900 
21 Verrucomicrobia High 0.0006377750 
22 [Thermi]  High 0.0000000000 
23 Euryarchaeota Low  0.0000018200 
24 Acidobacteria Low  0.0000015100 
25 Actinobacteria Low  0.0094485600 
26 Bacteroidetes Low  0.4611814500 
27 Chloroflexi  Low  0.0000009090 
28 Cyanobacteria Low  0.0005776960 
29 Elusimicrobia Low  0.0000272000 
30 Fibrobacteres Low  0.0000001330 
31 Firmicutes  Low  0.5217123900 
32 Fusobacteria Low  0.0005029220 
33 GemmatimonadetesLow  0.0000003990 
34 Lentisphaerae Low  0.0000044400 
35 Nitrospirae  Low  0.0000000444 
36 Planctomycetes Low  0.0000000222 
37 Proteobacteria Low  0.0027838720 
38 SR1    Low  0.0000002440 
39 Spirochaetes Low  0.0000716000 
40 Synergistetes Low  0.0000093400 
41 TM7    Low  0.0000555000 
42 Tenericutes  Low  0.0013692220 
43 Verrucomicrobia Low  0.0022507390 
44 [Thermi]  Low  0.0000000222 

밖으로 문 (phyla)의 비율로 채워진 것 : ggplot(df_long, aes(x = "Group", y = value, fill = Phylum)) geom_bar(stat = "identity") 줄거리는 비어 있습니다.

내가이와 전에 (같이) 내 dataframe 녹은 : df_long <- melt(data, id.vars = "Phylum", variable.name = "Group")

싶습니다 나의 음모가 나타나지 않는 이유는 어떤 제안이?

+0

? geom_bar (stat = "identity", position = "dodge")'ggplot (d, aes (x = 문 열, y = 값, 채우기 = 그룹)) + geom_bar – Jimbou

답변

0
당신이처럼 geom_bar 기능에서 위치 = "스택"을 사용할 필요가

: 그런

ggplot(df_long, aes(Group, value, fill=Phylum)) + geom_bar(stat="identity",   
position="stack") 
관련 문제