ทางเลือกแทน Heat Map
มีทางเลือกหลายอย่างที่ใช้แทน heat map ได้ การเลือกใช้แบบใดขึ้นอยู่กับข้อมูลและเรื่องราวที่ต้องการนำเสนอ หากข้อมูลมีองค์ประกอบด้านเวลา ตัวเลือกที่เหมาะสมที่สุดคือกราฟเส้น
แบบฝึกหัดนี้เป็นส่วนหนึ่งของหลักสูตร
การสร้างภาพข้อมูลระดับกลางด้วย ggplot2
แบบฝึกหัดเชิงโต้ตอบแบบลงมือทำ
ลองทำแบบฝึกหัดนี้โดยเติมโค้ดตัวอย่างนี้ให้สมบูรณ์
# The heat map we want to replace
# Don't remove, it's here to help you!
ggplot(barley, aes(x = year, y = variety, fill = yield)) +
geom_tile() +
facet_wrap( ~ site, ncol = 1) +
scale_fill_gradientn(colors = brewer.pal(9, "Reds"))
# Using barley, plot yield vs. year, colored and grouped by variety
___ +
# Add a line layer
___ +
# Facet, wrapping by site, with 1 row
facet_wrap( ~ site, nrow = 1)