DFCI Introduction to R and RStudio

DFCI Introduction to R and RStudio

E1a375fbe8cc71e23307a519eb4848e9?s=128

Patrick Kimes

October 01, 2019
Tweet

Transcript

  1. Introduction to R/RStudio Patrick Kimes, PhD Postdoctoral Fellow Dana-Farber Cancer

    Institute Harvard TH Chan School of Public Health Top Ten Seminars October 1, 2019
  2. October 1, 2019 October 22, 2019 November 12, 2019 December

    10, 2019 January 21, 2020 February 11, 2020 March 17, 2020 April 14, 2020 May 19, 2020 June 16, 2020 Introduction to R and RStudio Data visualization with ggplot2 Data visualization principles and plots to avoid Design of Clinical Trials Basics Correlation: you are probably using it wrong How to detect and deal with batch effects Brief introduction to machine learning Culprits of the reproducibility crisis: multiple testing and p-hacking Experimental Design: How many size and should I pool? Detecting differentially expressed genes with RNA-seq top ten seminars in data science
  3. R and RStudio?

  4. R and RStudio? programming language R think Java, C, C++,

    Python, …
  5. RStudio programming language R and RStudio? software to make data

    analysis with R easier
  6. RStudio programming language R and RStudio? programming language R software

    to make data analysis with R easier
  7. None
  8. RStudio engine R dashboard

  9. why R and RStudio?

  10. what about SAS? why R and RStudio?

  11. what about SAS? • R is free, open source •

    R is the home of new methods • R has a large, active community • R is highly interoperable, extensible why R and RStudio?
  12. what about Python? why R and RStudio?

  13. what about Python? • Good question! Up to you! •

    R is arguably easier to learn • R has more statistical tools • R makes exploration and visualization easier why R and RStudio?
  14. why R and RStudio?

  15. it gets you to the data fast! why R and

    RStudio?
  16. it gets you to the data fast! and that’s fun!

    https://twitter.com/avogado6/status/1165595520967954432
  17. who already has R / RStudio installed?

  18. how to install R and RStudio

  19. None
  20. how to install R and RStudio 1. Search “R”, 


    Search “RStudio” 2. Install “R”, 
 Install “RStudio”
  21. how to install R and RStudio 1. Search “R”, 


    Search “RStudio” 2. Install “R”, 
 Install “RStudio” maybe a few more steps so please do this later a much better guide: rafalab.github.io/dsbook/installing-r-rstudio
  22. lucky us! we have a workaround! https://rstudio.cloud

  23. lucky us! we have a workaround! https://rstudio.cloud do this

  24. lucky us! we have a workaround! https://rstudio.cloud this too

  25. lucky us! we have a workaround! https://rstudio.cloud select [from Git

    repo]
  26. lucky us! we have a workaround! https://rstudio.cloud enter https://github.com/pkimes/dfci-introR

  27. welcome to RStudio!

  28. local RStudio select [New Project]

  29. local RStudio select [Version Control]

  30. local RStudio we’ll use [Git]

  31. local RStudio enter https://github.com/pkimes/dfci-introR

  32. we’re good to go!

  33. you now have a project! what’s an RStudio project? basically

    a folder to organize an analysis • input data • R scripts • results/figures
  34. coding coding coding coding coding coding coding coding coding coding

    coding coding coding coding coding coding coding coding coding coding let’s give it a try!
  35. arithmetic variables functions help installing packages loading packages for-loops what

    did we (hopefully) cover?
  36. some pieces in the modern (R) data scientist’s toolbox

  37. some pieces in the modern (R) data scientist’s toolbox rmarkdown

    tidyverse shiny [bioconductor] documentation, communication data manipulation, visualization web application framework community of genomics packages
  38. some pieces in the modern (R) data scientist’s toolbox rmarkdown

    tidyverse shiny [bioconductor] documentation, communication data manipulation, visualization web application framework community of genomics packages
  39. .R file

  40. .R file .Rmd file

  41. .R file .Rmd file formal header

  42. .R file .Rmd file code “chunks”

  43. .R file .Rmd file plain text (markdown)

  44. .R file .Rmd file specified output format

  45. .Rmd file

  46. .Rmd file formatted text output! R code

  47. rmarkdown documentation, communication myfile.Rmd markdown + R code chunks

  48. rmarkdown documentation, communication myfile.Rmd markdown + R code chunks markdown

    myfile.md execute R code
  49. rmarkdown documentation, communication myfile.Rmd markdown + R code chunks markdown

    myfile.md execute R code pandoc conversion
  50. rmarkdown documentation, communication rmarkdown.rstudio.com

  51. coding coding coding coding coding coding coding coding coding coding

    coding coding coding coding coding coding coding coding coding coding let’s give it a try!
  52. what did we (hopefully) cover? create a new Rmd file

    writing simple markdown creating code chunks executing code knitting documents
  53. some pieces in the modern (R) data scientist’s toolbox rmarkdown

    tidyverse shiny [bioconductor] documentation, communication data manipulation, visualization web application framework community of genomics packages
  54. some pieces in the modern (R) data scientist’s toolbox rmarkdown

    tidyverse shiny [bioconductor] documentation, communication data manipulation, visualization web application framework community of genomics packages
  55. tidyverse data manipulation, visualization tidyverse.org

  56. some pieces in the modern (R) data scientist’s toolbox rmarkdown

    tidyverse shiny [bioconductor] documentation, communication data manipulation, visualization web application framework community of genomics packages
  57. shiny web application framework shiny.rstudio.com

  58. shiny web application framework shiny.rstudio.com/gallery/kmeans-example

  59. some pieces in the modern (R) data scientist’s toolbox rmarkdown

    tidyverse shiny [bioconductor] documentation, communication data manipulation, visualization web application framework community of genomics packages
  60. bioconductor community of genomics packages bioconductor.org

  61. bioconductor community of genomics packages CRAN Bioconductor • genomic focus

    • software • annotations • data • package reviews • scope • consistency
  62. awesome!

  63. where do we go from here?

  64. where do we go from here? wait, I’m lost

  65. introduction to data science rafalab.github.io/dsbook

  66. RStudio Cloud tutorials rstudio.cloud

  67. r4ds.had.co.nz R for data science

  68. learn the tidyverse tidyverse.org/learn

  69. advanced R adv-r.hadley.nz

  70. biomedical data science open online training rafalab.github.io/pages/harvardx

  71. … and because it’s 2019, deep learning tensorflow.rstudio.com

  72. questions? wait, I’m still lost