right: Get a substring from the right

View source: R/all.R

rightR Documentation

Get a substring from the right

Description

Inspired by the Excel function with the same name.

Usage

right(string, n)

Arguments

string

a vector of strings

n

a vector of integers (will be recycled, if needed)

Value

The last n characters of each value in string. If n has length 1, then that value is applied to all strings because of recycling. However, n can have more than one element!

Examples

right('lazy dog', 3)
right(c('lazy dog', 'blue dog'), 3)
right(c('lazy dog', 'red frog'), c(3, 4))


adamleerich/alrtools documentation built on March 12, 2024, 11:38 p.m.