concatenate number and string in r code example Example: truncate string in r library(stringr) str_sub('', 1, 3)