SDS 192: Intro to Data Science

Author

Nicholas Schwab

Published

November 30, 2024

Schedule

Day 36 Project 3 and Final Project

The final project instructions can be found here.

Today and Wednesday you should mostly work on Project 3 in class

Day 35 Project 3

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.

Day 34 SAL guests

Jon Caris and Kala’i Ellis

Survey for Prof Coa’s class)

Quiz 3 is available and due by Sunday.

Day 33 Lab 7 Mapping Monarchs.

Here is the lab for today.

It is due next Monday.

Day 32 Choropleth Mapping and Leaflet

Choropleth Mapping

Day 31 Mapping with simple features (sf) and shape files

Simple features and Shape files.

In class activity

Quiz 3 on mapping is open, don’t take it until after Monday’s class.

Day 30 Functions and Static Maps

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

Anonymous functions

Mapping Review

Example: static maps

Day 29 Practice function writing in R

Chapter 7 Problem 1 and 3

Day 28 Lab 6

Lab 6

Day 27: Bonus Project 2 day?

Making our own functions

Day 26: Iteration

Lecture: across() and map()

In class activity

Making our own functions

Day 25: Function refresher

Data Masking

More on masking

Day 24: Project 2 work day

Day 23: Final Project: Website

  • Make a new private repo

  • Move all your website files to that repo

    • Recall they are in your lab 1 folder.
  • Add your project 1 to your website.

  • #| echo: False to hide code from a code chunk.

  • #| eval: False to not include the output of the code.

  • More options

What more to do?

Day 22

Project 1 grades are up and current. Please let me know if you cannot see grades on moodle.

Project 2 workday

Day 21

Lab 5 reflection - personal information

Many to one join warning.

Pivot Practice - Problem 5 chapter 6

Project 2

Day 20 Pivots

Reflection on Lab 4

Pivots

We’ll do Problems Chapter 4: 1,2,5,9,(12) in class today. Chapter 5: 3,4

Day 19 lab 5

POM

Map

before rendering:

  • remove the #| 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

  • Open the .gitignore file and add sqf_2011.csv to it.

Lab 5

Day 18 Joining tables

Exploration: How to join tables?

Problems 1, 4

Joining two tables in class exercise

Day 17 Lab 4

Lab 4 SQF

rendering:

  • Note on #| 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

  • Open the .gitignore file and add sqf_2011.csv to it.

Day 16

Wrangle babynames

Code
 install.packages("babynames")

Day 15 Data wrangling in one table.

Lecture on the five verbs

dpylr cheatsheet for wrangling

Make the Random_subset data frame.
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

  )

Day 14 Project 1 work day

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).

Day 13 Ethics

Data Ethics

Maybe some project time

Day 12 Practice with git/ Project 1

We’ll practice with git in our projects.

Another git lecture

Project 1

See moodle for project groups.

Day 11 Lab 3

Link to lab 3

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.

Day 10 Color theory

ggplot cheatsheet

Colors

Figure 2.26 from Modern Dive

See moodle for project 1 partners.

Day 9 Taxonomy part 2

  1. Together: scatter plot
  • We are halfway through this open Lec02In-classExercise
  1. Solo: linegraph

  2. Frequency Plots

  3. Notes on Style

  • All labs must be rendered as a pdf or self-contained html.

  • All code for labs must be satisfactorily commented.

Day 8 Lab 2

Change the format of lab 2

This lab is due Wednesday at Midnight.

Lab 2

Day 7 Taxonomy

Kaelen Medeiros Healthech

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

Lecture

Working directory problems with scatterplots

Day 6 No Computer Data Viz

  • Office Hours:

    -   Monday: 9:20-9:40
    
    -   Wednesday: 9:20-10:00, 1:30-2:30 pm

Data Viz No Computers

Notes on Style

9am - Guest: Cameron Haas

Day 5 Making Functions (cont.)

Lecture: Intro to functions

See function_map.qmd.

  • Make a function that takes the country each person is from and makes a map().

Day 4 Getting Data Into R Making functions

Getting data into R

Leaflet Maps

Lecture: Intro to functions

Day 3 Understanding File Paths

Survey for Prof Cao’s study

Overview of Intro to Data Science

  • Understand File Structure

    • Filing system
  • Pushing, commiting and pulling from git

  • Strings and Vectors

  • Libraries, functions, arguments and parameters

  • Introduction to the pipe

Where are we going?

  • Final project Website

Day 2 Github Lab

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.

Day 1 Welcome and Github

Walk to MCConnell 215 and 214

My office and group study room.