-
Notifications
You must be signed in to change notification settings - Fork 70
/
Copy pathexercise3.R
41 lines (17 loc) · 936 Bytes
/
exercise3.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
35
36
37
38
39
40
41
### Exercise 3 ###
# Create a vector of 100 employees ("Employee 1", "Employee 2", ... "Employee 100)
# Create a vector of 2014 salaries using the runif function
# Create a vector of 2015 salaries that are typically higher than the 2014 salaires, but not always
# Create a data.frame 'salaries' by combining the vectors you just made
# In "salaries", change the name of Employee 1 to your name. Did you get an error?
# Create a column 'got_raise' that is TRUE if the person got a raise
# How many employees got a raise?
# What was the average salary increase?
# Write a .csv file of your salaries to your working directory
### Bonus ###
# For people who did not get a raise, how much money did they lose?
# Is that what you expected them to lose?
### Double Bonus ###
# Repeat the above experiment 100 times, tracking the loss each time.
# Does the average loss equal what you expect?
# What about 10,000 times?