View source: R/mathematical_functions.R
roundIntegerSum | R Documentation |
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.
roundIntegerSum(vec, targetSum)
vec |
Vector of integers. |
targetSum |
The target sum to be reached. |
The updated vector with the desired total sum.
Rosario M. Piro
Politecnico di Milano
Maintainer: Rosario
M. Piro
E-Mail: <rmpiro@gmail.com> or <rosariomichael.piro@polimi.it>
http://rmpiro.net/decompTumor2Sig/
Krueger, Piro (2019) decompTumor2Sig: Identification of mutational
signatures active in individual tumors. BMC Bioinformatics
20(Suppl 4):152.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.