roundIntegerSum: roundIntegerSum (internal function)

View source: R/mathematical_functions.R

roundIntegerSumR Documentation

roundIntegerSum (internal function)

Description

update a numeric vector such that it's composed of integers and its sum reaches a desired total. Positive or negative discrepancies are distributed proportionally between the summands.

Usage

roundIntegerSum(vec, targetSum)

Arguments

vec

Vector of integers.

targetSum

The target sum to be reached.

Value

The updated vector with the desired total sum.

Author(s)

Rosario M. Piro
Politecnico di Milano
Maintainer: Rosario M. Piro
E-Mail: <rmpiro@gmail.com> or <rosariomichael.piro@polimi.it>

References

http://rmpiro.net/decompTumor2Sig/
Krueger, Piro (2019) decompTumor2Sig: Identification of mutational signatures active in individual tumors. BMC Bioinformatics 20(Suppl 4):152.


rmpiro/decompTumor2Sig documentation built on May 15, 2022, 3:27 a.m.