Skip to content
Prev 131220 / 398502 Next

Multiple stacked barplots on the same graph?

Hi,

I tried this method but it seems that there is something wrong with my 
data frame:


when I type in:

 > qplot(x=as.factor(Categorie),y=Total,data=mydata)

It displays a graph with 2 points in each category...
but if  I add the parameter geom="histogram"

 > qplot(x=as.factor(Categorie),y=Total,data=mydata,geom="histogram")


Error in storage.mode(test) <- "logical" :
        object "y" not found

any hint about this...

thx, St?phane.


========================================================
the real data frame

                                                    Categorie     Part 
Total  chr1  chr2    pl
1                                     Amino acid biosynthesis   common  
3.03  4.55  1.68  0.00
2          Purines, pyrimidines, nucleosides, and nucleotides   common  
1.65  2.37  1.06  0.00
3                      Fatty acid and phospholipid metabolism   common  
1.52  1.77  1.55  0.00
4  Biosynthesis of cofactors, prosthetic groups, and carriers   common  
2.85  4.68  1.02  0.00
5                             Central intermediary metabolism   common  
3.40  3.19  4.57  0.00
6                                           Energy metabolism   common 
11.81 12.49 13.87  0.17
7                              Transport and binding proteins   common 
10.51 13.56  7.85  4.27
8                                              DNA metabolism   common  
1.95  2.81  0.98  1.03
9                                               Transcription   common  
2.08  3.13  1.06  0.34
10                                          Protein synthesis   common  
2.51  4.58  0.27  0.00
11                                               Protein fate   common  
2.23  3.26  1.20  0.68
12                                       Regulatory functions   common  
7.63  7.30  9.88  0.68
13                                        Signal transduction   common  
1.88  2.06  2.13  0.00
14                                              Cell envelope   common  
2.76  3.41  2.53  0.17
15                                         Cellular processes   common  
7.21  7.90  7.71  1.54
16              Mobile and extrachromosomal element functions   common  
1.08  0.22  0.40  8.38
17                                           Unknown function   common 
20.75 22.45 22.38  5.30
18                                    Amino acid biosynthesis specific  
0.35  0.16  0.71  0.00
19         Purines, pyrimidines, nucleosides, and nucleotides specific  
0.17  0.06  0.35  0.00
20                     Fatty acid and phospholipid metabolism specific  
0.08  0.09  0.09  0.00
21 Biosynthesis of cofactors, prosthetic groups, and carriers specific  
0.18  0.19  0.22  0.00
22                            Central intermediary metabolism specific  
0.42  0.09  0.98  0.00
23                                          Energy metabolism specific  
2.05  0.70  3.90  2.22
24                             Transport and binding proteins specific  
1.98  0.85  3.24  3.25
25                                             DNA metabolism specific  
0.63  0.22  0.22  4.44
26                                              Transcription specific  
0.17  0.06  0.22  0.51
27                                          Protein synthesis specific  
0.20  0.03  0.49  0.00
28                                               Protein fate specific  
0.30  0.32  0.31  0.17
29                                       Regulatory functions specific  
1.58  0.66  2.79  1.88
30                                        Signal transduction specific  
0.27  0.06  0.62  0.00
31                                              Cell envelope specific  
0.83  0.63  1.33  0.00
32                                         Cellular processes specific  
1.38  0.38  1.95  4.62
33              Mobile and extrachromosomal element functions specific  
3.56  1.14  0.44 28.72
34                                           Unknown function specific 
11.63  6.17 16.00 24.27
Domenico Vistocco wrote:
-- 
"La science a certes quelques magnifiques r?ussites ? son actif mais
? tout prendre, je pr?f?re de loin ?tre heureux plut?t qu'avoir raison." 
D. Adams