Introduction to R === URL to this page: https://hackmd.io/@k8hertweck/introR **Sign in to each class meeting** [here](https://goo.gl/forms/j4MbWJuPoIYeJET12) Have you installed R and RStudio to the latest versions? Have you also installed tidyverse? See our [Software](https://github.com/fredhutchio/fredhutch.io/blob/gh-pages/software.md#r-and-rstudio) instructions for links! This page is for easy access to links we'll use during class. You don't need to do anything with this information until directed by your instructor. If you have feedback about this course, please [comment here](https://goo.gl/forms/Bw8dTV0Wghq2iG5i2) Complete class notes for all [here](https://fredhutchio.github.io/r_intro/). **Class 1: introduction to R syntax and RStudio** * [Complete class notes](https://fredhutchio.github.io/r_intro/class1) * [R style guide](http://adv-r.had.co.nz/Style.html) * instructor script for class 1 downloadable from [here](https://www.dropbox.com/s/r9i9e0ej0euofni/class1.R?dl=0) **Class 2: Working with data frames** * [Complete class notes](https://fredhutchio.github.io/r_intro/class2) * [Tidy data chapter from "R for Data Science"](https://r4ds.had.co.nz/tidy-data.html) * URL for direct download into R from GitHub: https://raw.githubusercontent.com/fredhutchio/R_intro/master/extra/clinical.csv * Other example data files: * example1: https://raw.githubusercontent.com/fredhutchio/R_intro/master/extra/clinical.tsv * example2: https://raw.githubusercontent.com/fredhutchio/R_intro/master/extra/clinical.txt * [Working on categorical data in R without losing your mind](https://peerj.com/preprints/3163/) * If you don't want to scroll to the right in your script (source window) to see your code, wrap the text by: * Going to the Tools menu, then selecting Global Options (this changes the setting for all your projects) * Select the Code tab on the left * Check the box for "Soft wrap R source files", then click OK **Class 3: Data manipulation with dplyr** * [Complete class notes](https://fredhutchio.github.io/r_intro/class3) * If R says your data file does not exist, you have probably not opened your project: * save your script in your project directory * go to File -> Open Project * navigate to the directory containing your project and click open * the path (location in your computer) at the top of the console (bottom left hand panel) should now be the location of your project directory * [Tidyverse website](https://www.tidyverse.org) * [dplyr cheetsheet](https://github.com/rstudio/cheatsheets/raw/master/data-transformation.pdf) **Class 4: Data visualization** * [Complete class notes](https://fredhutchio.github.io/r_intro/class4) * link to smoke_complete: https://raw.githubusercontent.com/fredhutchio/R_intro/master/extra/smoke_complete.csv * * link to birth_reduced: https://raw.githubusercontent.com/fredhutchio/R_intro/master/extra/birth_reduced.csv * [ggplot documentation](https://ggplot2.tidyverse.org) * [ggplot cheatsheet](https://github.com/rstudio/cheatsheets/blob/master/data-visualization-2.1.pdf) * [ggplot colors](http://sape.inf.usi.ch/quick-reference/ggplot2/colour) * [viridis color palettes](https://cran.r-project.org/web/packages/viridis/vignettes/intro-to-viridis.html) * [legends](https://www.datanovia.com/en/blog/ggplot-legend-title-position-and-labels/#rename-legend-labels-and-change-the-order-of-items) * **Please complete the post-class survey available through Hutch Learning**, and/or add feedback about additional courses you would like using [this form](https://goo.gl/forms/Bw8dTV0Wghq2iG5i2) **Resources for continued learning** * Learn about other courses through fredhutch.io [here](http://www.fredhutch.io/resources/). Intermediate R courses include the following: * Intermediate R: Machine Learning (in development) * Intermediate R: Data Visualization (in development) * Intermediate R: Programming (based on [these lessons](http://swcarpentry.github.io/r-novice-inflammation/) from Software Carpentry) * The Fred Hutch Bioinformatics and Data Science Cooperative, or Coop, hosts many community meetings and office hours about data science. Learn more information about these groups [here](https://sciwiki.fredhutch.org/scicomputing/reference_training/#community-groups) * Join the [Coop Community Slack](https://join.slack.com/t/fhbig/shared_invite/enQtMzUyMDIxNzk3MDU3LWE5NGUyMTY1NGU0N2VmMmEyNTM5YzM1MmNlMTk2YmM1OWNkMmJiNTQxMTQ4OTNkMTFjMjk3M2Q0MzkwYzQ3NDA) to talk about data science with other Hutch researchers. There is a channel specifically for discussions about R! * The [Fred Hutch Biomedical Data Science Wiki](https://sciwiki.fredhutch.org) is written by Hutch researchers and staff, and is a great place to find information about data management, bioinformatics, computing, and more. ###### tags: `fredhutch.io` `R`