Learn R Programming

datana (version 1.0.9)

deleteLeft: Deletes the first n-characters of a string

Description

Function to delete the last n-characters of a string from the left-hand side.

Usage

deleteLeft(fac, n)

Value

This function returns an object having n-less characters from the left-hand side.

Arguments

fac

is an object of class string or factor

n

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

Author

Christian Salas-Eljatib

Details

It is specially set to arrange data vector having alphanumeric format.

References

Salas-Eljatib, C. 2021. Análisis de datos con el programa estadístico R: una introducción aplicada. Ediciones Universidad Mayor, Santiago, Chile. 170 p. https://eljatib.com/rlibro

Examples

Run this code

plot.id <- c("BNE1","BNE2","PLE1")
deleteLeft(plot.id,1)
deleteLeft(plot.id,2)
deleteLeft(plot.id,3)

Run the code above in your browser using DataLab