Problem Set # 0

Holly Widen

date()
## [1] "Thu Aug 30 13:33:39 2012"

Due Date: September 13, 2012

  1. Assign to an object x the sum of 3 and 5. Find the square root of the sum (2).
  2. Table the following numbers in a vector h: 2 4 0 3 1 0 0 1 2 0 (2).
  3. Create a bar plot showing the numbers in h by frequency (4).

(1) Assign to an object x the sum of 3 and 5. Find the square root of the sum (2).

x = 3 + 5
sqrt(x)
## [1] 2.828

(2) Table the following numbers in a vector h: 2 4 0 3 1 0 0 1 2 0.

h = c(2, 4, 0, 3, 1, 0, 0, 1, 2, 0)
table(h)
## h
## 0 1 2 3 4 
## 4 2 2 1 1 

(3) Create a bar plot showing the numbers in h by frequency.

barplot(table(h), ylab = "Frequency", xlab = "Number")

plot of chunk unnamed-chunk-4

Notes: