-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathexercise1.R
41 lines (15 loc) · 976 Bytes
/
exercise1.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
### Exercise 1 ###
# Using the "setwd" function, set your working directory as the directory of your repository
# Read data into a variable called "grants" using the "read.csv" function
# Use the View function to look at your data
# Create a variable "spending" as the "total_amount" column of the dataset
# Confirm that your "spending" variable is a vector using the "is.vector" function
# Create a variable "org" as the "organization" column of the dataset.
# Unfortunately, it will not be a vector by default, so you must transform it using the as.vector function
### Now you can ask some more interesting questions about the dataset. Store your answers in variables ###
# What was the mean grant value?
# What was the dollar amount of the largest grant?
# What was the dollar amount of the smallest grant?
# Which organization received the largest grant?
# Which organization received the smallest grant?
# How many grants were awarded in 2010?