reduction: reduction

Description Usage Arguments Value Examples

View source: R/SupportFunctions.R

Description

Reduce an integer value using a reduction function R(x;r).

Usage

1
reduction(x, red, FUN = round2)

Arguments

x

The integer which is to be reduced.

red

The factor r by which to reduce the input x.

FUN

The reduction function (default is round2(), some alternatives are ceiling() and floor())

Value

An integer value which is the reduction of integer x by reduction factor red using function FUN.

Examples

1
2
3
4
5
6
7
8
x <- 104
xr1 <- reduction(x, 10)
xr2 <- reduction(x, 10, ceiling)

x <- matrix(rbinom(9, 51, 0.25), nrow=3, ncol=3)
reduction(x, 5, FUN=ceiling)
reduction(x, 5)
reduction(x, 5, FUN=floor)

mrparker909/redNMix documentation built on April 4, 2020, 12:24 a.m.