## Exercises 1. We are given the following list:

lst <- list(yabba = letters,
dabba = list(x = LETTERS,
y = 1:10),
do = bcscr::m111survey)

One way to access the letter “b” in the first element of lst is as follows:

lst$yabba ##  "b" Another way is: lst[] ##  "b" For each of the following objects, find at least two ways to access it within lst: • the vector of letters from “c” to “j”; • the capital letter “F”; • the vector of numbers from 1 to 10; • the heights of the five tallest individuals in m111survey. 2. Write a function called goodStats() that, when given a vector of numerical values, computes the mean, median and standard deviation of the values, and returns these values in a list. The function should take two parameters: • x: the vector of numerical values; • ...: the ellipses, which allow the user to pass in additional arguments. The list returned should name each of the three quantities: • the name of the mean should be mean; • the name of the standard deviation should be sd; • the name of the median should be median. Typical examples of use should look like this: vec <- 1:5 goodStats(x = vec) ##$mean
##  3
##
## $sd ##  1.581139 ## ##$median
##  3
vec <- c(3, 7, 9, 11, NA)
myStats <- goodStats(x = vec, na.rm = TRUE)
myStats\$mean
##  7.5