Function to extract the first n-characters of a string from the left-hand side.
extractLeft(fac, n)
This function returns an object having the first n-characters from the left-hand side.
is an object of class string or factor
is the number of characters to be deleted of a the string given in 'fac'.
Christian Salas-Eljatib
It is specially set to arrange data vector having alphanumeric format.
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
plot.id <- c("BNE1","BNE2","PLE1")
extractLeft(plot.id,1)
extractLeft(plot.id,2)
extractLeft(plot.id,3)
Run the code above in your browser using DataLab