round_to: Round to

View source: R/round.R

round_toR Documentation

Round to

Description

Rounds a vector to the nearest in a set of anchors.

Usage

round_to(x, anchors)

Arguments

x

A vector of values

anchors

A vector of anchor values

Examples

x <- rpois(10, 1)
anchors <- c(0, 0.5, 1.5, 3)
data.frame(x, anchor = round_to(x, anchors))

jmbarbone/jordan documentation built on June 10, 2025, 6:22 p.m.