How can I get the last n characters from a string in R? Is there a function like SQL's RIGHT?
str = 'This is an example' n = 7 result = substr(str,(nchar(str)+1)-n,nchar(str)) print(result) > [1] "example" >