Week 3 Excercise 1

Filtering a data frame:

df <- read.csv('https://raw.githubusercontent.com/fivethirtyeight/data/master/college-majors/majors-list.csv')

df %>% 
  filter(str_detect(Major, "DATA|STATISTICS"))
##   FOD1P                                         Major          Major_Category
## 1  6212 MANAGEMENT INFORMATION SYSTEMS AND STATISTICS                Business
## 2  2101      COMPUTER PROGRAMMING AND DATA PROCESSING Computers & Mathematics
## 3  3702               STATISTICS AND DECISION SCIENCE Computers & Mathematics

Week 3 Excercise 2

Combining a string:

str_c(c("bell pepper","bilberry","blackberry","blood orange","blueberry","cantaloupe","chili pepper","cloudberry", "olive","salal berry"), collapse=", ")
## [1] "bell pepper, bilberry, blackberry, blood orange, blueberry, cantaloupe, chili pepper, cloudberry, olive, salal berry"

Week 3 Excercise 3

Describe the following expressions in words:

Week 3 Excercise 4

Construct regular expressions to match words that: