[R] clustered bar chart help

Li, Qinghong, ST. LOUIS, NRC St. Louis Petcare Qinghong.Li at rdmo.nestle.com
Fri Feb 18 20:46:33 CET 2011


Sorry the data were all messed up. Let me try again.
Can anyone help me to plot a chart graph? I have a data set like this. I
would like a bar chart graph which mouse1's two treatments are clustered
together, so on.

I tried with barplot, but couldn't get it right.

	Mouse1	Mouse2	Mouse3	
Trial	C	T	C	T	C	T

1	2.4	4.3	2	4.3	2	7
2	2.8	5.4	2.8	6	2	8
3	3.1	4.5	3	4.5	3	7
4	3.1	4.4	3.1	4	3.1	7
5	2	4.1	2	4.1	2	7
6	2.2	4	2.2	3	4	6.9
7	2.7	5	4	5	2.7	6.5
8	4.5	5.6	4.5	6	4	5.6
9	2.3	4.5	2.3	4.5	2.3	4
10	3	4	4	6	2	4

-----Original Message-----
From: r-help-bounces at r-project.org [mailto:r-help-bounces at r-project.org]
On Behalf Of Li,Qinghong,ST. LOUIS,NRC St. Louis Petcare
Sent: Friday, February 18, 2011 12:06 PM
To: r-help at r-project.org
Subject: [R] clustered bar chart help

Hi,

 

Can anyone help me to plot a chart graph? I have a data set like this. I
would like a bar chart graph which mouse1's two treatments are clustered
together, so on.

I tried with barplot, but couldn't get it right.

 

 

Thanks

Johnny

	Mouse1

	Mouse2

	Mouse3

	
Trial

Cont

Treat

Cont

Treat

Cont

Treat

1

2.4

4.3

2

4.3

2

7

2

2.8

5.4

2.8

6

2

8

3

3.1

4.5

3

4.5

3

7

4

3.1

4.4

3.1

4

3.1

7

5

2

4.1

2

4.1

2

7

6

2.2

4

2.2

3

4

6.9

7

2.7

5

4

5

2.7

6.5

8

4.5

5.6

4.5

6

4

5.6

9

2.3

4.5

2.3

4.5

2.3

4

10

3

4

4

6

2

4

 


	[[alternative HTML version deleted]]

______________________________________________
R-help at r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide
http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.



More information about the R-help mailing list