reduction {dst}R Documentation

Summary of a vector for any operator.

Description

This utility function is used to obtain a summary of a vector of data for many operators. The function is taken from the project APL in R (https://rpubs.com/deleeuw/158476).

Usage

reduction(x, f)

Arguments

x

A vector of numbers or a character string.

f

The operator. Must be compatible with the type of input vector (numeric or character)

Value

The result of applying the chosen operator to all the elements of the vector is an object of length 1.

Author(s)

Claude Boivin

References

Examples

 reduction(c(1,2,3,4), f = "-")
 reduction(c(1,0,1,1,0), f = "|")
 reduction(c("a", "b", "c"), f = "paste")
 

[Package dst version 1.6.0 Index]