tpemartin / 112-1-programming-for-data-science

MIT License
1 stars 6 forks source link

G6新主題 #15

Open yilinglee opened 6 months ago

yilinglee commented 6 months ago

https://data.gov.tw/dataset/161519

tpemartin commented 6 months ago
dg6 <- readr::read_csv("https://data.cip.gov.tw/API/v1/dump/datastore/A53000000A-112010-003")

# 篩出性別資料
dg6 |>
  dplyr::filter(
    類別 == "性別"
  ) -> dg6_1

dg6_1 |>
  split(
    dg6_1$項目別
  ) -> split_dg6_1

split_dg6_1$女$看報紙/
  split_dg6_1$男$看報紙 -> summarise1

names(summarise1) <- 
  split_dg6_1$女$年度

summarise1