update factor_no.r

creat this function to add a col of ints according to factors, make this
looks like a spss or sas format matrix.
Also useful in makeing figures of geom_segment, when you want to draw
them by the "position" of factors.