-----Original Message-----
From: r-help-bounces at r-project.org [mailto:r-help-bounces at r-
project.org] On Behalf Of RMSOPS
Sent: Wednesday, October 26, 2011 9:59 AM
To: r-help at r-project.org
Subject: [R] Plot complete dataset
Hello,
I am a new user of R, so I still have some basic difficulties.
I'm trying to create a bar graph completely from reading a file.
The idea was on the x axis have the columns of the table
Married ,Single,Divorced, widower
the legend Ages
18-34
35-45
46-64
65-69
70-74
the dataset
dataset
Ages Married Single Divorced widower
1 18-34 10.5 35.7 8.5 3.2
2 35-45 12.4 22.4 22.2 12.6
3 46-64 25.4 22.2 33.4 12.4
4 65-69 36.7 31.4 12.4 35.2
5 70-74 26.4 15.1 8.5 43.2
The code for barplot
barplot(dataset,dataset$Single, col = c(rainbow(dataset$Ages)), legend
=
rownames(dataset$Ages), ylim = c(0, 100))
but I am not able to resolve.
Thanks