Hi:
Here are some possibilities using ggplot2:
library(ggplot2)
# Create ordered factors
bar$area2 <- ordered(bar$area)
bar$year2 <- ordered(bar$year)
# Side-by-side, aka dodged, bar charts
ggplot(bar, aes(x = area2, y = disc, fill = year2)) +
geom_bar(aes(group = year2), position = 'dodge
On Tue, Nov 23, 2010 at 2:49 PM, Art Burke
wrote:
> 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 = s
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,
3 matches
Mail list logo