2 Review
🚩 Pre-Class Learnings
To prepare for this lesson, do the followings:
- Read File Organization Appendix
- Read Git & GitHub Appendix
- Read Keyboard Shortcut Appendix
- Open your portfolio GitHub repository and note how the files are organized
🔥 Data Story Critique
Go to https://rhythm-of-food.net/#explore-foods then answer the following questions:
- What is the data story?
- What is effective?
- What could be improved?
ImportantICA Instructions
Before starting, review the ICA Instructions ⭐ for details on pair programming and activity procedures.
🧩 Learning Goals
By the end of this lesson, you should be able to:
- Navigate the file system of your portfolio and homework repositories
- Explain the difference between absolute and relative file paths and why relative file paths are preferred when referencing files
- Construct relative file paths to read in data
- Review data wrangling from COMP/STAT 112
- Use the
gitverbs (via Github.com and Github Desktop):clone,add,commit,push, andpullto interact with your repositories - Practice using keyboard shortcuts
Exercise
Download the code and data files linked in the Code Links area at the end of the table of contents of the page. Move the code file to ica folder in your portfolio repository and the data file to ica\data\raw folder. Open the code file and follow the instructions.
Solutions
- Load packages and read in data.
Solution
- Clean the
PrecipYrby replacing 99999 withNA.
- Add
dateInYearvariable.
Solution
- Add in 3-letter month abbreviations.
Solution
# A tibble: 6 × 19
Month Day Low High NormalLow NormalHigh RecordLow LowYr RecordHigh HiYear
<dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl>
1 11 20 48 55 48 62 35 1964 69 2005
2 6 16 52 68 53 70 46 1952 90 1961
3 5 9 47 63 50 66 41 1950 88 1993
4 10 26 47 69 52 69 39 1954 89 2003
5 9 27 55 82 55 73 47 1955 96 2010
6 7 6 52 70 54 71 47 1953 86 1957
# ℹ 9 more variables: Precip <dbl>, RecordPrecip <dbl>, PrecipYr <dbl>,
# date <chr>, Record <lgl>, RecordText <chr>, RecordP <lgl>, CulmPrec <dbl>,
# month_name <chr>
- Write out clean data to a CSV file.