October 2017
Beginner to intermediate
236 pages
7h 38m
English
In this recipe, you will write a new customized function that will take more than one input, and at least one of them will contain default values. Specifically, in this recipe, the function will take one numeric vector as input and another character input with a default value. The objective of this function is to calculate descriptive statistics of the numeric vector, and another character input will specify the type of descriptive statistics, either classical or robust.
The classical descriptive statistics here refers to mean and standard deviation, whereas the robust counterpart refers to median and median absolute deviation (MAD).
The input numeric vector is given as follows:
V1 <- c(3, 7, 2, 6, 9)
The character input is ...