I would like to create a grayscale line-graph with multiple groups (~10), but having one line (spec=3)
that is in red.
See an example with only 3 groups below:
year <-c (2011, 2012, 2013, 2011, 2012, 2013, 2011, 2012, 2013)
x <- 1:10
cost <- sample(x, 9, replace=T)
spec <- as.factor(c(1, 1, 1, 2, 2, 2, 3, 3, 3))
dat <-data.frame(year=year, cost=cost, spec=spec)
# graph
library(ggplot2)
ggplot(data=dat, aes(x=year, y=cost, group=spec)) +
geom_line(aes(color=spec)) +
**geom_line(group="3", col="red")** +
scale_colour_grey() +
theme_bw()
The problem is obviously with the geom_line(group="3", col="red")
part, but I don't know how to fix it.