R/round_squeeze.R

Defines functions round_squeeze

## File Name: round_squeeze.R
## File Version: 0.04


#***********************************************
# round and squeeze
round_squeeze <- function( x, digits=0, min=-Inf, max=Inf)
{
    x1 <- round( x, digits=digits )
    x1 <- ifelse( x1 < min, min, x1 )
    x1 <- ifelse( x1 > max, max, x1 )
    return(x1)
}
#***********************************************

Try the immer package in your browser

Any scripts or data that you put into this service are public.

immer documentation built on Aug. 22, 2022, 5:05 p.m.