tapply is a function in the R programming language for apply a function to subsets of a vector.
tapply
is a function in the R programming language for apply a function to subsets of a vector. A vector is broken in to subsets, potentially of different lengths (aka a ragged array) based on the values of one or more other vector. The second vector is either already a factor or coerced to be a factor by as.factor
. A function is applied to each of these subsets. tapply
then returns either an array or a list, depending on the output of the function.