graphing barplot with categorical x-axis

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

graphing barplot with categorical x-axis

Rabu
This post has NOT been accepted by the mailing list yet.
Hello everyone,
I have a dataset that looks like this:

[data]
     Colour     Frequency     Observed
1    Red          0.09                T
2    Blue         0.12                T
3    Green      0.43                 T
4    Orange     0.08                T
5    Pink         0.21                 T

I want to obtain a barplot of frequency (y-axis) as a function of colour (x-axis)

data<-read.table("path/to/file", header=T)

I'm not sure what to do from here, perhaps

colour.freq<-table(data$colour), but this will just give be a list of times that colour was observed in the data set and not the frequency.

Any help is appreciated, I am very much a beginner!