round_to | R Documentation |
Rounds a vector to the nearest in a set of anchors.
round_to(x, anchors)
x |
A vector of values |
anchors |
A vector of anchor values |
x <- rpois(10, 1)
anchors <- c(0, 0.5, 1.5, 3)
data.frame(x, anchor = round_to(x, anchors))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.