Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

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.

Author(s)

Peter Langfelder

Examples

prependZeros(1:10)
prependZeros(1:10, 4)

WGCNA

Weighted Correlation Network Analysis

v1.70-3
GPL (>= 2)
Authors
Peter Langfelder <Peter.Langfelder@gmail.com> and Steve Horvath <SHorvath@mednet.ucla.edu> with contributions by Chaochao Cai, Jun Dong, Jeremy Miller, Lin Song, Andy Yip, and Bin Zhang
Initial release
2021-02-17

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.