Code
install.packages("babynames")
Nicholas Schwab
November 30, 2024
The final project instructions can be found here.
Today and Wednesday you should mostly work on Project 3 in class
Here is the link to project 3.
I encourage you to work with a new partner in the class to experiance what it is like working with another person on github.
Quiz 3 is available and due by Sunday.
It is due next Monday.
Simple features and Shape files.
Quiz 3 on mapping is open, don’t take it until after Monday’s class.
Let’s finish this problem from last class.
Make a function that takes a df and a variable then produces a scatter plot of that variable vs cesd. Use it to plot multiple graphs of the first 6 numeric variables HELPrct. Hint: check out the extended example from 7.7
Making our own functions
Making our own functions
Make a new private repo
Move all your website files to that repo
Add your project 1 to your website.
You could just link it to the main page
#| echo: False to hide code from a code chunk.
#| eval: False to not include the output of the code.
What more to do?
Project 1 grades are up and current. Please let me know if you cannot see grades on moodle.
Project 2 workday
Lab 5 reflection - personal information
Many to one join warning.
We’ll do Problems Chapter 4: 1,2,5,9,(12) in class today. Chapter 5: 3,4
before rendering:
#| eval: FALSE
in lab 4 (due Friday)gitignore:
Don’t push the sqf_2011.csv
to github you will get an error! Its too big
.gitignore
file and add sqf_2011.csv
to it.Exploration: How to join tables?
rendering:
#| eval: FALSE
in lab 4 (due Friday)gitignore:
Don’t push the sqf_2011.csv
to github you will get an error! Its too big
.gitignore
file and add sqf_2011.csv
to it.dpylr cheatsheet for wrangling
Random_subset <- tibble::tribble(
~year,~sex, ~name, ~n, ~prop,
2003, "M", "Bilal", 146, 0.0000695,
1999, "F", "Terria", 23, 0.0000118,
2010, "F", "Naziyah", 45, 0.0000230,
1989, "F", "Shawana", 41, 0.0000206,
1989, "F", "Jessi", 210, 0.000105,
1928, "M", "Tillman", 43, 0.0000377,
1981, "F", "Leslee", 83, 0.0000464,
1981, "F", "Sherise", 27, 0.0000151,
1920, "F", "Marquerite", 26, 0.0000209,
1941, "M", "Lorraine", 24, 0.0000191
)
Working on projects together.
Consider the ethics.
You might realize you are sharing an API key. Consider what that means.
Consider code layout.
Remember to comment your code.
Follow tidyverse style guide.
Practice a pull request today.
Make your graph legible to the lay person (title, labels, source, captions, etc).
Maybe some project time
We’ll practice with git in our projects.
See moodle for project groups.
Step 5: part 3. To set the line color do color=“green”
For some notes on skew: https://en.wikipedia.org/wiki/Skewness
geom_bar()
counts whatever variable you give it for x.
reorder(categorical_var, numeric variable, function for reordering)
We’ll discuss ethics Monday or Wednesday, read chapter 8.
Color Brewer site
See moodle for project 1 partners.
All labs must be rendered as a pdf or self-contained html.
All code for labs must be satisfactorily commented.
Change the format of lab 2
This lab is due Wednesday at Midnight.
Help us help you: take screenshots of your screen and post them to Slack.
macOS: Command+Shift+3 to take shot of whole screen, Command+Shift+4 to take subportion
Windows: Shift-Windows Key-S and Snip & Sketch
Linux: Print screen
Chromebook: Shift + Ctrl + Show windows
Demo: How R builds a graph.
Working directory problems with scatterplots
Office Hours:
- Monday: 9:20-9:40
- Wednesday: 9:20-10:00, 1:30-2:30 pm
9am - Guest: Cameron Haas
See function_map.qmd
.
map()
.Getting data into R
Leaflet Maps
Overview of Intro to Data Science
Understand File Structure
Pushing, commiting and pulling from git
Strings and Vectors
Libraries, functions, arguments and parameters
Introduction to the pipe
Where are we going?
You are only installing git today. Ignore the other files until Day 3
Link github account to github classroom - sign into github
prereq- We need to have a github account
https://classroom.github.com/a/ERIt75vu for lab 1
find your name in the roster and click it.
you should see lab 1, which we will discuss on Friday.
Sign up for github here, if you don’t already have an account. We will very carefully link your github account to our github classroom account.
Intro to github
My office and group study room.