Internal function to convert a numeric vector into a character vector, where all elements
have the same number of characters (nchar). This is obtained by pasting a series of leading zeros
(or other character) to each number in the input vector.
Usage
leadZeros(n, m, char = "0", na.value = NA)
Arguments
n
numeric vector whose numbers are to be transformed
m
maximum number that will be used to define how many leading zeros to attach
char
string (typically, a single character). This character is used to fill the leading space.
Defaults to 0.
na.value
value used to fill mising values. Defaults to NA
Value
numeric vector of length equal to length(n), where all numbers are converted
to character and modified by attaching the required number of leading zeros (characters).
Details
This is one of the core functions included in the original mutSignatures R library,
and in the WTSI MATLAB framework. This is an internal function.
References
More information and examples about mutational signature analysis can be found here: