If you use ggplot, you will not need to do this in a loop, you can draw them all at once. In addition, you need to reformat your data so that it is in a long format, and not in a short format. To do this, you can use the melt function from the reshape package.
library(reshape2)
new.df<-melt(HEIrank11,id.vars="HEI.ID")
names(new.df)=c("HEI.ID","Year","Rank")
Substringjust gets rid of X every year
library(ggplot2)
ggplot(new.df, aes(x=HEI.ID,y=Rank,fill=substring(Year,2)))+
geom_histogram(stat="identity",position="dodge")
