October 2017
Beginner to intermediate
236 pages
7h 38m
English
An output data type could be one of the many available data types in R, and you could organize the output into a different data structure. For example, the output of this function can be returned as a list of two named elements by creating the function as follows:
meanSe <- function(numVec){ if(is.numeric(numVec) & is.vector(numVec)){ avg <- mean(numVec) std <- sd(numVec) se <- std/sqrt(length(numVec)) out <- list(mean = avg, standardError = se) return(out) } }