[R] Plot complete dataset
RMSOPS
ricardosousa2000 at clix.pt
Wed Oct 26 18:59:12 CEST 2011
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
--
View this message in context: http://r.789695.n4.nabble.com/Plot-complete-dataset-tp3941346p3941346.html
Sent from the R help mailing list archive at Nabble.com.
More information about the R-help
mailing list