R/immer_trim_increment.R

Defines functions immer_trim_increment

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

immer_trim_increment <- function(incr, max_incr)
{
    do_cut <- TRUE
    while( do_cut ){
        incr <- ifelse( abs(incr) > max_incr, incr / 2, incr )
        do_cut <- ( sum( abs(incr) > max_incr ) > 0 )
    }
    return(incr)
}

Try the immer package in your browser

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

immer documentation built on May 29, 2024, 11:52 a.m.