Dear R-Users,
I would like to know whether it is possible to draw several
stacked barplots (i.e. side by side on the same sheet)...
my data look like :
Cond1 Cond1' Cond2 Cond2'
Compartment 1 11,81 2,05 12,49 0,70
Compartment 2 10,51 1,98 13,56 0,85
Compartment 3 1,95 0,63 2,81 0,22
Compartment 4 2,08 0,17 3,13 0,06
Compartment 5 2,51 0,20 4,58 0,03
ps: Cond1' values should be stacked on Cond1, Cond2' on Cond 2 and so
on... and series 1 and 2
should be side by side for each compartement....
Thanks for any help.
St?phane.
--
"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
AGC website <http://www.genoscope.cns.fr/agc>
St?phane CRUVEILLER Ph. D.
Genoscope - Centre National de S?quencage
Atelier de G?nomique Comparative
2, Rue Gaston Cremieux CP 5706
91057 Evry Cedex - France
Phone: +33 (0)1 60 87 84 58
Fax: +33 (0)1 60 87 25 14
scruveil at genoscope.cns.fr
I would like to know whether it is possible to draw several
stacked barplots (i.e. side by side on the same sheet)...
my data look like :
Cond1 Cond1' Cond2 Cond2'
Compartment 1 11,81 2,05 12,49 0,70
Compartment 2 10,51 1,98 13,56 0,85
Compartment 3 1,95 0,63 2,81 0,22
Compartment 4 2,08 0,17 3,13 0,06
Compartment 5 2,51 0,20 4,58 0,03
ps: Cond1' values should be stacked on Cond1, Cond2' on Cond 2 and so
on... and series 1 and 2
should be side by side for each compartement....
Check the following example on xyplot/lattice:
barchart(yield ~ variety | site, data = barley,
groups = year, layout = c(1,6), stack = TRUE,
auto.key = list(points = FALSE, rectangles = TRUE, space = "right"),
ylab = "Barley Yield (bushels/acre)",
scales = list(x = list(rot = 45)))
You have to reformat your data to the long format first for this, e.g. by using
reshape.
Comp Cond x
1 1 11.81
1 2 2.05
With allow.multiple=TRUE, it might be possible to avoid the reformatting, but I
never have used that form, because I the "long" had many advantages.
Dieter
Dear R-Users,
I would like to know whether it is possible to draw several
stacked barplots (i.e. side by side on the same sheet)...
my data look like :
Cond1 Cond1' Cond2 Cond2'
Compartment 1 11,81 2,05 12,49 0,70
Compartment 2 10,51 1,98 13,56 0,85
Compartment 3 1,95 0,63 2,81 0,22
Compartment 4 2,08 0,17 3,13 0,06
Compartment 5 2,51 0,20 4,58 0,03
ps: Cond1' values should be stacked on Cond1, Cond2' on Cond 2 and so
on... and series 1 and 2
should be side by side for each compartement....
Thanks for any help.
St?phane.
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
Dear R-Users,
I would like to know whether it is possible to draw several
stacked barplots (i.e. side by side on the same sheet)...
my data look like :
Cond1 Cond1' Cond2 Cond2'
Compartment 1 11,81 2,05 12,49 0,70 Compartment 2
10,51 1,98 13,56 0,85
Compartment 3 1,95 0,63 2,81 0,22 Compartment 4
2,08 0,17 3,13 0,06 Compartment 5 2,51 0,20
4,58 0,03
ps: Cond1' values should be stacked on Cond1, Cond2' on Cond 2 and so
on... and series 1 and 2
should be side by side for each compartement....
Thanks for any help.
St?phane.
--
"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
AGC website <http://www.genoscope.cns.fr/agc>
St?phane CRUVEILLER Ph. D.
Genoscope - Centre National de S?quencage
Atelier de G?nomique Comparative
2, Rue Gaston Cremieux CP 5706
91057 Evry Cedex - France
Phone: +33 (0)1 60 87 84 58
Fax: +33 (0)1 60 87 25 14
scruveil at genoscope.cns.fr
Hi, I am trying to get 95% CI s around a quantile growth curve, but
my result looks strange to me.
Here is the function I defined myself
boot.qregress<-function(mat1, group, quantile, int, seed.1){
boot.fit<-NULL
set.seed(seed.1)
for (i in 1:int){
index<-sample((unique(mat1$Subject[mat1$Group==group])), length
(unique(mat1$Subject[mat1$Group==group])), replace=TRUE)
#make the bootstrapping dataset
mat.junk<-NULL
for (j in 1: length(index)){
mat.junk<-rbind(mat.junk, mat1[mat1$Subject==index[j], ])
}
boot.fit<-cbind(boot.fit, cobs(mat.junk$Day, mat.junk$Weight,
constraint="none", degree=2, tau=quantile, lambda=-1)$fitted)
}
boot.fit
}
The curves I made from the bootstrapping is attached, I don't
understand why for a group, the 5% curve drops suddenly around time
130. I am thinking about missingness since before 130 there are 50
patients, but after day 130 there are only 40 patients for this group.
Any suggestions on the R-code (especially about how to do the
bootstrapping for the growth curves) or why the drops happened would
be appreciated.
Thanks a lot,
Suyan
?
Error in storage.mode(test) <- "logical" :
object "y" not found
any hint about this...
Could you copy and paste the output of dput(mydata) ?
(And I'd probably write the plot call as: qplot(Categorie, Total,
data=mydata, geom="bar"), since it is a bar plot, not a histogram)
Error in storage.mode(test) <- "logical" :
object "y" not found
any hint about this...
Could you copy and paste the output of dput(mydata) ?
(And I'd probably write the plot call as: qplot(Categorie, Total,
data=mydata, geom="bar"), since it is a bar plot, not a histogram)
--
"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
AGC website <http://www.genoscope.cns.fr/agc>
St?phane CRUVEILLER Ph. D.
Genoscope - Centre National de S?quencage
Atelier de G?nomique Comparative
2, Rue Gaston Cremieux CP 5706
91057 Evry Cedex - France
Phone: +33 (0)1 60 87 84 58
Fax: +33 (0)1 60 87 25 14
scruveil at genoscope.cns.fr
Error in storage.mode(test) <- "logical" :
object "y" not found
any hint about this...
Could you copy and paste the output of dput(mydata) ?
(And I'd probably write the plot call as: qplot(Categorie, Total,
data=mydata, geom="bar"), since it is a bar plot, not a histogram)
Error in storage.mode(test) <- "logical" :
object "y" not found
any hint about this...
Could you copy and paste the output of dput(mydata) ?
(And I'd probably write the plot call as: qplot(Categorie, Total,
data=mydata, geom="bar"), since it is a bar plot, not a histogram)