sum_to: sum_to

Description Usage Arguments Value Examples

View source: R/sum_to.R

Description

Scale a vector so that it sums to some positive number

Usage

1
sum_to(vec, to = 100L)

Arguments

vec

A non-negative integer or numeric vector without NA

to

A positive number

Value

A vector that sums to 'to'

Examples

1
sum_to(c(1,2,3), 100)

talegari/sidekicks documentation built on Sept. 26, 2018, 4:18 p.m.