String manipulations in R.