我有这样的数据:
data <- data.frame(Comp = factor(rep(2003:2004, each = 8)),
Cat = rep(letters[1:4], 4),
Type = rep(c('Free','Used'), each = 4),
Count = trunc(rnorm(16,30,2)))
而且我需要像barplotwith beside = TRUEand beside = FALSE( TRUEfor Catand Comp, and FALSE = Type) 这样的东西。
有了这些数据,它将产生一个有 8 列的图(Comp与Cat( Comp = 2003 + Cat = A ; Comp = 2003 + Cat = B ; ... ; Comp = 2004 + Cat = D) 的交互),每列有 2 个堆叠列(Type(Free和Used) 的水平)用于Count变量。
任何提示我怎么能做这种情节?我试图在EXCEL中做一个例子,但我也失败了。

