Trực quan hóa kết quả với Tidyverse

Xử lý dữ liệu có khả năng mở rộng trong R

Michael Kane

Assistant Professor, Yale University

Thiếu dữ liệu theo năm

library(ggplot2)
library(tidyr)
library(dplyr)


mort %>% bigtable(c("borrower_gender", "year")) %>% as.data.frame()
Xử lý dữ liệu có khả năng mở rộng trong R

Thiếu dữ liệu theo năm

library(ggplot2)
library(tidyr)
library(dplyr)

mort %>% 
  bigtable(c("borrower_gender", "year")) %>% 
  as.data.frame() %>% 
  mutate(Category = c("Male", "Female", "Not Provided", 
                      "Not Applicable", "Missing"))
Xử lý dữ liệu có khả năng mở rộng trong R

Thiếu dữ liệu theo năm

library(ggplot2)
library(tidyr)
library(dplyr)

mort %>% 
  bigtable(c("borrower_gender", "year")) %>% 
  as.data.frame() %>% 
  mutate(Category = c("Male", "Female", "Not Provided", 
                      "Not Applicable", "Missing")) %>%
  pivot_longer(-Category, names_to = "Year", values_to = "Count") %>%
  arrange(Year)
Xử lý dữ liệu có khả năng mở rộng trong R

Thiếu dữ liệu theo năm

library(ggplot2)
library(tidyr)
library(dplyr)

mort %>% 
  bigtable(c("borrower_gender", "year")) %>% 
  as.data.frame() %>% 
  mutate(Category = c("Male", "Female", "Not Provided", 
                      "Not Applicable", "Missing")) %>%
  pivot_longer(-Category, names_to = "Year", values_to = "Count") %>%
  arrange(Year) %>%
  ggplot(aes(x = Year, y = Count, group = Category, 
                color = Category)) + 
  geom_line()
Xử lý dữ liệu có khả năng mở rộng trong R

Xử lý dữ liệu có khả năng mở rộng trong R

Cùng luyện tập nào!

Xử lý dữ liệu có khả năng mở rộng trong R

Preparing Video For Download...