-
Notifications
You must be signed in to change notification settings - Fork 1
/
Lesson 5.R
34 lines (17 loc) · 983 Bytes
/
Lesson 5.R
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
### First stuff on local!
# Learning ifelse ---------------------------------------------------------
library(tidyverse)
farmerSales <- read_csv("farmerSales.csv")
## Oh no, someone made a typo for SLIT Nursery:
farmerSales %>% filter(buyerName == "SLIT Nursery")
## MarketPrice should be 124!
farmerSales <- farmerSales %>%
mutate(marketPrice = ifelse(buyerName == "SLIT Nursery", 124, marketPrice))
# Exercise 1 --------------------------------------------------------------
## Read in dirty.csv, change Gender = "F" to "Female" and "M" to "Male",
## then find out what is the % of females in the sample group?
dirty %>% mutate(Gener)
# Exercise 2 --------------------------------------------------------------
## And now fix the whole Northern vs Northern Region thingie.
# Exercise 3 --------------------------------------------------------------
## Read in 20-0282-techapp1.xlsx. Wait, how do we read in Excel files? Write up how you would ask the question