Upgrade to Pro — share decks privately, control downloads, hide ads and more …

fukuokaR_BeginnersSession1

yu_sekiya
September 15, 2018

 fukuokaR_BeginnersSession1

fukuokaR#11で発表した初心者セッション1:Rの基礎とデータハンドリングです。

yu_sekiya

September 15, 2018
Tweet

More Decks by yu_sekiya

Other Decks in Technology

Transcript

  1. QBDLBHFͷ௥Ճ QBDLBHFͷ௥Ճํ๏  JOTUBMMQBDLBHFؔ਺Λࣗ෼Ͱॻ͘  ෳ਺Πϯετʔϧ͢Δ࣌͸D ͰғΉ  ґଘQBDLBHFͷ͏ͪ4VHHFTUT·ͰΠϯετʔϧ͢Δ࣌͸ lEFQFOEFODJTF536&zΛ௥Ճ

    &YBNQMF JOTUBMMQBLDBHFT D lSFBESz lEBUBUBCMFz  EFQFOEFODJFT536&  ࢀর IUUQTTUBUTCJPQBQZSVTKQSCBTJDQBDLBHFIUNM
  2. QBDLBHFͷݺͼग़͠ ࢖͏࣌ʹ͸lMJCSBSZ zPSlSFRVJSF zͰݺͼग़͢ MJCSBSZ EQMZS PSSFRVJSF EQMZS  Կ͕ҧ͏͔ʁ

     QBDLBHF͕Πϯετʔϧ͞Ε͍ͯͳ͔ͬͨ৔߹ͷ ڍಈ͕ҧ͏ɹ ɾMJCSBSZ QBDLHFͳ͍ΑͱΤϥʔग़ͯ͠ऴྃ ɾSFRVJSF QBDLBHF͕͋Δͱz536&zɺͳ͍ͱ l'"-4&zΛฦ͢ ࢀর IUUQTTUBDLPWFSqPXDPNRVFTUJPOT
  3. .&/6 3ͷػೳ֦ு  αϯϓϧσʔλͷݺͼग़͠ 3Λ࢖ͬͨσʔλॲཧ  UJEZEBUBͱ͸  EQMZSύΠϓԋࢉࢠͱલॲཧΠϩΠϩ 

    UJEZSQJWPUม׵ͱྻ݁߹  EQMZSUJEZSศརػೳҰཡ  TUSJOHJσʔλܕߴػೳจࣈྻॲཧ  ػೳ঺հ Ұ෦ 
  4. .&/6 3ͷػೳ֦ு  αϯϓϧσʔλͷݺͼग़͠ 3Λ࢖ͬͨσʔλॲཧ  UJEZEBUBͱ͸  EQMZSύΠϓԋࢉࢠͱલॲཧΠϩΠϩ 

    UJEZSQJWPUม׵ͱྻ݁߹  EQMZSUJEZSศརػೳҰཡ  TUSJOHJσʔλܕߴػೳจࣈྻॲཧ  ػೳ঺հ Ұ෦ 
  5. .&/6 3ͷػೳ֦ு  αϯϓϧσʔλͷݺͼग़͠ 3Λ࢖ͬͨσʔλॲཧ  UJEZEBUBͱ͸  EQMZSύΠϓԋࢉࢠͱલॲཧΠϩΠϩ 

    UJEZSQJWPUม׵ͱྻ݁߹  EQMZSUJEZSศརػೳҰཡ  TUSJOHJσʔλܕߴػೳจࣈྻॲཧ  ػೳҰཡ Ұ෦ 
  6. .&/6 3ͷػೳ֦ு  αϯϓϧσʔλͷݺͼग़͠ 3Λ࢖ͬͨσʔλॲཧ  UJEZEBUBͱ͸  EQMZSύΠϓԋࢉࢠͱલॲཧΠϩΠϩ 

    UJEZSQJWPUม׵ͱྻ݁߹  EQMZSUJEZSศརػೳҰཡ  TUSJOHJσʔλܕߴػೳจࣈྻॲཧ  ػೳ঺հ Ұ෦ 
  7. EQMZSͱ͸ EBUBGSBNFͷσʔλॲཧΛѻ͏ͨΊͷQBDLBHF ɾಛ௃  ؔ਺ΛͰͭͳ͍Ͱ࣮ߦ͍ͯ͘͠  ॻ͍ͨॱʹ࣮ߦ͞ΕΔ  ߟ͑ͨ௨Γʹॻ͚ΔͷͰετϨε͕ݮΔ 

    ଞͷEBUBGSBNFΛѻ͏QBDLBHF UJEZSͱ͔ ͷؔ਺ʹ γʔϜϨεʹ౉ͤΔ  ूܭޙʹԣ࣋ͪʹม׵ͯܽ͠ଛΛຒΊͯ͠΋͏ Ұ౓ॎ࣋ͪʹ໭͢ͳΜͯॲཧ͕͍ͬ΃ΜʹͰ͖Δ
  8. EQMZSجຊػೳ ؔ਺ TFMFDU pMUFS NVUBUF HSPVQ@CZ TVNNBSJTF KPJOܥ BSSBOHF ಈ࡞

    ྻͷબ୒ ৚݅ʹΑΔߦͷநग़ ྻͷ௥Ճ ৚݅ʹΑΔߦͷάϧʔϓԽ ߦͷू໿ EBUBGSBNFಉ࢜ͷ݁߹ ߦͷฒ΂ସ͑
  9. EQMZSKPJOͷछྨ ؔ਺ MFGU@KPJO Y Z CZl[z  SJHIU@KPJO Y Z

    CZl[z  JOOFS@KPJO Y Z CZl[z  GVMM@KPJO Y Z CZl[z  BOUJ@KPJO Y Z CZl[z  ಈ࡞ YΛج४ʹ݁߹ ZΛج४ʹ݁߹ Y Z྆ํʹଘࡏ͢Δߦ͚ͩ݁߹ Y Z྆ํͷߦΛอଘͯ݁͠߹ Zͱඥ͔ͮͳ͍YΛฦ͢ ˎෳ਺ྻΛඥ෇͚ͷLFZʹ͢Δ৔߹ CZD l[z l[[z  ˎඥ෇͚ͷLFZʹ͢Δྻ໊͕ҟͳΔ৔߹ CZD l[zl[[z 
  10. EQMZS&YBNQMF EQMZSFYEJBNPOET NVUBUF YZ[Y Z [  Y Z [Λֻ͚߹ΘͤͨྻzYZ[zΛ࡞Δ

    HSPVQ@CZ DVU  ྻzDVUzͷछྨ͝ͱʹ TVNNBSJTF UPUBM@OO  BWF9:;NFBO YZ[  O਺Λ਺͑ΔUPUBMOO  YZ[ͷฏۉ஋Λࢉग़͢ΔBWF9:;NFBO YZ[ Λ࣮ࢪ
  11. .&/6 3ͷػೳ֦ு  αϯϓϧσʔλͷݺͼग़͠ 3Λ࢖ͬͨσʔλॲཧ  UJEZEBUBͱ͸  EQMZSύΠϓԋࢉࢠͱલॲཧΠϩΠϩ 

    UJEZSQJWPUม׵ͱྻ݁߹  EQMZSUJEZSศརػೳҰཡ  TUSJOHJσʔλܕߴػೳจࣈྻॲཧ  ػೳҰཡ Ұ෦ 
  12. UJEZSͱ͸ EBUBGSBNFͷσʔλॲཧΛѻ͏ͨΊͷQBDLBHF ɾಛ௃  ؔ਺ΛͰͭͳ͍Ͱॲཧ͍ͯ͘͠  &YDFMͰ͍͏QJWPUUBCMFΛ࡞ΔػೳʴЋ  EBUBGSBNFͷॎԣม׵͔Βྻͷ݁߹·Ͱ 

    ଞͷEBUBGSBNFΛѻ͏QBDLBHF UJEZSͱ͔ ͱγʔϜ Ϩεʹड͚౉͠  ूܭޙʹQJWPUͯܽ͠ଛຒΊͯ͠΋͏Ұ౓ॎ࣋ͪ ʹ໭͢ͳΜͯॲཧ͕γʔϜϨεʹͰ͖Δ
  13. UJEZS&YBNQMF UJEZSFYEJBNPOET HSPVQ@CZ DMBSJUZ DPMPS DVU  DMBSJUZ DPMPS DVUͷ૊Έ߹Θͤ͝ͱʹ

    TVNNBSJTF BWF1SJDFNFBO QSJDF  QSJDFͷฏۉ஋Λࢉग़ VOJUF DPMDMBSJUZ@DPMPS D lDMBSJUZz lDPMPSz TFQl@z  DMBSJUZͱDPMPSΛz@zͰ݁߹ͯ͠ྻDMBSJUZ@DPMPSΛ࡞Δ TQSFBE LFZDVU WBMVFBWF1SJDF pMM  DVUΛLFZ ྻ໊ ʹBWF1SJDFΛԣ࣋ͪʹม׵ɺ ஋͕ͳ͍૊Έ߹Θͤʹ͸ΛೖΕΔ
  14. UJEZS&YBNQMF UJEZSFYUJEZSFY HBUIFS LFZDVU WBMVFBWF1SJDF DMBSJUZ@DPMPS  DMBSJUZ@DPMPSΛ࢒ͯ͠ DVUΛLFZʹॎ࣋ͪʹม׵ TFQBSBUF

    DPMDMBSJUZ@DPMPS JOUPD DMBSJUZ DPMPS  TFQ@  ྻDMBSJUZ@DPMPSΛz@zͰDMBSJUZͱDPMPSͷྻʹ෼ղ
  15. .&/6 3ͷػೳ֦ு  αϯϓϧσʔλͷݺͼग़͠ 3Λ࢖ͬͨσʔλॲཧ  UJEZEBUBͱ͸  EQMZSύΠϓԋࢉࢠͱલॲཧΠϩΠϩ 

    UJEZSQJWPUม׵ͱྻ݁߹  EQMZSUJEZSศརػೳҰཡ  TUSJOHJσʔλܕߴػೳจࣈྻॲཧ  ػೳҰཡ Ұ෦ 
  16. EQMZSUJEZSศརػೳ ·ͱΊͯॲཧ͢ΔͨΊͷศརͳॻ͖ํ  ৚݅ʹ߹Θͤͨॲཧํ๏  999@BU 999@JG 999@BMM  WBST

    ͱGVOT   ྻͷࢦఆํ๏  POF@PG   TUBSUT@XJUI   FOET@XJUI   &YBNQMFT
  17. EQMZSUJEZSศརػೳ ·ͱΊͯॲཧ͢ΔͨΊͷศརͳॻ͖ํ  ৚݅ʹ߹Θͤͨॲཧํ๏  999@BU 999@JG 999@BMM  WBST

    ͱGVOT   ྻͷࢦఆํ๏  POF@PG   TUBSUT@XJUI   FOET@XJUI   &YBNQMFT
  18. EQMZSUJEZSศརػೳ ·ͱΊͯॲཧ͢ΔͨΊͷศརͳॻ͖ํ  ৚݅ʹ߹Θͤͨॲཧํ๏  999@BU 999@JG 999@BMM  WBST

    ͱGVOT   ྻͷࢦఆํ๏  POF@PG   TUBSUT@XJUI   FOET@XJUI   &YBNQMFT
  19. ྻͷࢦఆํ๏ ؔ਺ POF@PG  TUBSUT@XJUI  FOET@XJUI  DPOUBJOT 

    ৚݅ ࢦఆͨ͠୯ޠͱҰக͢Δྻ໊Λࢦఆ ࢦఆͨ͠୯ޠͰ࢝·Δྻ໊Λࢦఆ ࢦఆͨ͠୯ޠͰऴΘΔྻ໊Λࢦఆ ࢦఆͨ͠୯ޠؚ͕·ΕΔྻ໊Λࢦఆ
  20. EQMZSUJEZSศརػೳ ·ͱΊͯॲཧ͢ΔͨΊͷศརͳॻ͖ํ  ৚݅ʹ߹Θͤͨॲཧํ๏  999@BU 999@JG 999@BMM  WBST

    ͱGVOT   ྻͷࢦఆํ๏  POF@PG   TUBSUT@XJUI   FOET@XJUI   IFMQFST@&YBNQMF
  21. IFMQFST@&YBNQMF IFMQFSTFYEJBNPOET NVUBUF@JG JTGBDUPS GVOT BTDIBSBDUFS  GBDUPSܕͷྻΛDIBSBDUFSܕʹม׵ HSPVQ@CZ@JG JTDIBSBDUFS

     DIBSBDUFSܕͷྻͷ૊Έ߹Θͤ͝ͱʹ TVNNBSJTF@BU WBST POF@PG Y Z [  ɹɹɹGVOT NJO NBY  Y Z [ͷ࠷খ஋ͱ࠷େ஋Λࢉग़ TFMFDU@BU WBST TUBSUT@XJUI D TUBSUT@XJUI lY  zDzͰ࢝·Δม਺ͱYͰ࢝·Δม਺ͷΈΛநग़
  22. .&/6 3ͷػೳ֦ு  αϯϓϧσʔλͷݺͼग़͠ 3Λ࢖ͬͨσʔλॲཧ  UJEZEBUBͱ͸  EQMZSύΠϓԋࢉࢠͱલॲཧΠϩΠϩ 

    UJEZSQJWPUม׵ͱྻ݁߹  EQMZSUJEZSศརػೳҰཡ  TUSJOHJσʔλܕߴػೳจࣈྻॲཧ  ػೳ঺հ Ұ෦ 
  23. TUSJOHJͷجૅ TUSJOHJͷجຊతͳߏ଄ TUSJ@999@:::@;;;  999ɿSFQMBDF ஔ͖׵͑Δ ͳͲͷॲཧ಺༰  :::ɿෳ਺ॲཧ͕ൃੜ͢Δ৔߹ͷࢦఆ লུ༗

      BMMશͯ pSTU࠷ॳ MBTU࠷ޙ  ;;;ɿจࣈ൑ผͷํ๏ ௨ৗ͸SFHFYͰ0,লུ༗  ˎTUSJOHSͷ৔߹͸TUS@999@:::@;;; ˎҰ෦্ͷ::: ;;;͕ҧ͏৔߹͋Γ
  24. TUSJOHJػೳ঺հ Ұ෦ ؔ਺ TUSJ@SFQMBDF@BMM@SFHFY TUSJ@EFUFDU@SFHFY TUSJ@FYUSBDU@BMM@SFHFY TUSJ@USBOT@UPUJUMF TUSJ@TVC TUSJ@TQMJU@SFHFY ಈ࡞

    จࣈͷஔ͖׵͑ ύλʔϯݕࡧ 536&'"-4&  ύλʔϯநग़ ୯ޠͷઌ಄ͷΈେจࣈʹม׵ จࣈͷ੾ΓऔΓ จࣈͷ෼ׂ ˎ΋ͬͱ͍Ζ͍ΖͰ͖ΔͷͰৄ͘͠஌Γ͍ͨਓ͸ࢀর΁ IUUQTDSBOSQSPKFDUPSHXFCQBDLBHFTTUSJOHJTUSJOHJQEG IUUQTRJJUBDPNLPITLFJUFNTEEBFD