try changing the "rbind" to "cbind" like this:
Election01=c(41.41,35.23,19.42)
Election83=c(26.94,45.98,14.36)
Election87=c(29.51,46.24,13.58)
Election92=c(33.93,45.46,19.18)
Election97=c(43.55,33.69,17.95)
year=c(1982,1987,1992,1997,2001)
Election8387929701=cbind(Election83,Election87,Election92,Election97,Election01)
barplot(Election8387929701,space=c(0,0.5),beside= TRUE,col=c("red","blue","yellow"),legend.text=c("Labour","Conservative","Liberal Democrats"),ylim=c(0,50),names.arg=year,ylab="Perc entage of vote")
If you indeed wanted groups of bars according to political party, it looks like you have used names.args and legend.text in the incorrect places. A legend identifies a particular bar within a group, the names.arg argument holds a vector of names for the groups. You also have some funky colors. Try this code:
Election01=c(41.41,35.23,19.42)
Election83=c(26.94,45.98,14.36)
Election87=c(29.51,46.24,13.58)
Election92=c(33.93,45.46,19.18)
Election97=c(43.55,33.69,17.95)
year=c(1982,1987,1992,1997,2001)
Election8387929701=rbind(Election83,Election87,Election92,Election97,Election01)
barplot(Election8387929701,space=c(0,0.5),beside= TRUE,col=c(2,3,4,5,6),names.arg=c("Labour","Conservative","Liberal Democrats"),ylim=c(0,50),legend.text=year,ylab="Perc entage of vote")
Hope this is the fix,
~Matt