round.resolution: Round off to given resolution

View source: R/clanToolsFunctions.R

round.resolutionR Documentation

Round off to given resolution

Description

Round off to given resolution. Resolution = mininum difference between two values in the output that we want to her about.

Usage

round.resolution(rnorm(100),0.05)

Arguments

x

is a vector of numeric values

resolution

is the resolution. For example, 0.2 means that the output can be 0, 0.2, 0.4, 0.6 etc. Resolution equal to 0.001 means that be can have 1.001, 1.002 etc.

offset

is controlling the output as follows: If offset=0 then all input from 0 to 1.999... will give 2 as output etc. If offset=0.5 then all input from -1 to 0.999... will give 2 as output etc. If offset=1.0 then all input from 0 to 1.999... will give 2 as output etc.

Value

A vector with the rounded numbers.

Author(s)

Claus E. Andersen


claus-e-andersen/clanTools documentation built on Nov. 30, 2024, 11:06 p.m.