Skip to content
Prev 279269 / 398503 Next

Extract last 3 characters from numeric vector

You can use nchar() to get the length of the string, and use that in
substring:

mynum <- as.character(15.6)
[1] "5.6"
On Sun, Dec 4, 2011 at 8:38 AM, Kang Min <ngokangmin at gmail.com> wrote: