Is it possible to have different sized (i.e. thick) lines drawn with geom_line
?
The size parameters is the same for all lines, irrespective of the group:
bp <- ggplot(data=diamonds, aes(x=cut, y=depth)) +
geom_line(aes(color=cut), size=1)
However, I want the thickness of the lines to reflect their relative importance measured as number of observations:
relative_size <- table(diamonds$cut)/nrow(diamonds)
bp <- ggplot(data=diamonds, aes(x=cut, y=depth)) +
geom_line(aes(color=cut), size=cut)
bp
# Error: Incompatible lengths for set aesthetics: size
Interestingly, geom_line(..., size=cut)
works but not as expected, since it doesn't alter line size at all.