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