R/pad.left.R

Defines functions pad.left

# pad.right: Returns s padded with spaces to the right so that the string
#   is exactly width wide.
# It takes:
#   s: a string 
#   width: a positive integer
# Author: Alexis Dinno
# Date: Sep 28, 2026
pad.left <- function(s, width) {
  len.s <- nchar(s)
  if (len.s < width) {
    s <- paste0(paste0(rep(" ", width - len.s),collapse=""), s)
    }
  return(s)
  }

Try the LoopAnalyst package in your browser

Any scripts or data that you put into this service are public.

LoopAnalyst documentation built on Oct. 5, 2026, 1:07 a.m.