substrRight: Takes a substring of a character string counting from the RHS

Description Usage Arguments Examples

View source: R/substrRight.r

Description

This function allows the user to extract a substring of a character string whilst containing the start and stop values from the RHS of the string. The user is also given the option of reversing the extracted string before returning the extracted value.

Usage

1
substrRight(x, start, stop, reverse)

Arguments

x

a character vector

start

integer. The first element to be replaced (counting from the RHS).

stop

integer. The last element to be replaced (counting from the RHS).

reverse

logical. Reverse the ordering of characters. Defaults to FALSE.

Examples

1
2
3
4
5
x <- '91726352EXTRACT ME2345'
substrRight(x = x, start = 5, stop = 14)

x <- '15679NODNOL'
substrRight(x = x, start = 1, stop = 6, reverse = TRUE)

PSMD-Psychometrics/TestMR documentation built on May 3, 2019, 3:36 p.m.