shrink.towards: Shrink an integral number by edging towards a destination.

Description Usage Arguments Examples

View source: R/shrink.R

Description

Note we always try the destination first, as that is the optimal shrink.

Usage

1
shrink.towards(destination)

Arguments

destination

the value we want to shrink towards.

Examples

1
2
3
4
5
6
7
8
shrink.towards (0) (100)
# [0,50,75,88,94,97,99]

shrink.towards(500)(1000)
# [500,750,875,938,969,985,993,997,999]

shrink.towards (-50) (-26)
# [-50,-38,-32,-29,-27]

hedgehog documentation built on May 2, 2019, 11:27 a.m.