This is an excerpt of one of my data tables:
YR POPSTAT Freq
2001 0 34
2002 0 45
2003 0 32
2015 0 16
2001 1 7
2002 1 11
2003 1 8
2014 1 7
2015 1 3
I want to plot an histogram of frequencies per year (YR) for all POPSTAT>0. None of these obviously do the job:
for (POPSTAT>0) barplot(table.popstat$Freq)
plot(table.popstat$Freq~table.popstat$YR)
I also need the years to be on the x-axis. Any help would be appreciated.