I need to assign a specific color to a bar in ggplot bar plots. By default I am getting the below ggplot bar plot. Here, what I wanted is to assign a different color (say red) to the higuest value bars. That is for the bars under 64 items with type D for the names X and Z. And also red color for the bar under 16 items with type C for the name Y. Currently I am using the R ggplot2 code shown below the figure. Please help me to get this.
Data:
data <- structure(list(type = structure(c(1L, 2L, 3L, 4L, 2L, 3L, 4L,
3L, 4L, 4L, 1L, 2L, 3L, 4L, 2L, 3L, 4L, 3L, 4L, 4L, 1L, 2L, 3L,
4L, 2L, 3L, 4L, 3L, 4L, 4L), .Label = c("A", "B", "C", "D"), class = "factor"),
items = c(16L, 16L, 16L, 16L, 32L, 32L, 32L, 48L, 48L, 64L,
16L, 16L, 16L, 16L, 32L, 32L, 32L, 48L, 48L, 64L, 16L, 16L,
16L, 16L, 32L, 32L, 32L, 48L, 48L, 64L), name = structure(c(1L,
1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 3L, 3L, 3L, 3L, 3L, 3L,
3L, 3L, 3L, 3L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L), .Label = c("X",
"Y", "Z"), class = "factor"), value = c(6.3, 7.2, 7.1, 7,
10, 10.9, 11, 11.6, 11.5, 12, 8.9, 10.6, 11.5, 7.9, 12.6,
13.5, 12.4, 13, 14, 15.4, 4.8, 7, 7.2, 6.1, 4.1, 4.4, 4.2,
3.2, 2.7, 1.6)), .Names = c("type", "items", "name", "value"
), class = "data.frame", row.names = c(NA, -30L))

data$name = factor(data$name, levels(data$name)[c(1,3,2)])
p1 = ggplot(data, aes(type, value, fill=type, group=items, facets=items)) + geom_bar(stat="identity")
p1 = p1 + scale_fill_manual(values = rep("grey60",4), labels = c("type-A", "type-B", "type-C", "type-D"))
p1 = p1 + facet_grid(name~items,scales="free", space="free") + opts(strip.text.y = theme_text(size=14, face="bold"))
p1 = p1 + opts(legend.position="top", legend.text=theme_text(size=15), legend.title=theme_text(size=0,colour="white"), legend.key = theme_rect(colour = NA))
UPDATE
Although the code provided by mnei is providing almost what I need, I am not getting the legend shown in the Figure. Please let me know how can I get that.
Calculate which
typeis the maximum for each combinationOr with the legend as requested