Exercises for Week 2: Answer Template

Your Name Here


Exercise 1

Copy the URL to your Google Doc here:

myURL = "https://docs.google.com/spreadsheet/pub?key=0Am13enSalO74dHJHcjktU3k3NFFXblpMQ25WcDdnMVE&single=true&gid=0&output=csv"
# remember to change this to your own URL!

You can use this command just as is. It will read in your spreadsheet once youve set the variable myURL appropriately. If you don't like the name mydat, feel free to change it.

mydat = fetchGoogle(myURL)
## Loading required package: RCurl
## Loading required package: bitops
head(mydat)
##      Name Age Sex
## 1    Joan  17   F
## 2 Charles  19   M

In this and each of the following, put in an R command that takes the appropriate subset of your data and sums the subset up as required. YOU CAN DELETE THIS LINE.

Problem (1.a)

# Your command here

Problem (1.b)

# Your command here

Problem (1.c)

# Your command here

Problem (1.d)

# Your command here

Problem (1.e)

# Your command here

Exercise 2

Part (2.a)

# Put the barplot commands here

Part (2.b)

# Put the barplot commands here

Exercise 3

Part (3.a)

# Put the commands here

Part (3.b)

# Put the commands here

Part (3.c)

# Put the commands here

Compiled on Tue Feb 26 19:08:30 2013