Learn R Programming

WGCNA (version 1.71)

prependZeros: Pad numbers with leading zeros to specified total width

Description

This function pads the specified numbers with zeros to a specified total width.

Usage

prependZeros(x, width = max(nchar(x)))

Value

Character vector with the 0-padded numbers.

Arguments

x

Vector of numbers to be padded.

width

Width to pad the numbers to.

Author

Peter Langfelder

Examples

Run this code
prependZeros(1:10)
prependZeros(1:10, 4)

Run the code above in your browser using DataLab