บทนำ

การแสดงผลข้อมูลด้วย ggplot2 เบื้องต้น

Rick Scavetta

Founder, Scavetta Academy

ผู้สอน - Rick Scavetta

- e-mail: [email protected]
- Twitter: @Rick_Scavetta
การแสดงผลข้อมูลด้วย ggplot2 เบื้องต้น

การแสดงภาพข้อมูลและวิทยาศาสตร์ข้อมูล

  • ทักษะพื้นฐานสำคัญในวิทยาศาสตร์ข้อมูล

การแสดงผลข้อมูลด้วย ggplot2 เบื้องต้น

การสำรวจข้อมูลและการอธิบายข้อมูล

การแสดงผลข้อมูลด้วย ggplot2 เบื้องต้น

MASS::mammals

MASS::mammals
                              body   brain
Arctic fox                   3.385   44.50
Owl monkey                   0.480   15.50
Mountain beaver              1.350    8.10
Cow                        465.000  423.00
Grey wolf                   36.330  119.50
Goat                        27.660  115.00
Roe deer                    14.830   98.20
...
Pig                        192.000  180.00
Echidna                      3.000   25.00
Brazilian tapir            160.000  169.00
Tenrec                       0.900    2.60
Phalanger                    1.620   11.40
Tree shrew                   0.104    2.50
Red fox                      4.235   50.40
การแสดงผลข้อมูลด้วย ggplot2 เบื้องต้น

กราฟกระจาย

ggplot(mammals, aes(x = body, y = brain)) +
  geom_point()

1.1.1-1.png

การแสดงผลข้อมูลด้วย ggplot2 เบื้องต้น

สำรวจข้อมูลด้วยโมเดลเชิงเส้น

ggplot(mammals, aes(x = body, y = brain)) +
  geom_point(alpha = 0.6) +
  stat_smooth(
    method = "lm", 
    color = "red", 
    se = FALSE
  )

1.1.1-2.png

การแสดงผลข้อมูลด้วย ggplot2 เบื้องต้น

สำรวจข้อมูล: ปรับแต่งรายละเอียด

ggplot(mammals, aes(x = body, y = brain)) +
  geom_point(alpha = 0.6) +
  coord_fixed() +
  scale_x_log10() +
  scale_y_log10() +
  stat_smooth(
    method = "lm", 
    color = "#C42126", 
    se = FALSE, 
    size = 1
  )

1.1.1-3.png

การแสดงผลข้อมูลด้วย ggplot2 เบื้องต้น

กราฟพร้อมสำหรับการเผยแพร่

1.1.1-4.png

การแสดงผลข้อมูลด้วย ggplot2 เบื้องต้น

กราฟของ Anscombe

การแสดงผลข้อมูลด้วย ggplot2 เบื้องต้น

กราฟของ Anscombe

การแสดงผลข้อมูลด้วย ggplot2 เบื้องต้น

กราฟของ Anscombe

การแสดงผลข้อมูลด้วย ggplot2 เบื้องต้น

กราฟของ Anscombe

การแสดงผลข้อมูลด้วย ggplot2 เบื้องต้น

กราฟของ Anscombe

การแสดงผลข้อมูลด้วย ggplot2 เบื้องต้น

กราฟของ Anscombe

การแสดงผลข้อมูลด้วย ggplot2 เบื้องต้น

กราฟของ Anscombe

การแสดงผลข้อมูลด้วย ggplot2 เบื้องต้น

กราฟของ Anscombe

การแสดงผลข้อมูลด้วย ggplot2 เบื้องต้น

กราฟของ Anscombe

การแสดงผลข้อมูลด้วย ggplot2 เบื้องต้น

มาฝึกกันเถอะ!

การแสดงผลข้อมูลด้วย ggplot2 เบื้องต้น

Preparing Video For Download...