LoginSignup
1
0

More than 3 years have passed since last update.

【R】ggplot2でよく使う省略表記について、lty, lwd

Posted at

Rはデータ分析者のおともだち。
だが、書籍やwebの情報は意外とディティールの情報が不足しがち。

省略表記はその1つ。

ggplot2で使う省略表記、lty, lwd

戦略的データサイエンス入門 ―ビジネスに活かすコンセプトとテクニック
この本の第4章のRコードに下記のようなものがある。

test.R
duid$log_date<- as.Date(duid$log_date)
limits<- c(0, max(duid$dau))
ggplot(duid,
       aes(x=log_date, y=dau, col=device_type,lty=device_type, shape=device_type))+
      geom_line(lwd=1)+
      geom_point(size=4)+
      scale_y_continuous(label=comma, limits=limits)

4行目の lty は linetype
5行目の lwd は linewidth

ぶっちゃけこれだけのことだが、説明が省かれていることが多い印象を受ける。
そりゃ色々値を差し替えれば気づくけどね。

そういうとこやぞ。


随時更新予定

1
0
1

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
0