gapminder डिस्प्ले को कस्टमाइज़ करना
आइए देश-वार life expectancy ट्रैजेक्टरी प्लॉट पर इन फीचर्स को परखते हैं। ध्यान रखें कि हम फिर से केवल Oceania के दो देशों के साथ काम कर रहे हैं.
यह अभ्यास पाठ्यक्रम का हिस्सा है
R में Trelliscope के साथ बिग डेटा का विज़ुअलाइज़ेशन
अभ्यास निर्देश
"lm"method का उपयोग करके एक fitted linear model जोड़ने के लिएgeom_smooth()लेयर जोड़ें.- scales को
"sliced"पर सेट करें. - प्लॉट में linear model लेयर जोड़ने के बाद, यह निर्दिष्ट करें कि इस डिस्प्ले के लिए automatic cognostics compute किए जाएँ और देखें कि यह लेयर डिस्प्ले में कौन-से नए cognostics जोड़ती है.
इंटरैक्टिव व्यावहारिक अभ्यास
इस अभ्यास को इस नमूना कोड को पूरा करके आज़माएँ।
library(trelliscopejs)
library(ggplot2)
# Create the plot
ggplot(gapminder, aes(year, lifeExp)) +
geom_point() +
geom_smooth(method = ___, se = FALSE) +
facet_trelliscope(~ country + continent,
name = "lifeExp_by_country",
desc = "Life expectancy vs. year for 142 countries.",
nrow = 1, ncol = 2,
# Set the scales
scales = ___,
# Specify automatic cognistics
auto_cog = ___)