> all = c(125,210,375,475,590,700) > spam = c(50,110,225,315,390,450) > tab = rbind(spam,all) > dimnames(tab) = list(c("spam","Total"),year=2000:2005)To make the barplot, we make a new table, replacing all with all-spam, which is the number of e-mails that are not spam.
> newtab = rbind(spam,all-spam) > dimnames(newtab) = list(c("spam","notspam"),year=2000:2005) > barplot(newtab,legend=TRUE)