Extension Requests

  • You have an extension “budget” of a maximum of 5 days for the rest of the semester; it’s up to you to keep track of your budget
  • Request must be made before due date/time.
  • Google Form

Problem set 07

Due Monday 12/6 9pm

For this problem set you will start building a GitHub portfolio of work. You need to complete all steps to receive full credit.

1. Edit your public GitHub profile

Learning Goal: Edit your public GitHub profile (if you haven’t already). Think of this as a professional profile like a LinkedIn profile. Refer to Sec02 in-class data assistant Marium Tapal’s profile as an example.

  1. Add your name
  2. Change your default profile picture. It doesn’t have to include your face if you’re not comfortable.
  3. Add whatever other info to your profile you feel comfortable being public.

2. Create your first repo with a README

Learning Goal: Build your first README. Think of this as a cover page to market your project.

  1. Get started
    1. Download the following zip file: PS07.zip.
    2. Move PS07.zip to your SDS192 folder on your computer
    3. Unzip PS07.zip. Windows users: be sure to “Extract all”
    4. In the resulting PS07 folder, double-click the RStudio Project PS07.Rproj icon. For this PS you should always work in “PS07” RStudio Project mode
  2. Change the default contents of README.Rmd to anything you like. In particular look at RStudio menu bar -> Help -> Markdown Quick Reference for markdown formatting tips.
    1. Title
    2. Section names
    3. The plot (change it to be a ggplot2 plot)
  3. Knit README.Rmd to produce README.md which is your repo’s cover page
  4. Put your work on GitHub. See screencast:

3. Submission

Submit a link to this GitHub repository using this Google Form.


Problem set 06

Due Monday 11/15 9pm

1. R Markdown component

Getting started:

  • Download the following zip file: PS06.zip.
  • Move PS06.zip to your SDS192 folder on your computer
  • Unzip PS06.zip. Windows users: be sure to “Extract all”
  • In the resulting PS06 folder, double-click the RStudio Project PS06.Rproj icon. For this PS you sound always work in “PS06” RStudio Project mode (See Lec26 Mon 11/8)

Submission:

  • You will only be submitting the resulting PS06.pdf file on gradescope. Please use the “Knit to PDF” method directly, instead of “Knit to Word” and then save to PDF method.
  • If you encounter issues knitting your document, consult the 6 R Markdown Fixes.
  • Submit on gradescope:
    1. For each questions, tag all pages of your PDF that relate to that question (not just the first)
    2. You will be asked to tag the honor code question as well.

Problem set 05

Due Monday 10/25 9pm

1. R Markdown component

  • Download the following Rmd template file: PS05.Rmd.
  • You will be submitting the resulting PS05.pdf file on gradescope. Please use the “Knit to PDF” method directly, instead of “Knit to Word” and then save to PDF method.
  • Complete the individual questions. Knit early, knit often.
  • If you encounter issues knitting your document, consult the 6 R Markdown Fixes.
  • Submit on gradescope:
    1. For each questions, tag all pages of your PDF that relate to that question (not just the first)
    2. You will be asked to tag the honor code question as well.

2. Solutions

Solutions to PS05 Q1.c). What happened to the average age above 60? The hint given on Slack was to look at the ggplot2 cheatsheet -> 2nd page -> Bottom right corner -> “Zooming”

  • ylim(a, b) sets the limit on the y-axis to be between a to b and “clips” (throws out) any points outside this interval
  • coord_cartesian(ylim=c(a, b)) zooms in on the the y-axis to be between a to b but does not “clip” (throw out) the points outside this interval

For example, consider the following regression line:

library(ggplot2)
library(dplyr)

example <- tibble(
  x = c(1, 2, 3, 4, 5),
  y = c(1, 1, 1, 1, 5)
)

ggplot(example, aes(x = x, y = y)) +
  geom_point() +
  geom_smooth(method = "lm", se = FALSE)

Let’s set the y-axis limit to be between 0 and 3. Using ylim(0, 3) clips out the point (5, 5) and thus the regression line is flat:

ggplot(example, aes(x = x, y = y)) +
  geom_point() +
  geom_smooth(method = "lm", se = FALSE) +
  ylim(0, 3)

However, using coord_cartesian(ylim = c(0, 3)) merely zooms in on this part of the y-axis without clipping the point (5, 5) and thus the regression line is the original one:

ggplot(example, aes(x = x, y = y)) +
  geom_point() +
  geom_smooth(method = "lm", se = FALSE) +
  coord_cartesian(ylim = c(0, 3))


Problem set 04

Due Monday 10/18 9pm

1. R Markdown component

  • Download the following Rmd template file: PS04.Rmd.
  • You will be submitting the resulting PS04.pdf file on gradescope. Please use the “Knit to PDF” method directly, instead of “Knit to Word” and then save to PDF method.
  • Complete the individual questions. Knit early, knit often.
  • If you encounter issues knitting your document, consult the 6 R Markdown Fixes.
  • Submit on gradescope:
    1. Anytime between Wed 10/13 8pm and Mon 10/18 9pm
    2. For each questions, tag all pages of your PDF that relate to that question (not just the first)
    3. You will be asked to tag the honor code question as well.

2. Solutions


Problem set 03

Due Tuesday 9/28 9pm

1. R Markdown component

  • Download the following Rmd template file: PS03.Rmd.
  • You will be submitting the resulting PS03.pdf file on gradescope. Please use the “Knit to PDF” method directly, instead of “Knit to Word” and then save to PDF method.
  • Complete the individual questions. Knit early, knit often.
  • If you encounter issues knitting your document, consult the 6 R Markdown Fixes.
  • Submit on gradescope:
    1. Anytime between Mon 9/20 5pm and Tue 9/29 9pm
    2. For each questions, tag all pages of your PDF that relate to that question (not just the first)
    3. You will be asked to tag the honor code question as well.

2. Solutions


Problem set 02

Due Monday 9/20 5pm

1. R Markdown component

  • Download the following Rmd template file: PS02.Rmd.
  • You will be submitting the resulting PS02.pdf file on gradescope. There are two methods to create a PDF:
    1. “Knit to PDF”. This is the preferred format (for consistency for the graders).
    2. If this doesn’t work for you, then “Knit to Word” and then export/save as PDF
  • Complete the individual questions. Knit early, knit often.
  • If you encounter issues knitting your document, consult the 6 R Markdown Fixes.
  • Submit on gradescope:
    1. Anytime between Mon 9/13 5pm and Mon 9/20 5pm
    2. For each questions, tag all pages of your PDF that relate to that question (not just the first)

2. Solutions


Problem set 01

Due Monday 9/13 5pm

  1. If you haven’t already, complete the intro survey distributed on Friday.
  2. Complete a syllabus quiz.
    • Open the following Google Doc and in the menu bar click “File -> Make a copy…”
    • Answer the questions based on information in the syllabus.
  3. Submit a PDF of your syllabus quiz responses on gradescope:
    • Your gradescope account is based on your Smith, 5 College, or other official email.
    • Create your account on gradescope via the email sent to you this morning. If you did not receive such an email, add yourself to the course using Entry Code: 6PNXZ5.
    • Log into gradescope
    • Added after lecture: You can edit gradescope submissions as many times as you like before the due date/time.
    • Added after lecture: You need to “tag” the 11 individual questions on whatever page(s) they are on (demo on Fri 9/10)