データ分析者のためのRStudio活用術 / pyrintegration

D12a80cab206033a820ccff8319f957b?s=47 Uryu Shinya
October 26, 2019

データ分析者のためのRStudio活用術 / pyrintegration

Tokyo.R #82 発表資料(デモンストレーションのスライドなし)

D12a80cab206033a820ccff8319f957b?s=128

Uryu Shinya

October 26, 2019
Tweet

Transcript

  1. σʔλ෼ੳऀͷͨΊͷ 34UVEJP׆༻ज़ Uryu Shinya @u_ribo 5PLZP3

  2. ਅͷʮσʔλ෼ੳऀʯ͸ Ͳ͜ʹ͍Δʁ https://twitter.com/sinhrks/status/820237538098958336

  3. 34UVEJP*%& ʮ3ͷಋೖͱ34UVEJPࣄ࢝Ί վగ൛ ʯΑΓҾ༻ https://www.slideshare.net/TakashiYamane1/rrstudio/11 W ೥݄೔ͷϦϦʔε W  EBJMZCVJMETͰ͸W

    W 3ϢʔβͷͨΊͷ34UVEJP࣮ફೖ໳ দଜ΄͔ ೥݄
  4. 1ZUIPO 42-࿈ܞػೳͷڧԽ ύωϧͷਐԽʜ$POOFDUJPOT 5FSNJOBM +PCT https://rstudio.com/products/rstudio/release-notes/ WdWͰͷओͳػೳมߋ NBUQMPUMJCͰͷ࡞ਤ͕QMPUύωϧʹදࣔ͞ΕΔΑ͏ʹ 3 1ZUIPOؒͰͷΦϒδΣΫτڞ༗͕؆қʹ

    SFUJDVMBUFύοέʔδ 4UBOͷཪͰ3Λճ͢https://dastatis.github.io/pdf/StanAdvent2018/IntroJobsPane.html KPCTύωϧͰͷόοΫάϥ΢ϯυ࣮ߦ :PVEPOPUIBWFUPXBJUVOUJMQSPDFTTJOHJTDPNQMFUFhttps://kazutan.github.io/tokyoR71/kazutan_tokyor71.html#1
  5. WdWͰͷओͳػೳมߋ ೔ຊޠೖྗ؀ڥͷվળʢʁʣ ςʔϚɺ؀ڥઃఆ 34UVEJPؔ࿈νʔϜʹΑΔύοέʔδͷਐԽɺίϛϡχςΟαϙʔτ SMJC STUVEJPFEVDBUJPO TPMFOH SUFOTPSqPX

  6. 34UVEJPʮྗ͕ཉ͍͔͠ʜʯ ˞ݸਓͷໝ૝Ͱ͢ ͱ ͲͪΒ΋࢖͍͜ͳͤΔ ʮୡਓʯΛ໨ࢦͦ͏

  7. σʔλ෼ੳͰͷڞ௨՝୊ʜ σʔλڞ༗ ύοέʔδ؅ཧ ͷ࿩୊Λఏڙ͠·͢ʂ ৽͍͠34UVEJPɺ ύοέʔδΛ࢖ͬͨ

  8. ঺հ͢ΔػೳͷҰ෦͸ ։ൃதͷ΋ͷͰ͢ɻ কདྷͷ࣮૷ʹ͓͍ͯ มߋ͞ΕΔՄೳੑ͕͋Γ·͢ɻ ͓͜ͱΘΓ v1.3 ˢW౥ࡌ༧ఆͷػೳ͸ ΞΠίϯͰࣔ͠·͢

  9. Project Environments CRAN: v0.8.0 rstudio/renv env

  10. 3ύοέʔδͷอଘઌ 3ͷϚΠφʔόʔδϣϯ FHW W ͝ͱʹҰͭ tidyr 1.0.0 tidyr 1.0.0.9000 tidyr

    0.8.3 ෳ਺ͷόʔδϣϯΛϓϩδΣΫτ͝ͱʹ੾Γସ͑͸Ͱ͖ͳ͍ ύοέʔδͷґଘؔ܎ʹΑΔӨڹΛड͚Δ .libPaths() [1] "/usr/local/lib/R/3.6/site-library" [2] "/usr/local/Cellar/r/3.6.1_1/lib/R/library"
  11. 3ύοέʔδͷอଘઌ tidyr 1.0.0 3ͷϚΠφʔόʔδϣϯ FHW W ͝ͱʹҰͭ tidyr 1.0.0.9000 tidyr

    0.8.3 ෳ਺ͷόʔδϣϯΛϓϩδΣΫτ͝ͱʹ੾Γସ͑͸Ͱ͖ͳ͍ ύοέʔδͷґଘؔ܎ʹΑΔӨڹΛड͚Δ .libPaths() [1] "/usr/local/lib/R/3.6/site-library" [2] "/usr/local/Cellar/r/3.6.1_1/lib/R/library"
  12. SFOWΛར༻͢Δ RϓϩδΣΫτ಺Ͱύοέʔδ͕؅ཧ͞ΕΔ OS, ϚΠφʔόʔδϣϯͰͷࡉ෼ ඪ४ύοέʔδΠϯετʔϧઌ΁ͷγϯϘϦοΫϦϯΫ .libPaths() [1] "/Users/uri/Documents/slides/talk_191026_tokyor82/renv/ library/R-3.6/x86_64-apple-darwin18.6.0" [2]

    "/private/var/folders/ty/j83j79pj6_s97qx4vlylnzzw0000gn/T/ RtmphSKMRs/renv-system-library" tidyr 1.0.0 tidyr 1.0.0.9000 tidyr 0.8.3 ϓϩδΣΫτʹ ࣮ମ͕͋Δ
  13. File —> New Project… طଘϓϩδΣΫτͰͷར༻ SFOWΛར༻͢Δ v1.3 renv ::init() 1BDLBHF؅ཧͷύωϧ͕SFOW࢓༷ʹ

  14. SFOWཧղͷͨΊͷཁ఺ Isolated Portable Reproducible ϓϩδΣΫτ୯ҐͰͷύοέʔδґଘঢ়ଶɺ (JUίϛοτཤྺʹجͮ͘ঢ়ଶͷ෮ݩ ར༻͢ΔύοέʔδΛه࿥ͨ͠MPDLϑΝΠϧ +40/ Λ΍ΓͱΓ͢Δ͚ͩ ϓϩδΣΫτ͝ͱʹར༻ύοέʔδɺόʔδϣϯΛ

    ੾Γସ͑ΒΕΔɺΩϟογϡͷར༻ʹΑΔޮ཰Խ લ਎తͳҐஔ෇͚ͷQBDLBSBUύοέʔδ͔Βͷվળ͕ओ
  15. SFOWཧղͷͨΊͷཁ఺ ʮSFOWʹΑΔύοέʔδ؅ཧʯΑΓҾ༻ https://speakerdeck.com/black_tank_top/renv-version-control?slide=13

  16. SFOWཧղͷͨΊͷཁ఺ snapshot() init() restore() ه࿥ ෮ݩ install() status() renv.lock renv.lock

  17. 3ຊମͷόʔδϣϯΞοϓʹ͸ Ҿ͖ଓ͖ཹҙ͕ඞཁ ύοέʔδ͕ґଘ͢ΔγεςϜ͕ ݪҼͰͭ·ͮ͘Մೳੑ͸࢒Δ ஫ҙ ʜΑΓݎ࿚ͳ࠶ݱੑ؀ڥΛٻΊΔͳΒʁ /&95

  18. %PDLFS؀ڥதͰͷར༻ %PDLFSpMFͷ؅ཧ खಈͰͷ௥Ճɾ࡟আɾมߋ ͕ෆཁ %PDLFSϗετͱίϯςφؒͰ ύοέʔδ͕ἧ͏ 3ຊମͷόʔδϣϯΛݻఆ

  19. ඞཁͳύοέʔδΛඞཁͳ࣌ʹ ·ͩෆ҆ఆͳ෦෼΋ɻ ϑΟʔυόοΫ͠Α͏˙  ˙ $3"/ϦϦʔε଴ͪ˙ SFOW·ͱΊ

  20. Pin, Discover and Share Resources CRAN: v0.2.0 rstudio/pins pins

  21. ΢Σϒ্σʔλιʔεͷଟ༷Խ ಡΈࠐΈํ๏΋ෳࡶ ͰࡁΉ΋ͷ download.file() 3ύοέʔδΛ࢖͏΋ͷ "1*Λܦ༝͢Δ΋ͷ ͱ ؒͰͷڞ༗΋ߟྀ͍ͨ͠ ςʔϒϧҎ֎ͷΦϒδΣΫτ΋ඞཁ ΦϑϥΠϯͰ΋ࢀর͍ͨ͠ʜ

  22. σʔλڞ༗Λָʹ͢Δ σʔλͷڞ༗ઌʢϘʔυʣ 3ύοέʔδ͓Αͼ 1ZUIPOϥΠϒϥϦͱͯ͠ఏڙ Local 3 GitHub Kaggle RStudio Connect

  23. QJOTཧղͷͨΊͷཁ఺ ର৅ͷϘʔυΛࢦఆ board_register(board = ) σʔλΛ୳͢ pin_find(text = , board

    = ) pin(board = ) pin_get(name = ,board = ) ొ࿥ ࢀর pins.board_register(board =) pins.pin_get(name = , board =)
  24. 34UVEJP͔Βͷૢ࡞ v1.3 v1.2͔ΒͰ΋ྑ͍͔΋ connection ΞυΠϯ

  25. ࠓޙ௥Ճ͞ΕΔ༧ఆͷϘʔυ ౷Ұ͞Εͨ ΠϯλʔϑΣʔε Ͱศར

  26. Interface to 'Python' CRAN: v1.1.3 rstudio/reticulate reticulate

  27. 34UVEJPͰ1ZUIPOΛ࣮ߦ λʔϛφϧ͔Βͷ࣮ߦ R MarkdownͷΤϯδϯࢦఆ reticulate ::repl_python() renv؀ڥͰPython؀ڥΛར༻ (conda, virtualenv)… requirements.txt,

    environment.yml ΋߹Θͤͯ؅ཧ
  28. ENJOY