Vectors

counts <- c(0, 2, 2, 6)
weights <- c(1.5, 2.6, 8.4, 0.2)
sum(counts)
max(weights)
total_weight <- sum(weights)

Exercise 1

Matrices (if linear algebra folks)

x <- matrix(1:6, 2)
y <- matrix(1:3, ncol = 1)
x %*% y

Data Frames

surveys["sites"]
surveys[c("counts", "weights")]
surveys$sites
surveys[["sites"]]

Exercise 3