Learn R Programming

countSTAR (version 1.0.2)

round_floor: Rounding function

Description

Define the rounding operator associated with the floor function. The function also returns zero whenever the input is negative and caps the value at y_max, where y_max is a known upper bound on the data y (if specified).

Usage

round_floor(z, y_max = Inf)

Value

The count-valued output(s) from the rounding function.

Arguments

z

the real-valued input(s)

y_max

a fixed and known upper bound for all observations; default is Inf

Examples

Run this code

# Floor function:
round_floor(1.5)
round_floor(0.5)

# Special treatmeant of negative numbers:
round_floor(-1)

Run the code above in your browser using DataLab