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
lstis as follows:
##  "b"
Another way is:
For each of the following objects, find at least two ways to access it within
##  "b"
- 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
- 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 name of the mean should be
- the name of the standard deviation should be
- the name of the median should be
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