Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added DS_Store files to the gitignore #3

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,9 @@ vignettes/*.pdf
/*_cache/
/cache/

# Mac system files
.DS_Store

# Temporary files created by R markdown
*.utf8.md
*.knit.md
20 changes: 15 additions & 5 deletions exercise-8/exercise.R
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# Exercise 8: Pulitzer Prizes
setwd("~/Work/School/INFO201/m11-dplyr/exercise-8/")

# Read in the data
pulitzer <- read.csv("data/pulitzer-circulation-data.csv", stringsAsFactors = FALSE)
Expand All @@ -9,27 +10,36 @@ pulitzer <- read.csv("data/pulitzer-circulation-data.csv", stringsAsFactors = FA
#install.packages(dplyr)
library(dplyr)

# View in the data set. Start to understand what the data columns contains
# View in the data set. Start to understa'nd what the data columns contains
# Be sure to comment out the function so it won't view everytime you run the code.

View(pulitzer)

# Use 'colnames' to print out the names of the columns

print(colnames(pulitzer))

# Use 'str' to print what types of values are contained in each column
# Did any value type surprise you? Why do you think they are that type?

print(str(pulitzer))

# Add a column that contains the diffrence in changes in Daily Circulation from 2004 to 2013
pulitzer.diff <- mutate(pulitzer, Change.2004.to.2013 =
Pulitzer.Prize.Winners.and.Finalists..2004.2014 -
Pulitzer.Prize.Winners.and.Finalists..1990.2003)


# What publication gained the most pulitzer prizes from 2004-2014?
# Be sure to use the pipe operator!
most.pulitzer <- filter(pulitzer.diff, max(Pulitzer.Prize.Winners.and.Finalists..2004.2014) ==
Pulitzer.Prize.Winners.and.Finalists..2004.2014) %>% select(Newspaper)


# Which publication with at least 5 Pulitzers won from 2004-2014 had the biggest decrease(negative) in Daily circulation numbers?
# This publication should have Pulitzer prizes won a minimum of 5 Pulitzers, as well as the biggest decrease in circulation


# Your turn! An important part about being a data scientist is asking questions.
# Create a question and use dplyr to figure out the answer.
# Create a question and use dplyr to figure out the answer.