[R] Help with grouped barplot

Art Burke Art.Burke at educationnorthwest.org
Tue Nov 23 20:49:42 CET 2010


Given the data structure below, how can I create a bar plot for the values of disc for each area grouped by year?

bar <-structure(list(year = c(2003, 2003, 2003, 2003, 2003, 2003, 2003, 
2007, 2007, 2007, 2007, 2007, 2007, 2007), area = structure(c(6L, 
4L, 1L, 2L, 3L, 5L, 7L, 6L, 4L, 1L, 2L, 3L, 5L, 7L), .Label = c("AK", 
"ID", "MT", "NW", "OR", "US", "WA"), class = "factor"), disc = c(55.8, 
62.6, 54.3, 56.9, 52.8, 66.7, 64.8, 59.5, 64.8, 65.8, 61.4, 60.6, 
66.3, 65.5)), .Names = c("year", "area", "disc"), class = "data.frame", row.names = c(NA, 
14L))

Thanks!
Art



More information about the R-help mailing list