extractRight {datana}R Documentation

This function extracts the last n-characters of a string.

Description

It extracts the last n-characters of a string from the right-hand side.

Usage

extractRight(fac, n)

Arguments

fac

is an object (vector or scalar) of class string or factor

n

is the number of characters to be extracted of a the string given in 'fac'.

Value

This function returns an object having the last-n characters of the object 'fac'

Author(s)

Christian Salas-Eljatib.

Examples


last.names.id <- c("Stage-1924","Gregoire-1958","Robinson-1967")
extractRight(last.names.id,5)
years <- extractRight(last.names.id,4)
years
 

[Package datana version 1.0.3 Index]