[R] Help with plot Grouped Bar Plot by using R

R_beginner_starter cjyxiaodi1 at gmail.com
Tue Mar 6 05:49:30 CET 2012


My input file:
[code]
Number of Z	Number of Data1	Data1 %	Number of Data2	Data2 %
0	704512099	99.74%	704423913	99.73%
1	1550142	0.22%	624685	0.09%
2	164297	0.02%	145942	0.02%
3	21515	0.00%	81941	0.01%
4	9238	0.00%	59188	0.01%
5	10501	0.00%	49658	0.01%
6	6376	0.00%	43846	0.01%
7	5000	0.00%	40841	0.01%
8	6433	0.00%	34587	0.00%
9	4755	0.00%	33504	0.00%
10	4091	0.00%	33285	0.00%
11	3429	0.00%	33837	0.00%
12	2764	0.00%	34835	0.00%
13	2489	0.00%	34453	0.00%
14	2804	0.00%	31327	0.00%
15	1968	0.00%	32287	0.00%
16	2582	0.00%	30906	0.00%
17	1903	0.00%	27054	0.00%
18	2121	0.00%	30662	0.00%
19	1712	0.00%	26963	0.00%
20	1471	0.00%	31382	0.00%
21	952	0.00%	29512	0.00%
22	866	0.00%	26077	0.00%
23	1224	0.00%	27945	0.00%
24	1382	0.00%	25433	0.00%
25	1332	0.00%	19203	0.00%
26	881	0.00%	19143	0.00%
27	1322	0.00%	18623	0.00%
28	1058	0.00%	17360	0.00%
29	923	0.00%	20834	0.00%
30	1353	0.00%	16154	0.00%
31	1213	0.00%	13968	0.00%
32	903	0.00%	13947	0.00%
33	1022	0.00%	14658	0.00%
34	606	0.00%	12764	0.00%
35	540	0.00%	12996	0.00%
36	650	0.00%	9628	0.00%
37	1368	0.00%	10950	0.00%
38	1052	0.00%	9096	0.00%
39	1342	0.00%	8425	0.00%
40	1019	0.00%	6792	0.00%
41	745	0.00%	6302	0.00%
42	794	0.00%	6771	0.00%
43	658	0.00%	6267	0.00%
44	968	0.00%	6898	0.00%
45	1448	0.00%	6082	0.00%
46	800	0.00%	6429	0.00%
47	579	0.00%	5019	0.00%
48	624	0.00%	6921	0.00%
49	660	0.00%	5435	0.00%
50	163	0.00%	4631	0.00%
51	0	0.00%	4353	0.00%
52	0	0.00%	3794	0.00%
53	0	0.00%	2839	0.00%
54	0	0.00%	1864	0.00%
55	0	0.00%	1947	0.00%
56	0	0.00%	1867	0.00%
57	0	0.00%	1953	0.00%
58	0	0.00%	1516	0.00%
59	0	0.00%	1678	0.00%
60	0	0.00%	1632	0.00%
61	0	0.00%	2980	0.00%
62	0	0.00%	1813	0.00%
63	0	0.00%	2036	0.00%
64	0	0.00%	1706	0.00%
65	0	0.00%	3027	0.00%
66	0	0.00%	1706	0.00%
67	0	0.00%	3197	0.00%
68	0	0.00%	1500	0.00%
69	0	0.00%	2183	0.00%
70	0	0.00%	1118	0.00%
71	0	0.00%	1486	0.00%
72	0	0.00%	1453	0.00%
73	0	0.00%	1266	0.00%
74	0	0.00%	870	0.00%
75	0	0.00%	791	0.00%
76	0	0.00%	1767	0.00%
77	0	0.00%	766	0.00%
78	0	0.00%	1161	0.00%
79	0	0.00%	753	0.00%
80	0	0.00%	892	0.00%
81	0	0.00%	907	0.00%
82	0	0.00%	890	0.00%
83	0	0.00%	749	0.00%
84	0	0.00%	1134	0.00%
85	0	0.00%	1160	0.00%
86	0	0.00%	3891	0.00%
87	0	0.00%	1643	0.00%
88	0	0.00%	390	0.00%
89	0	0.00%	100	0.00%
[/code]
Desired output image
[code]
http://r.789695.n4.nabble.com/file/n4448762/ScreenHunter_01_Mar._06_12.42.jpg 
[/code]
Only the first, second, and forth column is used to plot the barplot
Code that I try:
[code]
read.table("data.stats.txt", header=TRUE, sep="\t")
data <- read.table("data.stats.txt", header=TRUE)
data[,1]
data[,2]
data[,4]
[/code]
Thanks for any advice

--
View this message in context: http://r.789695.n4.nabble.com/Help-with-plot-Grouped-Bar-Plot-by-using-R-tp4448762p4448762.html
Sent from the R help mailing list archive at Nabble.com.



More information about the R-help mailing list