Frank Wang <fw42746 at gmail.com> you can use function substr() to split the number. x<-c(substr("02d00000",1,4),substr("02d00000",5,8)) > x [1] "02d0" "0000" [[alternative HTML version deleted]]