left: left

View source: R/left.R

leftR Documentation

left

Description

Simplified variant of 'substr' imitating the Excel & Alteryx 'LEFT' function.

Usage

left(x, n = 4, pad = NULL)

Arguments

x

Vector to extract from.

n

Number of characters to extract starting from the left.

pad

Character to pad string values with if the input vectors are less than n.

Value

Transformed vector of 'n' length.

Examples

left(c('Example', 'E.g.', 'Eg'),
     n = 4,
     pad = ' ')


toddellis/miao documentation built on June 1, 2025, 10:11 p.m.