Learn R Programming

WGCNA (version 1.43)

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)))

Arguments

x
Vector of numbers to be padded.
width
Width to pad the numbers to.

Value

  • Character vector with the 0-padded numbers.

Examples

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

Run the code above in your browser using DataLab