right: right

View source: R/right.R

rightR Documentation

Description

Simplified variant of 'substr' imitating the Excel & Alteryx 'RIGHT' function with an option to pad.

Usage

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

Arguments

x

Vector to extract from.

n

Number of characters to extract starting from the right.

pad

Character to pad string values with (from the right) if the input vectors are less than n.

Value

Transformed vector of 'n' length.

Examples

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


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