Anything out of place? Please let us know if anything is missing, broken (e.g., broken links), or if there is anything else that would be helpful to include. Feel free to submit any comments to our feedback page.
This class should be a collaborative learning space. Have any helpful links or snipits of code along the way you think would be helpful to to your fellow classmates? Share your nifty-est tips and tricks here!
This page was last updated Wednesday February 24 2021 12:12:02 PM PST
All times are in Pacific Time. Please click on the title to see the session description.
Welcome!
Agenda
Start by doing what is necessary; then do what is possible; and suddenly you are doing the impossible.~ Francis of Assisi
Lesson Recording of lesson Repository Download RepositoryOpen R Studio and check it out:
1. R project
2. Keyboard shortcuts (Tools > Keyboard shortcuts)
3. Workflow (good file structure)- example
4. Basic math
5. Vectors, Matrices, Arrays, Lists, and Data Frames
6. Best Practices Review
Resources
From the presentation:
1. Our Coding Club 2. Wilson et al., 2017 3. Math functions in R (resource) 4. Data Types in ROther great resources:
1. [Textbook] Intro to R for Data Science (Hadley Wickham) 2. [Textbook] Advanced R (Hadley Wickham) 3. R Cheatsheets 4. Jenny Bryan 5. Interactive Learning in R6. Eric Dunford’s Intro to R course & slides: http://ericdunford.com/ppol670/
7. Our Coding Club 8. Swirl R PackageAn informal opprotunity to come by to ask any questions you have about the course, content, or with specific questions about issues you have with the homework or in your own analyses.
Today's Homework
1. Practice the skills we just learned in R! Download and refer to 9_homework1.R 2. Add to Share Insights with one thing you learned!Welcome!
Answers to the homeworkAgenda
You can not use #tidyverse without base R. It is not a dichotomy. Pick the tools that make you most effective.~ The Great Hadley Wickham, creater of Tidyverse
Recording of Lesson Lesson Repository Webpage Download Repository Content 0. Review of how to create R Projects and download content from GitHub1. The importance of checking as you go.
2. Loading libraries (e.g., tidyverse: install.packages() and library())
3. Best practices - ‘renv’ for managing packages
*Note that after this lessson we will be focusing on Tidy methods.
Resources
1. R Project2. The Comprehensive R Archive Network: CRAN and all the packages
3. Tidyverse 4. janitor package (e.g., clean_names()) Guide5. renv package
Guide RStudio::Conf(2020) Talk by Creator Slides from RStudio::Conf(2020) Talk by Creator 6. EXTRAInspiration Time!
You Should Learn to Program - Christian Genco at TEDxSMUAn informal opprotunity to come by to ask any questions you have about the course, content, or with specific questions about issues you have with the homework or in your own analyses.
Today's Homework
1. Practice the skills we just learned in R! Download 3_homework.R
R Script of questions Pretty PDF of questions (made in R Markdown)2. Add to Share Insights with one thing you learned!
Add to the google docs how you will be able to use what you learned today to improve how you work with data 3. Check out the rstudio global(2021) Check out any of the talks, but the first keynote talk by Hadley Wickham might be a good one!I'll help you go through the steps in this guide and get you set up class!
Join me by adding this google calendar event to your calendar. Review of how to create R Projects and download content from GitHubWelcome!
Homework answersAgenda
Achievement is talent plus preparation.~ Malcolm Gladwell, Outliers: The Story of Success
Recording of Lesson Lesson Repository Webpage Download Repository Content1. Workflow
2. snake_case
3. Reading in data, read-in problems and solutions
4. Writing data (e.g., to .csv)
5. Best Practices
Resources
RStudio Cheat Sheets And the tidyverse website (includes free online textbook) Common file types - RStudio import tutorial More file types - DataCamp import tutorialExcel - Here’s some helpful options: http://www.sthda.com/english/wiki/reading-data-from-excel-files-xls-xlsx-into-r
Memory issues Import Data CheatsheetInspiration Time!
101 Data Science QuotesAn informal opprotunity to come by to ask any questions you have about the course, content, or with specific questions about issues you have with the homework or in your own analyses.
Today's Homework
1. Practice the skills we just learned in R!
R Script of questions Pretty PDF of questions (made in R Markdown)2. Add to Share Insights with one thing you learned!
Add to the google docs how you will be able to use what you learned today to improve how you work with dataI'll help you go through the steps in this guide and get you set up class!
Join me by adding this google calendar event to your calendar. Review of how to create R Projects and download content from GitHub (+ new updates!)Agenda
Everybody should learn to program a computer, because it teaches you how to think.~ Steve Jobs
Recording of Lesson Lesson Repository Webpage Download Repository Content1. More wrangling data!
2. Best Practices
An informal opprotunity to come by to ask any questions you have about the course, content, or with specific questions about issues you have with the homework or in your own analyses.
Today's Homework
1. Practice the skills we just learned in R!
R Script of questions Pretty PDF of questions (made in R Markdown)2. Add to Share Insights with one thing you learned!
Add to the google docs how you will be able to use what you learned today to improve how you work with dataI'll help you go through the steps in this guide and get you set up class!
Join me by adding this google calendar event to your calendar. Review of how to create R Projects and download content from GitHub R for Data Science Chapter 8 - WorkflowAgenda
If you have a difficult task to do, give it to a lazy man, he will find an easier way to do it.~ Henry Ford, inventor of the production line and someone who probably would have been a programmer if he were alive to see computers.
Recording of Lesson Lesson Repository Webpage Download Repository ContentNOTE ABOUT LECTURE -- We only got through half the lecture, so do not no need to review any of the functions material. Funcitons will be covered next lesson!
1. Writing
2. Checking
3. Calling
4. Best practices -roxygen2 documentation
5. Best Practices - Modular coding style
Resources
If-Else Statements
Fast and Readable If Else in R R if else elseif Statement R for Data Science - Chapter 19 covers functions and includes a section on if/else statements. Data Quest - skip while sectionFor Loops
Data Camp R for Data Science - Chapter 21 Iterations including for loops. DataCamp - beginning is helpful, skip apply functionsAn informal opprotunity to come by to ask any questions you have about the course, content, or with specific questions about issues you have with the homework or in your own analyses.
Today's Homework
1. Practice the skills we just learned in R!
NOTE - As you go through the homework, please refer to the PDF version. There are helpful figures thre to assist you!
R Script of questions Pretty PDF of questions (made in R Markdown)2. Add to Share Insights with one thing you learned!
Add to the google docs how you will be able to use what you learned today to improve how you work with dataI'll help you go through the steps in this guide and get you set up class!
Join me by adding this google calendar event to your calendar Review of how to create R Projects and download content from GitHub R for Data Science Chapter 8 - WorkflowAgenda
[Bad file and data management] ...prepetuate inequalities when people have to start from scratch. Future you is your most important collaborator~ Julia Stewart Lowndes
Recording of Lesson First Lesson on Functions Part 2 (Rollover from Last Lesson; UPDATED POST-LECTURE) Repository Webpage Download Repository Content Best RACE-GAP Coding PracticesLearn about how to write and prepare a script by...
1. Conforming to a predictable script structure
2. Annotation
3. Never repeating code
4. Naming files with predictable and helpful names
5. Predictable folder structure
6. Scripts with specific tasks
7. Saving scripts in an “R Project
Resources
Best Practices
Wilson, G., Bryan, J., Cranston, K., Kitzes, J., Nederbragt, L., & Teal, T. K. (2017). Good enough practices in scientific computing. PLoS computational biology, 13(6), e1005510. Functions
R for Data Science - Chapter 19 covers functions and includes a section on if/else statements.An informal opprotunity to come by to ask any questions you have about the course, content, or with specific questions about issues you have with the homework or in your own analyses.
Today's Homework 1. Watch Julia Stewart Lowdes' Talk @ Groundfish Seminar2. Practice the skills we just learned in R!
NOTE - As you go through the homework, please refer to the PDF version. There are helpful figures thre to assist you!
R Script of questions Pretty PDF of questions (made in R Markdown)3. Add to Share Insights with one thing you learned!
Add to the google docs how you will be able to use what you learned today to improve how you work with dataI'll help you go through the steps in this guide and get you set up class!
Join me by adding this google calendar event to your calendar Review of how to create R Projects and download content from GitHub R for Data Science Chapter 8 - WorkflowAgenda
Maybe stories are just data with a soul.~ Brené Brown, American professor, lecturer, author, and podcast host
Recording of Lesson Lesson Repository Webpage Download Repository Content1. ggplot
2. tables3. formattable
4. gt()
Resources
Graphics principles Comprehensive ggplot2 guideThemes
Themes Make your own themes (we won’t cover this today, but you can learn how)Tables
gt table Other table packagesColors
CheatsheetNamed colors: http://www.stat.columbia.edu/~tzheng/files/Rcolor.pdf
Hex colors Color brewer Color schemes Color blindness upload colorblindr packageAn informal opprotunity to come by to ask any questions you have about the course, content, or with specific questions about issues you have with the homework or in your own analyses.
Today's Homework
1. Practice the skills we just learned in R!
R Script of questions2. Add to Share Insights with one thing you learned!
Add to the google docs how you will be able to use what you learned today to improve how you work with dataI'll help you go through the steps in this guide and get you set up class!
Join me by adding this google calendar event to your calendar Review of how to create R Projects and download content from GitHub R for Data Science Chapter 8 - WorkflowWelcome!
Homework answers (.R)Agenda
I never guess. It is a capital mistake to theorize before one has data. Insensibly one begins to twist facts to suit theories, instead of theories to suit facts... The temptation to form premature theories upon insufficient data is the bane of our profession.~ Sherlock Holmes, as written by Arthur Conan Doyle
Recording of Lesson Part 1 Lesson Repository Webpage Download Repository Content1. lm(), glm(), gam()
2. Other models (?)
3. Broom package
Resources
1.
An informal opprotunity to come by to ask any questions you have about the course, content, or with specific questions about issues you have with the homework or in your own analyses.
Today's Homework
1. Practice the skills we just learned in R!
R Script of questions2. COOKIES
Repository Webpage Download Repository3. Add to Share Insights with one thing you learned!
Add to the google docs how you will be able to use what you learned today to improve how you work with data
I'll help you go through the steps in this guide and get you set up class!
Join me by adding this google calendar event to your calendar Review of how to create R Projects and download content from GitHub R for Data Science Chapter 8 - WorkflowNo lesson powerpoint today!
Sit back and enjoy the lesson and get excited to be part of the R community here in RACE! Recordings will be posted after the lecture.
Recording of LessonAn informal opprotunity to come by to ask any questions you have about the course, content, or with specific questions about issues you have with the homework or in your own analyses.
Homework answers (.R) Cookie example answers (.R)