strTail: Function that returns the last n characters from a (vector...

strTailR Documentation

Function that returns the last n characters from a (vector of) character string(s)

Description

Function that returns the last n characters from (vector of) character string(s).

Usage

strTail(
	string,
	n_char=1)

Arguments

string

Character string or vector of character strings.

n_char

Number of characters to take from the tail (starting at the last character) of the string (or vector of strings). Defaults to 1.

Details

Typical use of the function is return just the last few characters of a character string.

Value

Function returns a character string (vector) consisting of the last n_char of the character string (vector of character strings).

Author(s)

Damian W. Betebenner dbetebenner@nciea.org

Examples

strTail(state.name, 2) ### Last two characters of each state name


CenterForAssessment/packageSkeletonForR documentation built on April 24, 2022, 7:54 p.m.