で異なるサイズの (太い) 線を描画することは可能geom_line
ですか?
サイズ パラメータは、グループに関係なく、すべての行で同じです。
bp <- ggplot(data=diamonds, aes(x=cut, y=depth)) +
geom_line(aes(color=cut), size=1)
ただし、線の太さは、観測数として測定される相対的な重要性を反映する必要があります。
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
興味深いことに、geom_line(..., size=cut)
行のサイズがまったく変更されないため、機能しますが、期待どおりではありません。