第86回Tokyo.R初心者セッション:データ解析

 第86回Tokyo.R初心者セッション:データ解析

第86回Tokyo.R初心者セッションでトークした際のスライドです。

8284465a94bbdf1ea82cf1a67d55f447?s=128

kilometer

June 27, 2020
Tweet

Transcript

  1. BeginneR Session - Data Analysis - #86 Tokyo.R 2020.06.27 @kilometer00

  2. Who!? 誰だ?

  3. Who!? 名前: 三村 @kilometer 職業: ポスドク (こうがくはくし) 専⾨: ⾏動神経科学(霊⻑類) 脳イメージング

    医療システム⼯学 R歴: ~ 10年ぐらい 流⾏: 三体
  4. ・RStudio ・ Readable coding

  5. ・RStudio ・ Readable coding ・Tidy data ・Tidyverse

  6. h"ps://rstudio.com/

  7. Input Output

  8. Integrated Development Environment RStudio h6ps://rstudio.com/ Recommended!!

  9. RStudio

  10. RStudio File > New File > R script (⌘ +

    ⇧ + N) Script Editor Console Files, Plots, Pkgs, ... Env., HIstoly, Git, ...
  11. RStudio File > New File > R script (⌘ +

    ⇧ + N) Script Editor Console Files, Plots, Pkgs, ... Env., HIstoly, Git, ... ≈ Run
  12. RStudio select, ⌘ + ↩ ≈ Run

  13. Integrated Development Environment RStudio

  14. RStudio

  15. Projects RStudio

  16. File > New Project > New Directory > New Project

    > Create New Project
  17. my_project my_project.Rproj .Rproj.user ~/Documents/R Auto saved working information (Unsaved edits,

    tab order, etc.) Project Root folder Workspace setting Project Folder Open RStudio
  18. my_project my_project.Rproj ~/Documents/R Project Folder data fig script.R

  19. my_project my_project.Rproj ~/Documents/R Project Folder data fig script.R data_raw data_all.csv

    dat1.csv dat2.csv dat3.csv
  20. my_project my_project.Rproj ~/Documents/R Project Folder data fig script.R data_raw data_all.csv

    dat <- read.csv("data/data_all.csv") Rela>ve path Project Root dat1.csv dat2.csv dat3.csv
  21. ~/Documents/R project1 project2 project3 project4

  22. Project ≠ sandbox

  23. Sandbox

  24. Sandbox h)p://www.sandart-j.com/work/work3.html h)p://buzz-plus.com/2014/07/25/suna/

  25. Sandbox A h+p://www.sandart-j.com/work/work3.html h+p://buzz-plus.com/2014/07/25/suna/ Sandbox B

  26. Sandbox A h+p://www.sandart-j.com/work/work3.html h+p://buzz-plus.com/2014/07/25/suna/ Sandbox B Isolated & Independent

  27. "Sandbox" in Python [python] version = "3.7" [packages] cycler==0.10.0 kiwisolver==1.1.0

    matplotlib==3.1.1 numpy==1.16.4 opencv-python==4.1.0.25 pandas==0.25.0 pyparsing==2.4.0 PypeR==1.1.2 ... [python] version = "2.7" [packages] numpy==1.16.4 ... cf. hEps://speakerdeck.com/kilometer/tokyo-dot-r-number-80-r-interface-to-python
  28. Sandbox environments?

  29. R & RStudio Projects

  30. h"ps://towardsdatascience.com/crea3ng-sandbox-environments-for-r-with-docker-def54e3491a3 If you want,

  31. my_project my_project.Rproj ~/Documents/R "4dy" folder structure data fig script.R data_raw

    data_all.csv dat1.csv dat2.csv dat3.csv
  32. 『アンチ整理術』森 博嗣, 2019, ⽇本実業出版社

  33. 『アンチ整理術』森 博嗣, 2019, ⽇本実業出版社 整理・整頓する、という ⾏為には、デザインされた ⽅針が前提になっている。

  34. ظ٭ذ 䗯㕔 㲔㏇ 鈝峮ס僗扛מ׻׼׍ 㰆㏇׊יַ׾׵סאס׵ס 㲔㏇؅瑞⺘⴫׊ג辐霄 䗯㕔סֹה䙫䓙⚥鷼٬ 鉮ꃿ٬⭚杼מ鸵׊ג ⫋⮵榫⺎耆ם׵ס 瑞⺘⴫

    鈝㴔 鈝峮 湳釶
  35. &ODPEF "QQMF 3FBM "QQMF *OGPSNBUJPO %FDPEF

  36. %JWFSHFODF 3FBM *OGP %BUB "QQMF &ODPEJOH

  37. -PTT͛ Symbol grounding problem %JWFSHFODF 3FBM *OGP %BUB "QQMF &ODPEJOH

  38. "QQMF &ODPEF 'SVJU 3FE  JNBHF 3FBM *OGPSNBUJPO

  39. "QQMF &ODPEF 'SVJU 3FE  JNBHF 3FBM *OGPSNBUJPO DIBOOFM

  40. 『アンチ整理術』森 博嗣, 2019, ⽇本実業出版社 整理・整頓する、という ⾏為には、デザインされた ⽅針が前提になっている。

  41. Exploratory Data Analysis

  42. None
  43. Exploratory Data Analysis "The Future of Data Analysis" Tukey, J.

    W., 1962 Three of the main strategies of data analysis are: 1. graphical presenta;on. 2. provision of flexibility in viewpoint and in facili;es, 3. intensive search for parsimony and simplicity. Brillinger, D. R., 2011
  44. Exploratory Data Analysis "The Future of Data Analysis" Tukey, J.

    W., 1962 "Exploratory Data Analysis" Tukey, J. W., 1970 "Exploratory data analysis isolates pa3erns and features of the data and reveals these forcefully to the analyst" "Exploratory data analysis’ is an a:tude, a state of flexibility, a willingness to look for those things that we believe are not there, as well as those we believe to be there" Brillinger, D. R., 2011
  45. Confirmatory (Hypothesis tes2ng) Exploratory Data analysis

  46. Confirmatory (Hypothesis tes2ng) Exploratory Data analysis Tidy (needless to say)

    Un0dy Need to be thought of "2dy data" (because it isn't)
  47. Confirmatory (Hypothesis tes2ng) Exploratory Data analysis

  48. Confirmatory (Hypothesis tes2ng) Exploratory Data analysis Generalized procedures Improvisa2on

  49. Data Pipeline spaghe. code!! spaghe. code? readable coding

  50. Programing Write Run Read Think

  51. Run!!! h&ps://www.amazon.co.jp/dp/B00Y0UI990/

  52. Programing Write Run Read Think

  53. Programing Write Run Read Think coding style

  54. The %dyverse style guide h"ps://style.,dyverse.org/ "Good coding style is like

    correct punctua,on: you can manage without it, bu,tsuremakesthingseasiertoread." Google's R Style Guide h"ps://style.,dyverse.org/ "The goal of the R Programming Style Guide is to make our R code easier to read, share, and verify." R coding style guides
  55. The %dyverse style guide h"ps://style.,dyverse.org/ "Good coding style is like

    correct punctua,on: you can manage without it, bu,tsuremakesthingseasiertoread." Google's R Style Guide h"ps://style.,dyverse.org/ "The goal of the R Programming Style Guide is to make our R code easier to read, share, and verify." R coding style guides
  56. Programing Write Run Read Think Write Run Read Think Share

  57. Text Figure Information Intention Data decode encode feedback Programing

  58. None
  59. None
  60. ・RStudio ・Readable coding ・Tidy data ・Tidyverse

  61. Enjoy!!