substr_end: Extract the last n letters of a character

View source: R/substr_end.R

substr_endR Documentation

Extract the last n letters of a character

Description

This is a wrapper for substr for the extraction of the last n letters of a character/word.

Usage

substr_end(x, n)

Arguments

x

A character or character vector.

n

A number which defines the number of letters from the end of the word to be retained.

Value

A character or character vector, as inputted, but including only the last n letters of each element.

Author(s)

Edward Lavender

Examples


substr_end(c("edward", "john"), 2)
substr_end(as.character(seq.Date(as.Date("2016-01-01"), as.Date("2016-01-31"), 1)), 5)


edwardlavender/utils.add documentation built on Dec. 14, 2024, 8:11 a.m.