Exploratory: 順序付きカテゴリーを扱うための「ファクター」データタイプの紹介

19fc8f6113c5c3d86e6176362ff29479?s=47 Kan Nishida
August 30, 2019

Exploratory: 順序付きカテゴリーを扱うための「ファクター」データタイプの紹介

Rには「ファクター」という順序付きカテゴリーのためのデータタイプがあります。この順序付きのカテゴリーというのはデータ分析を行ったり、データを可視化したりする時に重要なコンセプトなのですが、それを可能にしてくれるのがこの「ファクター」というデータタイプです。

このセミナーでは、「ファクター」型の紹介と使い方、さらに様々な順序の設定の仕方の紹介をデモを交えて行います。

19fc8f6113c5c3d86e6176362ff29479?s=128

Kan Nishida

August 30, 2019
Tweet

Transcript

  1. 3.

    3 εϐʔΧʔ ੢ా צҰ࿠ CEO EXPLORATORY ུྺ 2016೥ɺσʔλαΠΤϯεͷຽओԽͷͨΊɺExploratory, Inc Λ

    ্ཱͪ͛Δɻ Exploratory, Inc.ͰCEOΛ຿ΊΔ͔ͨΘΒɺσʔλαΠΤϯεɾ ϒʔτΩϟϯϓɾτϨʔχϯάͳͲΛ௨ͯ͠γϦίϯόϨʔͰ ߦΘΕ͍ͯΔ࠷ઌ୺ͷσʔλαΠΤϯεͷීٴͱڭҭʹऔΓ૊ Ήɻ ถΦϥΫϧຊࣾͰɺ16೥ʹΘͨΓσʔλαΠΤϯεͷ։ൃνʔ ϜΛ཰͍ɺػցֶशɺϏοάɾσʔλɺϏδωεɾΠϯςϦδΣ ϯεɺσʔλϕʔεʹؔ͢Δ਺ଟ͘ͷ੡඼ΛੈʹૹΓग़ͨ͠ɻ @KanAugust
  2. 7.

    ୈ1ͷ೾ ୈ̎ͷ೾ ୈ̏ͷ೾ ϓϥΠϕʔτ(ߴ͍/ݹ͍) Φʔϓϯɾιʔε(ແྉ/࠷ઌ୺) UI & ϓϩάϥϛϯά ϓϩάϥϛϯά 2016

    2000 1976 ϚωλΠθʔγϣϯ ίϞσΟςΟԽ ຽओԽ ౷ܭֶऀ σʔλαΠΤϯςΟετ Exploratory ΞϧΰϦζϜ Ϣʔβʔɾ ମݧ πʔϧ Φʔϓϯɾιʔε(ແྉ/࠷ઌ୺) UI & ࣗಈԽ ϏδωεɾϢʔβʔ ςʔϚ σʔλαΠΤϯεͷຽओԽ
  3. 13.

    13 ෼ੳʹ͓͚ΔσʔλͷλΠϓ σʔλλΠϓ in R / Exploratory ਺஋ numeric ΧςΰϦʔ

    character ॱং෇͖ͷΧςΰϦʔ factor ࿦ཧ஋ logical ೔෇ɺ࣌ؒ Date, POSIXct
  4. 14.

    ਺஋ 0 10 20 30 40 50 11 22 45

    14 ࿈ଓੑ͕͋Δ ॱংؔ܎͕͋Δ
  5. 19.

    ΧςΰϦʔ ͘͢͝ѱ͍ ѱ͍ ͲͪΒͱ΋͍͑ͳ͍ ྑ͍ ͘͢͝ྑ͍ ΧςΰϦʔ (character) ΧςΰϦʔ Ϩϕϧ

    ͘͢͝ѱ͍ 1 ѱ͍ 2 ͲͪΒͱ΋͍͑ͳ͍ 3 ྑ͍ 4 ͘͢͝ྑ͍ 5 vs. ॱং෇͖ΧςΰϦʔ (factor)
  6. 33.
  7. 36.

    forcats ؔ਺ • fct_relevel • fct_inorder • fct_infreq • fct_reorder

    • fct_rev (reverse) • fct_lump • and more…
  8. 39.
  9. 40.
  10. 41.

    fct_relevel(`Online learning platforms and MOOCs`, "Much worse", "Slightly worse", "Neither

    better nor worse", "Slightly better", "Much better") ϨϕϧΛઃఆ͍ͨ͠஋ΛϦετ͍ͯ͘͠ɻ
  11. 42.

    ΧςΰϦʔ Much Worse Slightly Worse Neither better or worse Slightly

    Better Much Better No Opinions ΧςΰϦʔ Ϩϕϧ Much Worse 1 Slightly Worse 2 Neither better or worse 3 Slightly Better 4 Much Better 5 No Opinions
  12. 43.

    Category Much Worse Slightly Worse Neither better or worse Slightly

    Better Much Better No Opinions Category Level Much Worse 1 Slightly Worse 2 Neither better or worse 3 Slightly Better 4 Much Better 5 No Opinions 6 ϨϕϧΛઃఆ͠ͳ͔ͬͨ΋ͷ͸ΞϧϑΝϕοτॱͰࣗಈͰઃఆ͞ΕΔɻ
  13. 89.

    Category Research Director Healthcare Rep Human Resources Laboratory Technician Manager

    Manufacturing Director Category Healthcare Rep Human Resources Laboratory Technician Manager Manufacturing Director Research Director Research DirectorΛ࠷ॳͷϨϕϧʹ࣋ͬͯ͘Ε͹Α͍ɻ
  14. 90.

    Category Healthcare Rep Human Resources Laboratory Technician Manager Manufacturing Director

    Research Director Category Level Healthcare Rep Human Resources Laboratory Technician Manager Manufacturing Director Research Director 1 Character ϑΝΫλʔ Research DirectorͷϨϕϧΛ̍ʹ͢Δɻ
  15. 91.

    Category Level Research Director 1 Healthcare Rep 2 Human Resources

    3 Laboratory Technician 4 Manager 5 Manufacturing Director 6 Category Level Healthcare Rep Human Resources Laboratory Technician Manager Manufacturing Director Research Director 1 ଞͷ৬छͷϨϕϧΛࢦఆ͠ͳ͍৔߹͸ɺ ΞϧϑΝϕοτॱʹϨϕϧ͕ࣗಈͰܾ·Δɻ
  16. 92.

    Category Level Research Director 1 Healthcare Rep 2 Human Resources

    3 Laboratory Technician 4 Manager 5 Manufacturing Director 6 ϕʔεϨϕϧ
  17. 102.
  18. 105.
  19. 114.
  20. 121.
  21. 143.
  22. 146.