[R] Get the last 3 chars of a string

Thomas Lumley tlumley at u.washington.edu
Tue Oct 16 16:49:37 CEST 2007


On Mon, 15 Oct 2007, Gabor Grothendieck wrote:

> Here is an alternative:
>
> sub(".*(..)$", "\\1", x)
>

For sufficiently small values of 3 ;)

 	-thomas

Thomas Lumley			Assoc. Professor, Biostatistics
tlumley at u.washington.edu	University of Washington, Seattle



More information about the R-help mailing list