Hi,
I am new to R and I hope someone can help me with my problem. I am trying
to draw a side by side barplot.
There is a main experiment and there are many sub experiments within the
main experiment. I would like to draw a bar plot showing the number of
sub_experiments done for each main_exp. For instance if the Main_Exp is 6,
I would like to group the sub exp's for the main_exp and show that there
were two sub_exp's done an ELISA and a FCM and that the ELISA was done once
and the FCM was done twice. Similarly for Main_Exp 7 I would like to show
that for there were ELISA,FCM,qPCR,Telometry done and that they had a count
of 3,3,2,5 respectively. This is what my dataset looks like:
Task Datatype Count
1 ELISA 2
6 ELISA 1
6 FCM 2
7 ELISA 3
7 FCM 3
7 Telometry 2
7 qPCR 5
The code that I have is
table(comparisons_new)
barplot(as.matrix(comparisons_new$Sub_Exp_Count),xlab="Main_Exp_Name",
ylab="Sub_Exp_Count",ylim=c(0,10),names.arg=(comparisons_new$Main_Exp_Name),beside=TRUE,legend=rownames(compariso
ns_new$Sub_Exp_Name),col=rainbow(5))
[[alternative HTML version deleted]]